13.07.2015 Views

Turbo Basic

Turbo Basic

Turbo Basic

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

COLOR statement (graphics mode)FunctionSyntaxRemarksCOLOR sets the colors for graphics operations.For SCREEN 1: COLOR [background] [, [pa 7ette]]For SCREENs 7, 8, 9, lO: COLOR [foreground] [, [background]]background is an integer expression from 0 to 63 specifying backgroundcolor. palette is an integer expression from 0 to 1, selectingone of two color palettes. foreground is an integer expression from1-15.Arguments to this command determine the screen's backgroundcolor and the palette of four colors that will be used in subsequentdrawing statements. After you've determined the palette and backgroundcolor with a COLOR statement, the color of individualobjects is controlled by arguments to the various plotting commands(CIRCLE, LINE, and so on).In high resolution mode on a Color/Graphics Adapter, black andwhite are the only possible colors. Consequently, the COLOR statementhas no meaning in this mode, and trying to use it results inrun-time error 5, Illegal Function Call.SCREEN 1Background 0-255: The actual background color used is backgroundMOD 16. Thus a background of 1 and 16 produces the same result.Palette 0-255: Select a predefined palette, as shown in the following:Color123Palette 0GreenRedBrownPalette 1CyanMagentaWhiteEven numbers select Palette 0, and odd numbers select Palette 1,the default. Palette 0 gives your program the ability to createobjects in green, red, and brown. Palette 1 offers the colors cyan(greenish blue), magenta (reddish purple), and white.<strong>Turbo</strong> <strong>Basic</strong> Reference Directory 157

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!