Colorful.Console
Colorful.Console copied to clipboard
Workaround for 16-Colors with Truecolor
(If this has been brought up before and rejected, I apologize, but I could not find a similar issue)
Hi, I'm new to this project, and I noticed at the bottom of the README that it says
Colorful.Console can only write to the console in 16 different colors And I considered a workaround!
Basically, you can avoid using System.ConsoleColor
, because not only do most macOS and linux terminals support this, but Windows does too!
And that thing is:
Truecolor/256 Color support
Truecolor is 24-bit colors, meaning you can convert from a System.Drawing.Color
to a custom color.
Basically, a Truecolor query is just prepending an ANSI Color Code to the string you want.
For example, in your terminal, if you write
echo "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n"
It outputs:
I think this is a versatile solution, as I've taken a swing at it, given that you can use string interpolation.
Hope this helps, Gammer0909