|
Forum Index : Microcontroller and PC projects : Test Program for New Named Colors
| Author | Message | ||||
| William Leue Guru Joined: 03/07/2020 Location: United StatesPosts: 405 |
In firmware 5.07 we have 8 additional color names that can be used with the rgb() function, for a total of 16 colors. I was curious about the new colors: what they looked like and why those particular ones were chosen. After looking at the colors on all 4 color depths (8, 12, 16, and 32 bits), I realized that the new colors were cleverly chosen so as to look as similar as possible regardless of what bit depth is chosen! The 8 "primary" colors (red, yellow, green, cyan, blue, magenta, black, white) that can be created with every possible combination of 0 and 255 for each of the r,g,b components look identical on every bit depth. But the additional 8 colors cannot be made to look exactly the same on every bit depth, particularly on 8-bit color, due to the limited number of bits per color component. As anyone who tried to make a gray scale on 8-bit color has discovered, there are only 4 usable gray values: the others are a nasty greenish shade. This is because the blue component has only 2 bits, whereas red and green have 3. But the new 8 colors (brown, orange, pink, gold, salmon, beige, lightgray, and gray) look very similar on all bit depths. I wrote the attached little test program to look at all the named colors in all possible bit depths. If you have a Gen 2 system, this includes 32-bit color. -Bill ![]() NewColorsTest.zip |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |