Hi Christian!
Mr. Christian Iversen wrote to Mr. All:
CI> i have tried to subtract $00808080 from it is this right
Well, that makes it darker if its components have values larger than 80h.
Just remember that the number is this way: $00BBGGRR, where BB is the blue
component, GG is the green component and RR is the red component, so if you
want to make it darker just try this:
procedure Dark(VAR C : TColor);
begin
C := (C AND $FF) - 1 +
(((C AND $FF00) SHR 8) - 1 ) SHL 8 +
(((C AND $FF0000) SHR 16) -1) SHL 16;
end;
That decreases each value by one, call it more times to make it more and more
darker, but remember that you cannot substract one if the value is zero, so
check berfore that each component is not zero:
IsZero := ((C AND $FF)=0) OR
((C AND $FF00) =0) OR
((C AND $FF0000) = 0);
CI> How do you do it.
That way ;-)
See you :)
--- FMail 1.02
---------------
* Origin: Edison's Temple BBS - Madrid (2:341/136.39)
|