0% found this document useful (0 votes)
24 views2 pages

windows_console_color_codes

The document provides a list of text and background color codes for the Windows Console, ranging from 0 (Black) to 15 (Bright White). It explains how to use these colors in programming by calling the SetConsoleTextAttribute function with the respective color codes. Additionally, it describes how to set background colors by adding 16 to the text color code.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views2 pages

windows_console_color_codes

The document provides a list of text and background color codes for the Windows Console, ranging from 0 (Black) to 15 (Bright White). It explains how to use these colors in programming by calling the SetConsoleTextAttribute function with the respective color codes. Additionally, it describes how to set background colors by adding 16 to the text color code.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Windows Console Color Codes

Text and Background Color Codes for Windows Console

Code Text Color Background Color

0 Black Black

1 Blue Blue

2 Green Green

3 Aqua Aqua

4 Red Red

5 Purple Purple

6 Yellow Yellow

7 White White

8 Gray Gray

9 Bright Blue Bright Blue

10 Bright Green Bright Green

11 Bright Aqua Bright Aqua

12 Bright Red Bright Red

13 Bright Purple Bright Purple

14 Bright Yellow Bright Yellow

15 Bright White Bright White

To use these colors in your program, call SetConsoleTextAttribute with the respective color codes.

For example, SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10) will set green text color

on a black background.
You can set the background color by adding 16 to the color code.

For instance, code 10 will set green text, while code 10 + (16 * 0) will set green text on a black background.

You might also like