Graphics Mode 3
The graphics mode 3 screen
is
a grid consisting
of
40 columns and
24
rows (20 if you use the text window). Enter and
run
the following
program:
NEW
1.0
GRtliPHICS
3
20
COLOR
1.
30
PLOT
0
..
0
RUN
In
the upper left corner is
an
orange block. The block, or pixel,
is
one
unit
in
the graphics screen. The COLOR command determines the
color of the pixel. The number after the COLOR command determines
which
color r
eg
ister to use for the color of the pixel. The COLOR com-
mand does not place a color
in
the register; SETCOLOR does that. The
COLOR command simply
se
lects which register to use to plot the
pi
xe
l, and the pixel becomes whatever color is
in
the register.
To
make
this clearer, change line
20
to
20
COLOR
2
Run
the program. The orange pixel is now light green. Think of each
pixel
as
a text character.
In
modes 1 and
2,
you used uppercase and
lowe rca
se
characters a
nd
In
verse Video to
se
lect the colors of the
text.
In
modes 3 a
nd
above, use the COLOR command to select the
color for the pixels.
PLOT: Plotting Points
on
the Grid
PLOT
is like the PRINT
#6;
command except that it prints pixels
in-
stead of letters and numbers. COLOR is like the upper/lower/inverse
color selection method; it selects the registe
r.
The default colors are
orange, light green, dark blue, a
nd
black. To change the color
in
any
of the registers, use the
SETCOLOR command.
Th
e color registers are like four buckets of paint. SETCOLOR selects
the color that goes into each of the four buckets, and COLOR selects
the bucket into which the paintbrush
wi
ll
be dipped. PLOT determines
where the bru
sh
will be positioned
on
the screen.
DRAWTO: Connecting the Dots
Add this
line:
40
DRtliWTO
3'J
..
0
73