HSV => RGB
- function HSV2RGB(h: integer; s, v: double): GraphABC.Color;
- var
- Hi: integer;
- f, p, q, t, r, g, b: double;
- begin
- Hi := (h div 60) mod 6;
- f := h / 60 - (h div 60);
- p := v * (1 - s);
- q := v * (1 - f * s);
- t := v * (1 - (1 - f) * s);
- case Hi of
- 0: begin r := v; g := t; b := p; end;
- 1: begin r := q; g := v; b := p; end;
- 2: begin r := p; g := v; b := t; end;
- 3: begin r := p; g := q; b := v; end;
- 4: begin r := t; g := p; b := v; end;
- 5: begin r := v; g := p; b := q; end;
- end;
- Result := GraphABC.RGB(round(r * 255), round(g * 255), round(b * 255));
- end;