Apple ][ Colors

综合技术 Lobsters (源链)

Apple II Colors

This is a message I posted while I was doing my work onxapple2. It shows how I worked out the exact RGB values for the Apple ][ colors. The RGB color values are something that emulator developers had hitherto been trying to guess by visual inspection.

From: munafo(at)gcctech(dot)com Newsgroups: comp.emulators.apple2,comp.sys.apple2.programmer Subject: RGB values for the standard Apple ][ colors Date: Thu, 12 Oct 2000 03:13:33 GMT

I am giving a table of all the lores and hires colors with their values in RGB. First, though there is a bit to explain…

The Apple ][ hardware generates a NTSC composite (luma plus chroma) signal complete with a color burst on the “back porch” of each scanline. The dots for all display modes (text, lores and hires) come from a master 14.31818-MHz clock, which is divided by 4 to produce the color burst. Dots for 40-col text and hires graphics come out at 7.15909 MHz. Dots for 80-col text, lores graphics, and double hires graphics come out at 14.31818 MHz. Although NTSC defines the scanline as 227.5 cycles per scanline (so the phase alternates on alternate scanlines, producing a dithering effect), the Apple rounds it up to 228. (This is why solid bright colors on a monochrome monitor appear as vertical stripes rather than the “tiny checkerboard” pattern you see when watching a TV program on the same monochrome monitor.)

To understand the NTSC standard fully, there are four coordinate systems you have to deal with:

  • chroma phase, chroma amplitude and luma
  • YIQ
  • Y B-Y R-Y
  • RGB

The “color burst” signal I just described, plus the positions of some of the coordinate axes of the other systems, are all defined by relative phase angles with respect to each other. I’ll skip all the details, but you are invited to read any of the URLs I’m listing at the end if you want to know more (some are dead but cached on Google).

The important things to know for our purposes are:

1. On the Apple ][, all pixels and the color burst are in phase with the master clock. However, they come out as square waves, and the effect of the TV’s circuitry (or a composite monitor) is to turn the square wave into the closest matching sine wave.

2. Because all the pixels generated are in phase with the color burst signal, the phase of the sine wave is always 0, 45, 90, 135, 180, 225, 270, or 315. The color burst itself is phase 180. For example, “green” HCOLOR=1 and “light green” COLOR=12 are 50% duty cycle square waves centered at phase 225.

3. The 4 hires colors are all 50% square waves, which gives a chroma amplitude higher than anything in a real TV broadcast. This is why they look so garish. Contrary to what was recently said in the article “Jon Relay’s Apple II Info Archives” in the Aug 2000 GS WorldView, these four colors are not the same as the NTSC “+I, +Q, -I and -Q” colors. They are actually 12 degrees lower in phase — probably not enough to notice, since your tint control is probably a bit off anyway (-:

4. The lores colors are derived a similar way, although two of them (the two grays) are square waves of twice the chroma frequency, and these are “averaged out” to a flat 50% gray by the TV. All of the lores colors are binary combinations of the four PRIMARY lores colors, which are the four that appear “dark gray” on a monochrome monitor:

duty cycle phase Red COLOR=1 45 to 135 90 Dark-blue COLOR=2 315 to 45 0 Dark-green COLOR=4 225 to 315 270 Brown COLOR=8 135 to 225 180

If we combine COLOR 4 and COLOR 8, we get COLOR 12: 4 plus 8 = 12. This color is “on” from 135 to 315, which makes a 50% square wave centered on 225. Thus, it appears the same as the HCOLOR=1 described above.

Here is the table. It was used by taking the chroma/luma values and transforming to R-Y and B-Y, then transforming to YUV and finally to RGB. The last step requires a gamma correction for display on an RGB monitor, I used Y to the power of -0.4. For reference, the NTSC “color bars” test pattern colors and the YIQ axis colors are also given.

–chroma– Color name phase ampl luma -R- -G- -B- black COLOR=0 0 0 0 0 0 0 gray COLOR=5 0 0 50 156 156 156 grey COLOR=10 0 0 50 156 156 156 white COLOR=15 0 0 100 255 255 255 dk blue COLOR=2 0 60 25 96 78 189 lt blue COLOR=7 0 60 75 208 195 255 purple COLOR=3 45 100 50 255 68 253 purple HCOLOR=2 45 100 50 255 68 253 red COLOR=1 90 60 25 227 30 96 pink COLOR=11 90 60 75 255 160 208 orange COLOR=9 135 100 50 255 106 60 orange HCOLOR=5 135 100 50 255 106 60 brown COLOR=8 180 60 25 96 114 3 yellow COLOR=13 180 60 75 208 221 141 lt green COLOR=12 225 100 50 20 245 60 green HCOLOR=1 225 100 50 20 245 60 dk green COLOR=4 270 60 25 0 163 96 aqua COLOR=14 270 60 75 114 255 208 med blue COLOR=6 315 100 50 20 207 253 blue HCOLOR=6 315 100 50 20 207 253 NTSC Hsync 0 0 -40 0 0 0 NTSC black 0 0 7.5 41 41 41 NTSC Gray75 0 0 77 212 212 212 YIQ +Q 33 100 50 255 81 255 NTSC magenta 61 82 36 255 40 181 NTSC red 104 88 28 255 28 76 YIQ +I 123 100 50 255 89 82 NTSC yellow 167 62 69 221 198 121 Color burst 180 40 0 0 4 0 YIQ -Q 213 100 50 51 232 41 NTSC green 241 82 48 12 234 97 NTSC cyan 284 88 56 10 245 198 YIQ -I 303 100 50 0 224 231 NTSC blue 347 62 15 38 65 155

Apple ][ viewed on a TV

source: iBookGuy

In the above image, the Apple ][ was running this Integer BASIC program: 10 GR 20 FOR C = 0 TO 14 30 COLOR= C + 1 40 FOR Y = C * 2 TO C * 2 + 10 50 FOR X = C * 2 TO C * 2 + 10 60 PLOT X,Y 70 NEXT X 80 NEXT Y 90 NEXT C

Top: surface of RGB colour cube

Bottom: closest available Apple ][ colors

source: Wikipedia

II GS

As seen in this II GS TechNote , the Apple II GS defines RGB values for the 16 colors that are different from the ones I’ve listed above:

..Original Apple ][ values… ……….IIGS values………. -R- -G- -B- 12-bit -R- -G- -B- black COLOR=0 0 0 0 Black $0000 0 0 0 red COLOR=1 227 30 96 Deep Red $0D03 221 0 51 dk blue COLOR=2 96 78 189 Dark Blue $0009 0 0 153 purple COLOR=3 255 68 253 Purple $0D2D 221 34 221 dk green COLOR=4 0 163 96 Dark Green $0072 0 119 34 gray COLOR=5 156 156 156 Dark Gray $0555 85 85 85 med blue COLOR=6 20 207 253 Medium Blue $022F 34 34 255 lt blue COLOR=7 208 195 255 Light Blue $06AF 102 170 255 brown COLOR=8 96 114 3 Brown $0850 136 85 0 orange COLOR=9 255 106 60 Orange $0F60 255 102 0 grey COLOR=10 156 156 156 Light Gray $0AAA 170 170 170 pink COLOR=11 255 160 208 Pink $0F98 255 153 136 lt green COLOR=12 20 245 60 Light Green $01D0 17 221 0 yellow COLOR=13 208 221 141 Yellow $0FF0 255 255 0 aqua COLOR=14 114 255 208 Aquamarine $04F9 68 255 153 white COLOR=15 255 255 255 White $0FFF 255 255 255

The color graphics in the II GS Apple ][ emulation modes come from a lookup table within the Mega II chip. Apple engineers were able to select any RGB values they wanted (from the same 4,096 color palette as used in the new Super-highres modes, i.e. RGB with 4 bits per component). I suspect they chose values that were more useful (turning the two gray values into Dark Gray and Light Gray), and/or more aesthetically appealing.

See also

Kelin J. Kuhn, Conventional Analog Television – An Introduction

http://www.landfield.com/faqs/apple2/faq/part16/

http://www.grin.net/~cturley/gsezine/GS.WorldView/v2000/Aug/Articles/A2.InfoArchives.Aug.2000.txt

http://www-viz.tamu.edu/faculty/parke/ends489f00/notes/sec1_4.html

http://www.neutralzone.org/home/faqsys/docs/codet

http://www.belle-nuit.com/archives/videoglossary.html

http://www.itc-usa.com/noframe/radapclr.htm

— Robert Munafo

Apple ][ programmer since 1980!

您可能感兴趣的

UILabel的首行缩进及使用场景 常见的就是当我们需要给标题加上标签的时候,例如: '商品名称' 这样显示的时候,而标题太长需要换行的时候,如下: Simulator Screen Shot - iPhone 6s - 2018-01-25 at 14.40.00.png 这种效...
iOS持久化之Archiver+UserDefaults 本文为CocoaChina网友 desty 投稿 概述: UserDefaults:Key-Value持久化的方案,适合用来保存配置数据,简单的用户信息,或者一些状态数据(大批量数据还是要考虑使用DB) Arch...
iOS调起QQ客户端,与公众号临时会话,定时器后台暂停的问题(小功能二连发(二))... ###开篇 现在开始第二篇,哈哈。上一篇文章主要讲了: iOS生成带logo的二维码,区域截屏保存至相册 ,这一篇就来说说其他的比较常见的小功能吧例如:调起QQ临时回话,调用系统的打电话等功能,都是在售后,商城等模块中常用的功能,总结下方便以后直接拿来使用。 ####主要内容 iOS...
网易云信IM自定义消息实现 IM流程(网易云信SDK)1.正常账号登录流程登录成功,获取IMToken 2.然后调用IM登录接口进行登录 3.具体配置(自定义消息的配置) IM实现 在.pch或者.h中引入 #import "NIMKit.h" 在appdelete的didFin...
ios WKWebView 与 JS 交互实战技巧 最近公司需要针对 向日葵远程控制 和 花生壳动态域名解析服务客户端 做与HTML5交互的App,优点就是开发周期短,可随时更新内容。所以在这整理了一些 App 与 Web 交互的方法。 一、WKWebView 由于Xcode8发布之后,编译器开始不支持iOS 7了,这样我们...
Lobsters责编内容来自:Lobsters (源链) | 更多关于

阅读提示:酷辣虫无法对本内容的真实性提供任何保证,请自行验证并承担相关的风险与后果!
本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » Apple ][ Colors



专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录