Forum > LCL

Hex colors got me spinning crazy

(1/2) > >>

Elmug:
Good people:

I picked a color for use with code directly using Lzarus and it was this color numba:

$00C4FFFF

This shows a yellow color, like post-it notes.

Now I tried to use a lighter yellow and using the web, picked a yellow color. I place it in the code and I get a light sky blue.

Now, I put the $00C4FFFF in a web app that generates color from hex number and I get a bluish color in the same vecinity, turquoise like.

I now got doubts on what's going on. Of course if I use only Lazarus numbers withing Lazarus all is OK.

But those numbers are not valid outside, or are offset? I thought HEX numbered colors were standard.

NOW I got this yellow number from Lazarus:
D9FFFF

and in the webpage generator this gives me a light turquoise again. As if the light cyan or turquoise and yellows are exchanged?


Thanks for any replies.

Leledumbo:
I think instead of relying on the number you should use RGBToColor, endianness problem might cause the bytes to be swapped.

Dick, from the internet:
Swap the first two digits and the last two digits and give it a try; D9FFFF  -->>  FFFFD9.

User137:
Lets see that in detail: 00C4FFFF Divided in 4 parts
00: Not sure what exactly this is for...
C4: Intensity of Red
FF: Intensity of Green
FF: Intensity of Blue

You know that full yellow should be FFFF00, and full blue a 0000FF. So whereever you first got $00C4FFFF for yellow was not RGB, but BGR.

fabienwang:

--- Quote from: User137 on September 09, 2011, 09:31:21 am ---Lets see that in detail: 00C4FFFF Divided in 4 parts
00: Not sure what exactly this is for...
C4: Intensity of Red
FF: Intensity of Green
FF: Intensity of Blue

You know that full yellow should be FFFF00, and full blue a 0000FF. So whereever you first got $00C4FFFF for yellow was not RGB, but BGR.

--- End quote ---

00 is the alpha Intensity, which means the transparency of color.

Navigation

[0] Message Index

[#] Next page

Go to full version