Changing TColor to darker and lighter ... did you ever try it? It can be a b*tch ...
Here two procedure that make it easier on you.
Usage:
Canvas.Brush.Color:=Lighter(clBlue,20); // sets the color to 20% lighter than clBlue
Note: under Lazarus you'll need to add "LclIntf" to your uses clause (GetRValue etc. are Windows calls and Lazarus is crossplatform)
function Darker(MyColor:TColor; Percent:Byte):TColor;
var r,g,b:Byte;
begin
MyColor:=ColorToRGB(MyColor);
r:=GetRValue(MyColor);
g:=GetGValue(MyColor);
b:=GetBValue(MyColor);
r:=r-muldiv(r,Percent,100); //Percent% closer to black
g:=g-muldiv(g,Percent,100);
b:=b-muldiv(b,Percent,100);
result:=RGB(r,g,b);
end;
function Lighter(MyColor:TColor; Percent:Byte):TColor;
var r,g,b:Byte;
begin
MyColor:=ColorToRGB(MyColor);
r:=GetRValue(MyColor);
g:=GetGValue(MyColor);
b:=GetBValue(MyColor);
r:=r+muldiv(255-r,Percent,100); //Percent% closer to white
g:=g+muldiv(255-g,Percent,100);
b:=b+muldiv(255-b,Percent,100);
result:=RGB(r,g,b);
end;