AdjustHue

function AdjustHue(color: TColor32; percent: Integer): TColor32;


This function converts a TColor32 value into a THsl record, adjusts its hue by the specified percent before converting it that back to a new TColor32 value.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
uses Img32, Img32.Fmt.PNG,
  Img32.Draw, Img32.Extra;
...
var
  i,j: integer;
  img: TImage32;
  path: TPathD;
begin
  img := TImage32.Create(256, 256);
   
  //DRAW ROUND UNCOLORED BUTTONS - OMITTED
 
  //draw some colored square buttons
  j := 15;
  for i := 3 to 12 do
  begin
    DrawButton(img, PointD(j, 180), i*2,
      AdjustHue(clRed32, (i- 3) * 10),
      [boSquare, boDropShadow]);
    inc(j, 10 + i*2);
  end;
 
  img.SaveToFile('buttons.png');
  img.Free;
end;

See Also

TImage32.AdjustHue, THsl