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.
COLOR Statement
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Changes the default color of text output to the screen; not available when
forms are showing. Use the BackColor and ForeColor properties with forms and
controls. See: ◄BackColor Property► ◄ForeColor Property►
Use the COLOR syntax that matches the screen mode for which you are
programming.
Syntax 1: Screen Mode 0 (Text Only)
COLOR [foreground&] [,[background&] [,border&]]
Syntax 2: Screen Mode 1
COLOR [background&] [,palette%]
Syntax 3: Screen Modes 4, 12, 13
COLOR [foreground&]
Syntax 4: Screen Modes 7, 8, 9, 10
COLOR [foreground&] [,background&]
■ foreground& Number that sets the foreground screen color; in screen
mode 0, a color attribute that sets text color; in other
screen modes, a color attribute or 4-bit color value
(screen mode 4 only) that sets the text and line-drawing
color
■ background& Number that sets the background screen color; in screen
mode 0, a color attribute; in screen mode 1, a 4-bit
color value; in screen modes 7-10, a color value
■ border& Color attribute that sets the screen border color
■ palette% Number (0 or 1) specifying which of two sets of color
attributes to use:
Palette% Attribute 1 Attribute 2 Attribute 3
════════ ═══════════ ═══════════ ═════════════
0 Green Red Brown
1 Cyan Magenta Bright white
See Also
◄Color Attributes and Values (SCREEN)► ◄Graphics Command Summary►
◄Screen Mode Summary►