pub type Color = u8;
Expand description
A number corresponding to a color.
Each color the Ppu
can output corresponds to a 6-bit Color
value.
The low 4 bits specify the hue, and the high 2 bits specify the brightness.
Color values are only valid in the range 0x00-0x3F
. Any value outside that range will
be truncated to fit when writing to Ppu
color palette memory.
Warning: using color value 13
/0x0d
on actual Nintendo hardware generates
invalid NTSC signals that can cause televisions to display the frame incorrectly.
Avoid using color value 13
, though it is still allowed for authenticity.
Here is an example palette demonstrating what color each number should correspond to (numbers given in hex):
Note that different TVs display NES output differently, so this palette is not exact. This image is just a rough example.