GRAPHICALLY
SPEAKING....
Russ Walter
PIXELS
Most microcomputers (such as Radio Shack, Apple, and Atari) use a television screen instead of paper; and the screen is divided into thousands of little rectangles, called pixels. The pixel in the upper-left corner of the screen is called pixel 0,0; just to the right of it is pixel 1,0; then comes pixel 2,0; etc. Underneath pixel 0,0 is pixel 0, 1. Here are the positions of the pixels:
pixel 0,0 1,0 2,0 3,0 4,0 5,0, etc.
pixel 0,1 1,1 2,1 3,1 4,1 5,1, etc.
pixel 0,2 1,2 2,2 3,2 4,2 5,2, etc.
pixel 0,3 1,3 2,3 3,3 4,3 5,3, etc.
Each pixel's name consists of two numbers. The first number is called the X coordinate; the second number is called the Y coordinate.
For example, if you're talking about pixel 5,3, its X coordinate is 5, and its Y coordinate is 3. The X coordinate tells how far to the right the
pixel is; the Y coordinate tells how far down; so the pixel 5,3 is the pixel that's 5 to the right and three down.
So on the computer, the Y coordinate measures how far down. If you had the misfortune to read an old-fashioned math textbook (in which the Y coordinate measured how far up), you'll have to reverse your thinking!
How many pixels are on the screen? If you're using high resolution, the screen contains many pixels; each pixel is tiny. If you're using low resolution, the screen contains few pixels; each pixel is huge. You can choose either low resolution or high resolution. Here's how on the Atari ...
ATARI
TO produce colors, Atari's computer uses sixteen hues, which are numbered from 0 to 15 Hue 0 is gray; 1 is gold (orangish yellow); 4 is red; 8 is blue; 12 is green; and 15 is russet (reddish brown). The other numbers are hues that are in-between; for example, 2 is orange, 6 is purple, and 10 is turquoise.
The computer also uses eight luminances, which are numbered 0, 2, 4, 6, 8, 10, 12, and 14. Luminance 0 is "very dark"; 14 is "very light"; the other numbers are in-between. For example, since "pink" is the same as "light red", you can produce pink by choosing hue 4 ("red") and luminance 12 ("light"). Since "brown" is the same as "dark gold", you can produce brown by choosing hue 1 ("gold") and luminance 2 ("dark"). Since "black" is the same as "very dark gray", you can produce black by choosing hue 0 ("gray") and luminance 0 ("very dark").
You have five major paint buckets, numbered from 0 to 4. Usually, the buckets contain these paints...
Bucket 0 contains medium orange (hue 2, luminance 8).
Bucket 1 contains light green (hue 12, luminance 10).
Bucket 2 contains dark greenish-blue (hue 9, luminance 4).
Bucket 3 contains medium red (hue 4, luminance 6).
Bucket 4 contains black (hue 0, luminance 0).
But you can change what's in the buckets. For example, to change bucket 2 to pink (hue 4, luminance 12), put this command into your program:
50 SETCOLOR 2,4,12
It means: set the color of bucket 2 to hue 4 and luminance 12. If you give that command, everything you paint by using bucket 2 will be pink. Moreover, the command works retroactively: everything that you had already painted by using bucket 2 changes its color (from dark greenish-blue) to pink. For example, if you had painted a picture of a dark greenish-blue fish (by using bucket 2), and then you say SETCOLOR 2,4,12, the entire fish suddenly changes its color from dark greenish-blue to pink.
Besides those five major paint buckets, you also have an "auxiliary" paint bucket. It automatically contains the same luminance as bucket 1, and the same hue as bucket 2. For example, if bucket 1 contains light green (whose luminance is 10), and bucket 2 contains dark greenish-blue (whose hue is 9), then the auxiliary bucket contains the color whose luminance is 10 and whose hue is 9: that color is light greenish blue.
You can use 32 graphics modes, which are numbered from 0 to 3 1. Your program's top line must say which graphics mode to use. For example, if you wish to use graphics mode 19, your program's top line must say:
10 GRAPHICS 19
The next few lines should say SETCOLOR, if you wish to change the colors that are in the buckets.
Here's how to use the most popular graphics modes...
Mode 19. In this mode, the X coordinate must be from 0 to 39, and the Y coordinate must be from 0 to 23. Initially, the entire screen has been painted by bucket 4; but you can change the color of each pixel, by using four paintbrushes:
Brush 0 has been dipped in bucket 4.
Brush 1 has been dipped in bucket 0.
Brush 2 has been dipped in bucket 1.
Brush 3 has been dipped in bucket 2.
Example:
Use graphics mode 19 - 10 GRAPHICS 19
Using brush 2, paint pixel 27,13 and pixel 25, 19 -20 COLOR 2: PLOT 27,13: PLOT 25,19
Using brush 1, draw a line from 20,17 to 13,15 30 COLOR 1: PLOT 20,17: DRAWTO 13,15