Hola Amigos
I´m trying to mix two TColor
For example if the two TColors are white the result should be white and if I had a black and a white TColor the result should be Grey
Which´s the function to make this?
Thanks to everyone!!
I dont know if there are any predefined functions to do this but TColour's (sorry TColor's) are just Integer values the Top 8 bits define other attributes but the low 24 define the colours
In hex $FFFFFFFF is white, so provided you mask the top two nybbles you can do Bitwise manipulation of the values
OR, AND, XOR each of the 3 lower Bytes is a colour.
I haven't bothered with the masking but this works.
You get a purple panel.
procedure TForm1.Button1Click(Sender: TObject);
var C1,C2,C3: Tcolor;
begin
C1 := CLRed;
C2 := ClBlue;
C3 := C1 or C2;
Panel.Color := C3
end;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.