[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Definitive apple ][ lo res (and hi res) mode colors (RGB values).
Hello,
Inspired by this thread I did the math to find out what the NTSC Apple
II/II+/IIe/IIc colors actually are. (The IIgs produces noticeably
different colors because of its RGB operation). Unfortunately, most
emulators don't get the colors right. Maybe somebody feels like patching
the correct color values as given here into some emulator(s)?
The PAL Apples produce almost identical colors to their NTSC cousins,
but unfortunately unlike for NTSC there's no pretty mathematical way to
calculate their theoretical values, since the PAL Apples use some
not-so-well-defined analog circuitry to add together luminance and
chrominance signals, while the NTSC Apples produce both luma and chroma
in a single digital process.
I'm assuming that the A2 logic circuits produce a perfectly rectangular
output on the video out, alternating between 0 (black) and 1 (white),
not counting the sync (which is added afterwards). This is pretty close
to what they actually do. The only possible error is a very slight one
in color saturation, hue and brightness should not be affected by this
assumption.
I'm also assuming that the NTSC decoder at the receiving end is
completely to (modern) spec. The original "NTSC 1953" norm called for
YIQ decoding and had different color primaries than modern sets, but
almost all TV sets actually produced use YUV decoding and the modern
primaries, which were then made the standard in "SMPTE 1979", the modern
NTSC norm. I follow the 1979 norm since the old norm is mostly of
theoretical value only, and when the Apple was released in 1977 the
modern norm was de facto already in place.
Then it is easy to mathematically derive the correct color values. All
it takes is a fourier transform of the waveform. The zeroeth coefficient
(which is 0.0 for black, 0.25 for the 4 "dark" colors, 0.5 for grey
and the four "mid" colors (which are also the hires colors), 0.75 for
the four "bright" colors, and 1.0 for white) of said transform gives the
luminance, the first coefficient (0 for black, grey, white, 1/(2*pi) for
the "mid" colors, and 1/(2*sqrt(2)*pi) for the "dark" and "bright"
colors) gives the color saturation. Phase angels (hues) are multiples of
90� for the 4 "dark" and the 4 "bright" colors, and multiples of 90�
plus 45� for the 4 "mid" colors.
The lores colors 4, 7, 8 and 11 are affected by clipping, i.e. when
these colors are used the Apple is telling the TV to produce a color it
can't actually produce since it's somewhat outside the gamut - none of
the three electron guns in the picture tube can be turned down below
zero power, or above maximum power. This clipping is taken into
consideration in the tables.
The resulting RGB values (in hex) in the SMPTE color space for the 16
lores colors are as follows:
NTSC Apple II Colors RGB Values in SMPTE 1979 color space
---------------------------------------------------------
R, G, B [ 0] = 0x000000 * Hires 0 & 3
R, G, B [ 1] = 0x901740
R, G, B [ 2] = 0x402ca5
R, G, B [ 3] = 0xd043e5 * Hires 2
R, G, B [ 4] = 0x006940
R, G, B [ 5] = 0x808080
R, G, B [ 6] = 0x2f95e5 * Hires 6
R, G, B [ 7] = 0xbfabff
R, G, B [ 8] = 0x405400
R, G, B [ 9] = 0xd06a1a * Hires 5
R, G, B [10] = 0x808080
R, G, B [11] = 0xff96bf
R, G, B [12] = 0x2fbc1a * Hires 1
R, G, B [13] = 0xbfd35a
R, G, B [14] = 0x6fe8bf
R, G, B [15] = 0xffffff * Hires 4 & 7
The numbers in square brackets are the lores color numbers (COLOR= in
Applesoft). The hires colors (HCOLOR= in Applesoft) are marked with an
asterisk.
Note that these RGB values are valid only for the SMPTE 1979 color
space. Converting them to sRGB color space (which is what modern PC
monitors *should* use when set to 6500K color temperature, most are at
least close; this is also the color standard for HDTV sets and for Web
pages) and linearily scaling their brightness so that the maximum
coefficient is 0xff, gives these slightly different values:
NTSC Apple II Colors RGB Values in sRGB color space
---------------------------------------------------
R, G, B [ 0] = 0x000000 * Hires 0, 3
R, G, B [ 1] = 0x8a2140
R, G, B [ 2] = 0x3c22a5
R, G, B [ 3] = 0xc847e4 * Hires 2
R, G, B [ 4] = 0x07653e
R, G, B [ 5] = 0x7b7e80
R, G, B [ 6] = 0x308fe3 * Hires 6
R, G, B [ 7] = 0xb9a9fd
R, G, B [ 8] = 0x3b5107
R, G, B [ 9] = 0xc77028 * Hires 5
R, G, B [10] = 0x7b7e80
R, G, B [11] = 0xf39ac2
R, G, B [12] = 0x2fb81f * Hires 1
R, G, B [13] = 0xb9d060
R, G, B [14] = 0x6ee1c0
R, G, B [15] = 0xf5faff * Hires 4 & 7
Hope this helps,
--
Linards Ticmanis