Skip to content
Sign upLog in
← Back to Community

colors in c#

Profile icon
homelessgames

Console.ForegroundColor = ConsoleColor.DarkBlue;
Console.BackgroundColor = ConsoleColor.Yellow;
Console.Write("Hello ");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.BackgroundColor = ConsoleColor.Red;
Console.Write("les couleurs");
Console.ForegroundColor = ConsoleColor.Black;
Console.BackgroundColor = ConsoleColor.White;
Console.Write(" dans la console\n");

This code in C# is supposed to put some colors on my text, but it always put it in white. why?

This is the link to my project: https://repl.it/@homelessgames/ViolentRegularConditional

Voters
Profile icon
indiragomez
Profile icon
danebeltran98
Profile icon
JoeBenincasa
Profile icon
ZaariaMehrab
Profile icon
homelessgames
Comments
hotnewtop
Profile icon
theangryepicbanana

The default terminal right now only supports basic ANSI colors (e.g. "\e[32mtext\e[0m" prints out "text" colored green). If you accept the "explorer" role, it will let you use a wip xterm terminal which might work.