Is there a way to change the black background of the cmd window that open when
running the function to another color?
Is there a way to change the black background of the cmd window that open when
running the function to another color?
On Windows this can be done with an easy system call.
system("color <hexval><hexval>");
For example:
system("color 0a");
will change the background colour to black, and the foreground colour to green.
By opening a command prompt in Windows, you can type "color", and it will output all the possible variations. Then just try them out and implement it in your code.
Right click on top bar of cmd then click properties then go to Colors tab and select your color then ok.
#Edited
use system(color 17);
it will give you white font on blue background. here 1
for blue and 7
for white. remember first code for background color and second code for font color.
here is some color codes.
A = Light Green
B = Light Aqua
C = Light Red
D = Light Purple
E = Light Yellow
F = Bright White
0 = Black
1 = Blue
2 = Green
3 = Aqua
4 = Red
5 = Purple
6 = Yellow
7 = White
8 = Gray
9 = Light Blue
you can use
color
command in cmd.
color
command takes one argument in which first character corresponds to background and second character corresponds to foreground. Provide the character in HEX format.
0=BLACK 1=BLUE
2=GREEN 3=AQUA
4=RED 5=PURPLE
6=YELLOW 7=WHITE
8=GRAY 9=LIGHT BLUE
A=LIGHT GREEN B=LIGHT AQUA
C=LIGHT RED D=LIGHT PURPLE
E=LIGHT YELLOW F=BRIGHT WHIT
for more help You can type
`color /?`
in command Prompt Thanks