You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I just wanted to leave the comment that C# supports 24Bit colors for the Windows console.
You can find an example in one of my libraries:
Color Setter Functions
publicstaticclassConsoleExtensions{publicstaticRGBAColorForegroundColor{set=>Console.Write(value.ToVT100ForegroundString());}publicstaticRGBAColorBackgroundColor{set=>Console.Write(value.ToVT100BackgroundString());}// this static constructor is needed on non-unix machines, as the VT100 color codes are not always enabled by default.// see https://github.com/Unknown6656/Unknown6656.Core/blob/master/Unknown6656.Core/Controls/Console/ConsoleExtensions.csstaticConsoleExtensions(){if(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)){STDINConsoleMode|=ConsoleMode.ENABLE_VIRTUAL_TERMINAL_PROCESSING;STDOUTConsoleMode|=ConsoleMode.ENABLE_VIRTUAL_TERMINAL_PROCESSING;}}}
publicvoidMain(){ConsoleExtensions.ForegroundColor=0xfe80;// set color using hex literals.ConsoleExtensions.BackgroundColor=ConsoleColor.Blue;// traditional method.Console.WriteLine("Hello World!");Console.WriteLine("\x1b[4mHello World!\x1b[24m");// this is underlined text using VT100-commands!}
Maybe this feature could be handy for you...
The text was updated successfully, but these errors were encountered:
Hi, I just wanted to leave the comment that C# supports 24Bit colors for the Windows console.
You can find an example in one of my libraries:
Color Setter Functions
https://github.com/Unknown6656/Unknown6656.Core/blob/master/Unknown6656.Core/Controls/Console/ConsoleExtensions.cs#L37..L57
Color Data Structure
https://github.com/Unknown6656/Unknown6656.Core/blob/master/Unknown6656.Core/Imaging/RGBAColor.cs
Usage
Maybe this feature could be handy for you...
The text was updated successfully, but these errors were encountered: