Replies: 2 comments
-
After some further experimenting, it looks like youjust need to perform a left bitshift of two places to convert each byte of standard color code into the {0x00,0x00,0x00} format. |
Beta Was this translation helpful? Give feedback.
-
#FFFFFF is (0xFF, 0xFF, 0xFF) 8bits/color =24bits You should see the palette value for white in the code tree as below.
Edit: Bit shift is a simplified way, and actually should be 0xFF x (0x3F / 0xFF) to convert from 0~255 to 0~63. |
Beta Was this translation helpful? Give feedback.
-
I am attempting to add my own palettes to the current ones (Green, Amber, Gray, White) and while I was able to add one, the colors used were not what I expected. It appears I am using an incorrect conversion to get values in the mono_cga_palettes array (which are then used by VGA_DAC_SetEntry).
Can anyone share the formula to convert standard RGB color codes (e.g. #FFFFFF for black, #FFFF00 for yellow) into the {0x00,0x00,0x00} format used in mono_cga_palettes and VGA_DAC_SetEntry?
I tried an 8bit to 6bit conversion and the results did not look at all like the colors I expected.
Beta Was this translation helpful? Give feedback.
All reactions