🖥️How to use
How do you use it?
Using this library is very simple! Just use the ColorSeq namespace in any piece of code you want to use the library, as in: using ColorSeq;
This library contains several functions that you can make use of in your console application:
Building a
Colorinstance that supports RGB and 255-color modesGetting console color information from the 255-color mode
Simulating color-blindness during compilation
Building a Color instance
Color instanceYou can build your own Color instance for usage in your console application. There are various ways to build it:
Color(int R, int G, int B)Color(ConsoleColors ColorDef)Color(int ColorNum)Color(string ColorSpecifier)
The ColorSpecifier can be of the syntax:
<num><num>should be of the range between 0 and 255
<rrr>;<ggg>;<bbb><rrr>,<ggg>, and<bbb>should be of the range between 0 and 255
#000000Hexadecimal representation of the color for HTML fans
<ColorName>Color name from
ConsoleColorsenumeration
Getting console color information
You can get detailed information about the console color ranging from 0 to 255 by making a new instance of the ConsoleColorsInfo class:
ConsoleColorsInfo(ConsoleColors ColorValue)
Simulating color-blindness
In the ColorTools static class, it contains several color blindness simulation tools that you can use:
EnableColorTransformationEnables the color transformation to adjust to color blindness upon making a new instance of color
EnableSimpleColorTransformationEnables the simple color transformation. This changes formula from Brettel 1997 (value is false) to Vienot 1999 (value is true)
ColorDeficiencySpecifies the type of color blindness (Protan, Deutan, and Tritan)
ColorDeficiencySeveritySpecifies the severity of the color deficiency ranging between 0.0 and 1.0 from lowest to highest
After you change these values, the next time you make a new instance of Color, you'll notice that the resulting color is shifted to adjust to color-blindness.
Last updated