Background and motivation
This API proposal should just make it easier to write things of different colors to the console. Right now, we have to call three methods to do so. This is how we would do that now:
Console.ForegroundColor = ConsoleColor.Blue;
Console.Write("Hello!");
Console.ResetColor();
This is what I propose:
Console.Write(ConsoleColor.Blue, "Hello!");
This isn't anything critical, it's just some sugar to make writing code a little bit easier.
API Proposal
namespace System
{
public static class Console
{
public void Write(ConsoleColor color, String value);
}
}
I would suggest having an overload for Write and WriteLine.
API Usage
System.Console.WriteLine(ConsoleColor.Red, "Red text!");
Alternative Designs
No response
Risks
I do not see any risks associated with this.
Background and motivation
This API proposal should just make it easier to write things of different colors to the console. Right now, we have to call three methods to do so. This is how we would do that now:
This is what I propose:
This isn't anything critical, it's just some sugar to make writing code a little bit easier.
API Proposal
I would suggest having an overload for
WriteandWriteLine.API Usage
Alternative Designs
No response
Risks
I do not see any risks associated with this.