many colours in your artist's palette as are needed. Your programs always begin using a list of default colour values, and these values may be changed as in the next example.
Remember that only the colours specifically set with this command will be affected, and any others will retain their original values.
E> Palette $FFF : Rem set colour 0 to white Palette ,,,,$F00,$D00,$A00,$700,$400 : Rem colours 4 to 8 graded reds Palette $000,,$000: Rem colours 0 and 2 both black
PALETTE can also be used to set the colours used by the Half-Bright and HAM modes, and some superb ready-made examples are available, care of Chapter 6.1. For a little light relief, try his routine, which changes the first five colours in the palette with a hexadecimal poem, and displays the result on screen. Feel free to change the values or the poetry.
E> Palette $BAD,$0DD,$B0D,$FAB,$F1B Curs Off : Flash Off For C=0 To 4: Ink C Print Hex$(Colour(C,3) Bar 50,8*C To 150,8*C+8 Next C
Filled shapes
You should now be familiar with drawing basic shapes and setting choices of colour. The next
stage explains how to combine these skills. Re-set your colours now, by getting rid of any
customised PALETTE commands, before continuing.
PAINT
instruction: fill a screen area with colour
Paint x,y
Paint x,y,mode
The PAINT command allows you to fill any section of your screen with a solid block of colour. You may also fill areas with various patterns previously selected with the SET PATTERN command, which is explained later. Decide which area is to be filled, and follow the PAINT command by a set of coordinates located anywhere inside the section of screen you want to paint with the current ink colour. Try this, which if all goes well should result in the Japanese national flag:
E> Palette 0,$F00 Circle 160,100,50 Paint 50,50
The optional mode setting can be set to either zero or one. A value of 0 ends your PAINT operation at the first pixel encountered of the current border colour. A mode of 1 stops the painting operation at any colour which is different from the existing ink colour. If there are any gaps in the boundaries of the sections you wish to fill, colour will leak out and stain the adjoining area.