How do you save a color in a binary file?
Do you assing special values to R, G and B, or you can actually save a hexadecimal color value as string and then use it, if so, then how do you convert it back?
Colors are broken down into the Red, Green, and Blue components. In 24 bit color, each byte represents the intensity of that color. The first byte represents the red intensity (0-255), the second is for green, and the third is blue.
In 16 bit color, two bytes are used, with 5 bits use for each color, which give you 32 intensity levels (0-31) for each color.
How you choose to store this information is really entirely up to you, provide that your input and output routines perform the necessary conversions, if any.
Good Luck
-------------- As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
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.