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.

uses Image32, Image32_PNG,
  Image32_Draw, Image32_Extra;
...
var
  i,j: integer;
  img: TImage32;
  path: TArrayOfPointD;
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