qbasic.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
PALETTE, PALETTE USING Statements
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Change the color assignments of color attributes in the current screen mode.
PALETTE and PALETTE USING work only on systems equipped with EGA, VGA, or
MCGA adapters.
 
PALETTE [attribute%,color&]
PALETTE USING arrayname#[(index%)]
 
    ■ attribute%    The color attribute to change.
    ■ color&        A color value to assign to an attribute.
    ■ arrayname#    An array of color values to assign to the current screen
                    mode's set of attributes. The array must be large enough
                    to assign colors to all the attributes.
    ■ index%        The index of the first array element to assign to an
                    attribute.
 
    ■ The available color attributes and values depend on your graphics
      adapter and the screen mode set by the most recent SCREEN statement.
 
Example:
    'This example requires a color graphics adapter.
    PALETTE 0, 1
    SCREEN 1
    FOR i% = 0 TO 3: a%(i%) = i%: NEXT i%
    LINE (138, 35)-(288, 165), 3, BF
    LINE (20, 10)-(160, 100), 2, BF
    DO
        FOR i% = 0 TO 3
            a%(i%) = (a%(i%) + 1) MOD 16
        NEXT i%
        PALETTE USING a%(0)
    LOOP WHILE INKEY$ = ""
 
See Also    COLOR    SCREEN
            Color Attributes and Values    Screen Modes