ConsoleColor()

Syntax

ConsoleColor(CharacterColor, BackgroundColor)
Description
Change the colors used by the text display. Any characters printed after calling this command will use the new colors. The color values range from 0 to 15, which are the 16 colors available in console mode.

Parameters:
CharacterColor - The foreground color to use. This is the color that the characters are drawn with.
BackgroundColor - The background color to use. This is the color that surrounds each character.

Both colors can have a value from 0 to 15 to represent the color. The colors which each of those values represent are:
0 - Black (default background)
1 - Blue
2 - Green
3 - Cyan
4 - Red
5 - Magenta
6 - Brown
7 - Light grey (default foreground)
8 - Dark grey
9 - Bright blue
10 - Bright green
11 - Bright cyan
12 - Bright red
13 - Bright magenta
14 - Yellow
15 - White

Return value:
This command does not return a value.


Example:
If OpenConsole()
    For foreground=0 To 15
        For background=0 To 15
            ConsoleColor(foreground, background)
            Print(Right(Hex(background), 1))
        Next
        
        PrintN("")
    Next
    
    ConsoleColor(7, 0)
    PrintN("Press return to exit")
    Input()
    CloseConsole()
EndIf
End

Supported OS

Windows

<- CloseConsole() - Console Index - ConsoleCursor() ->