I was given a .jar file which generates a matrix of integer color codes from an image.
I can tell that the black color value is -16777216, and white is -1. However, I have never seen such values used for color codes before.
I can’t see the code within the .jar file.
Could have asked this somewhere like Graphic Design SE, but I guess it is more possible that a coder here has worked with similar problems before.
The reason I want to find a reference “table/whatever” is because I would like to be able to get the color name based on such values.
EDIT: Here are some colors I got:
- Black is -16777216
- Red is -65536
- Green is -16711936
- Blue is -16776961
- White is -1
Color values are more easily understood when given in hexadecimal format, specified with “0x” followed by 0-9 or A-F. Here, black is 0xFF000000, and white is 0xFFFFFFFF. The format is 0xAARRGGBB, where “AA” is two hexadecimal digits for the “alpha” component (00 is completely transparent, FF is completely opaque), “RR”, “GG”, and “BB” are the red/green/blue components, respectively.
0xFF000000 happens to be -16777216, and 0xFFFFFFFF is -1.
Edit: Fixed -16777216 value.