Classic Computer Magazine Archive ANTIC VOL. 1, NO. 3 / AUGUST 1982

Pilot Your Atari
Colors For Your Pilot

by Ken Harms

This month I will show you how to use all 128 colors of the ATARI and how you can rapidly change these colors in your displays.

To display data on the TV screen j PILOT first gets data (character or graphics information) from your program and then looks at special memory locations to determine the color to use. You can use a maximum of four colors at one time on your screen. Each color is selected by the PEN; (color) instruction. This instruction calls these locations by the names "Red", "Blue", "Yellow'i, and "Erase" Once PILOT knows what name (location) a line belongs to, it uses the color value found there for all lines drawn by that PEN: (color) instruction.

When PILOT looks at the "Blue" location it will find a color value there. This value will cause the ATARI to draw blue lines when you first turn it on. Fortunately, you can put any color value into these locations. So, even though PILOT calls these locations by color names (for convenience) any color may be found there. You can change these colors using a special form of the C:ompute command. Turn your machine on and type this in direct mode:

C:@B710 = 86
C:@B712 = 5*16+6

The first instruction might be spoken "Compute byte 710 equals 86" In this case, the 710 is the special address PILOT calls its "Blue" location. The 86 is a color value for a red color. In effect we put "red paint into a can labeled blue"

In the second instruction, the "712" is PlLOT's "Erase" register. The "5" is a hue (color) number and the "6" is a luminance number (more on them later).

In the graphic mode, PILOT uses four locations or registers. Their names, addresses and -uses are listed in Table 1.

TABLE I Name Register Value Used for Red 0 70 Graphics Yellow 1 26 Graphics Blue 2 None 3 Erase 4 Address 708 709 > 148 Text Window & Graphics 710 148 Not Used 711 0 Background & Border 712 You change the color of any register (paint can) by placing a different color value in any of the addresses. Color values are made up of two numbers, a "hue number" and a "luminence" or brightness number. Table 2 gives these values and what they usually look line on my TV.

O = gray
1 = green brown
2 = yellow/orange
3 = orange
4 = red/orange
S = pink
6 = bluish purple
7 = purple
8 = blue
9 = bright blue
10 = turquoise
11 = greenish blue
12 = green
13 = yellowish green
14 = orangish green
15 = light orange

0-lowest possible luminance (black)
14-maximum luminance (white)<.p> The color value needed in each register is calculated as follows:

Hue number# 16 + luminance number.

A color value for the red we used above is 86 or "165 + 6." Changing a register can be done at any time in your program.

The listing draws two horses in different color registers and then changes the colors rapidly to illustrate the power of this technique.

Let me leave you with an experiment: Use Mode 1 or Mode 2 letters (see last issue) and determine which color registers are used for uppercase and lowercase letters.

You may be interested in a new learning club for PILOT / LOGO users. It has a good newsletter, simple programs and an educational orientation. It is free to people under 18. Write to:

Young People's LOGO Association
1208 Hillsdale Drive
Richardson, Texas 75081
See page 38 for listing.