Currently the colors of the MC6847 "Video Display Generator" chip used in CoCo and other machines are defined like this:
Code:
static const UINT32 default_palette[] =
{
    M6847_RGB(0x00, 0xff, 0x00),    /* GREEN */
    M6847_RGB(0xff, 0xff, 0x00),    /* YELLOW */
    M6847_RGB(0x00, 0x00, 0xff),    /* BLUE */
    M6847_RGB(0xff, 0x00, 0x00),    /* RED */
    M6847_RGB(0xff, 0xff, 0xff),    /* BUFF */
    M6847_RGB(0x00, 0xff, 0xff),    /* CYAN */
    M6847_RGB(0xff, 0x00, 0xff),    /* MAGENTA */
    M6847_RGB(0xff, 0x80, 0x00),    /* ORANGE */

    M6847_RGB(0x00, 0x00, 0x00),    /* BLACK */
    M6847_RGB(0x00, 0xff, 0x00),    /* GREEN */
    M6847_RGB(0x00, 0x00, 0x00),    /* BLACK */
    M6847_RGB(0xff, 0xff, 0xff),    /* BUFF */

    M6847_RGB(0x00, 0x40, 0x00),    /* ALPHANUMERIC DARK GREEN */
    M6847_RGB(0x00, 0xff, 0x00),    /* ALPHANUMERIC BRIGHT GREEN */
    M6847_RGB(0x40, 0x10, 0x00),    /* ALPHANUMERIC DARK ORANGE */
    M6847_RGB(0xff, 0xc4, 0x18)     /* ALPHANUMERIC BRIGHT ORANGE */
};

There are plenty of "pure" colors there. But are these the colors effectively generated by MC6847?

The MC6847 datasheet says that the colors are formed by the combination of three signals: Y, phiA and phiB, according to the Y'UV colorspace.

According to the table "DC (STATIC) CHARACTERISTICS" in the datasheet, when producing color, Y may assume one of these voltages: "Black" = 0.72V; "White Low" = 0.65V; "White Medium" = 0.54V; "White High" = 0.42V. phiA and phiB may be: "Output Low" = 1.0V; "R(eference?)" = 1.5V; "Input High" = 2.0V.

"FIGURE 10 - VIDEO AND CHROMINANCE OUTPUT WAVEFORM RELATIONSHIPS" shows the combinations of voltages used to produce each color.

Mapping the values of Y to a 0~255 range, we get "Black" = 0; "White Low" = 59; "White Medium" = 153; and "White High" = 255. phiA and phiB can be mapped to -128, 0, +128.

These values can then be converted to RGB according to the formulae (found in Wikipedia):
  • R = Y' + 1,13983 × U
  • G = Y' - 0,39465 × U - 0,58060 × V
  • B = Y' + 2,03211 × V

So we get:
  • GREEN = Y'UV(153,-128,-128) = RGB(7,277,-107) --> #07ff00
  • YELLOW = Y'UV(255,-128,0) = RGB(255,305,-5) --> #ffff00
  • BLUE = Y'UV(59,+128,0) = RGB(59,8,319) --> #3b08ff
  • RED: Y'UV(59,0,+128) = RGB(204,-15,59) --> #cc003b
  • WHITE: Y'UV(255,0,0) = RGB(255,255,255) --> #ffffff
  • CYAN: Y'UV(153,0,-128) = RGB(7,227,153) --> #07e399
  • MAGENTA: Y'UV(153,+128,+128) = RGB(298,28,413) --> #ff1cff
  • ORANGE: Y'UV(153,-128,+128) = RGB(298,129,-107) --> #ff8100
  • BLACK: Y'UV(0,0,0) = RGB(0,0,0) --> #000000
  • DARK GREEN: Y'UV(0,-128,-128) = RGB(-145,124,-260) --> #007c00
  • DARK ORANGE/RED: Y'UV(0,-128,+128) = RGB(145,-23,-260) --> #910000

Since these values are based on what MC6847 actually does, I suppose they are more accurate than the "pure" green (#00ff00), red (#ff0000), etc. that are currently being used.

Last edited by Ensjo; 10/13/10 05:24 AM.