Recent

Author Topic: Hex colors got me spinning crazy  (Read 8295 times)

Elmug

  • Hero Member
  • *****
  • Posts: 849
Hex colors got me spinning crazy
« on: September 09, 2011, 04:42:39 am »
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.
« Last Edit: September 09, 2011, 04:49:45 am by Elmug »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Hex colors got me spinning crazy
« Reply #1 on: September 09, 2011, 05:38:50 am »
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

  • Full Member
  • ***
  • Posts: 198
Re: Hex colors got me spinning crazy
« Reply #2 on: September 09, 2011, 05:44:36 am »
Swap the first two digits and the last two digits and give it a try; D9FFFF  -->>  FFFFD9.

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Hex colors got me spinning crazy
« Reply #3 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.

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: Hex colors got me spinning crazy
« Reply #4 on: September 09, 2011, 01:29:13 pm »
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.

00 is the alpha Intensity, which means the transparency of color.
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Hex colors got me spinning crazy
« Reply #5 on: September 09, 2011, 01:57:59 pm »
00 is the alpha Intensity, which means the transparency of color.
I suppose. It's just confusing when it's used in solid colors which don't support transparency. I take it's just a placeholder most of the time.

Elmug

  • Hero Member
  • *****
  • Posts: 849
Re: Hex colors got me spinning crazy
« Reply #6 on: September 09, 2011, 07:54:08 pm »
Thanks for the great help, everyone.

I will just use and pick colors for Lazarus use using its own color picker from now on.

Since the color number was for use in a short code statement, I thought opening web pages which have color charts with hex were compatible with the Lazarus numbers.

I even thought maybe the first webpage I visited was wrong. But then I got the same differences in other webpages.

I still don't gather the reason for the difference, though.

 

TinyPortal © 2005-2018