Chawter
10
I
BASIC Kevwords
PALETTE
USING/Graphics
Statement
PALETTE
USING
array(subscrippt)
Changes the colors associated with more than
1
of
the color
numbers in the current palette.
Array
is the name
of
an integer array in which you define the
order in which colors are to be put in the current palette.
Subscript
is the array position that contains the value
of
the
color that you want put in the first palette position. After BASIC
assigns that value
to
the first position, it assigns the remaining
array values to the remaining palette positions. Therefore, when
you create the array, have at least 16 elements following
sub-
script
so
that PALETTE USING has enough colors to fill the
palette.
The array can be larger than the palette. PALETTE USING
stops filling the current palette when it reaches the last position
in the palette.
To create the array, load a color number into each element.
Group color numbers that you use most often. For example, if you
use
2
shades
of
blue with
2
shades
of
green, place their color
numbers adjacent in the array, like this:
Subscript Color
0
2
(Green)
1
10 (Light Green)
2
1
(Blue)
3
9 (Light Blue)
In the statement:
PALETTE
USING
AC0)
Color 0 becomes green, Color
1
becomes light green, Color
2
be-
comes blue, and Color
3
becomes light blue.
If you assign a value
of
-1
to a position in the array, PALETTE
USING does not change the corresponding color from its previous
value.
255