BG / FG Color

What is the color scheme for coding in C++? Like if I want a black background with green text, like those of the monochrome era. How would I come about doing that?
closed account (42TXGNh0)
https://stackoverflow.com/questions/9965710/how-to-change-text-and-background-color#answer-9965832

If you are asking for how to change the color: from the above link
There is no (standard) cross-platform way to do this. On windows, try using conio.h. It has the:

textcolor(); // and
textbackground();


If you would like to have a table of the code of colors: try typing color /? in Command Prompt.

Sets the default console foreground and background colors.

COLOR [attr]

  attr        Specifies color attribute of console output

Color attributes are specified by TWO hex digits -- the first
corresponds to the background; the second the foreground.  Each digit
can be any of the following values:

    0 = Black       8 = Gray
    1 = Blue        9 = Light Blue
    2 = Green       A = Light Green
    3 = Aqua        B = Light Aqua
    4 = Red         C = Light Red
    5 = Purple      D = Light Purple
    6 = Yellow      E = Light Yellow
    7 = White       F = Bright White

If no argument is given, this command restores the color to what it was
when CMD.EXE started.  This value either comes from the current console
window, the /T command line switch or from the DefaultColor registry
value.

The COLOR command sets ERRORLEVEL to 1 if an attempt is made to execute
the COLOR command with a foreground and background color that are the
same.

Example: "COLOR fc" produces light red on bright white

The color codes are in hexadecimal form. i.e.: A = 10 ; B = 11 ...
Topic archived. No new replies allowed.