I've never seen color codes like -1
, -16777216
, -256
, etc. So my current problem is this:
We have a third-party software where you can color-code a value as illustrated in the picture below.
Now I'm creating a PHP report that displays those values but I also want to display them using the same colors as what is defined in the software. I was able to hunt the values down from the database but I'm confused as the values are in a format or notation that I'm not familiar with.
Could you help me convert these values to either HEX or RGB in either Oracle or PHP which is what I'm used to (I will use it for CSS for the report).
EDIT
Looking at the database and the colors in the software I could at least match the numbers like so:
-1
= White
-12582784
= Purple
-65408
= Pink
-16777216
= Black
-256
= Yellow
Additional Edit
So it looks like 16777216 is a perfect cube number. Its cube root is 256 (on RGB each primary color can be represented by a number from 0-255). So far that's the only relationship I can see think of. I still don't know how to convert that to HEX or RGB though.
I've done some research although not really fruitful. But I'll include it so I don't look like I didn't make an attempt - if you're not interested in it then just ignore it:
16777216 - I started by searching the actual code -16777216
but that didn't return anything so I removed the negative sign.
Facts about 16777216 - that page shows some formulas but I didn't see any that converts to HEX or RGB.