I having one Delphi XE2 Project to change Label01 Font Color
using Timer04
. So I have written the following codes:
procedure TMainForm.FormCreate(Sender: TObject);
begin
Timer04.Enabled := true;
end;
..
..
..
..
..
procedure TMainForm.Timer04Timer(Sender: TObject);
var
StartColor, RedColor, GreenColor, BlueColor: integer;
begin
StartColor := ColorToRGB(Label01.Font.Color);
RedColor := GetRValue(StartColor);
GreenColor := GetGValue(StartColor);
BlueColor := GetBValue(StartColor);
if RedColor <= 251 then Inc(RedColor, 1) else RedColor := 1;
if GreenColor <= 252 then Inc(GreenColor, 2) else GreenColor := 2;
if BlueColor <= 253 then Inc(BlueColor, 3) else BlueColor := 3;
Label01.Font.Color := RGB(RedColor, GreenColor, BlueColor);
end;
This codes work perfectly. Label01 Font Color
changes between different colors.
Now I am trying to implement that Label02 Color
will be fixed (say Green) and the value of brightnees will be increase from 0 to 100. If the value reaches to 100 it will be decreased to 0 and it will be continuous to a loop.
For my case I have chosen HUE=135
, SATURATION=85
and BRIGHTNESS=50
. The value of BRIGHTNESS
will be increased from 50 to 100 and then will be decreased from 100 to 0 and it will be continued.
But the problem is that there is no such Function
available to convert HSB
to RGB
and vice versa in Delphi XE2
. I have Gooled it. But I have found any Function
as HSBToRGB
. Only some Delphi Unit
is availabe. I have read their revoews and found that every one is having some bugs.