-4

I'm writing a small text-based adventure in C# that uses the command prompt for everything, and I'm looking for a way to change the colour of outputted text. None of the methods I've looked at have worked properly.

2

3 Answers 3

1
Console.ForegroundColor = ConsoleColor.DarkRed;

Should work fine.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot! Couldn't find that anywhere... Probably wasn't trying hard enough though.
1

try this:

Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("blue.");

Read more about Console.ForegroundColor you can also change background of text: Console.BackgroundColor

Comments

1

What you looking for is Console.BackgroundColor and Console.ForegroundColor properties.

For example;

Console.BackgroundColor = ConsoleColor.Black;
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("This is blue!!");

enter image description here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.