Class ColorContrast
Color contrast tools
Inheritance
Namespace: Terminaux.Colors.Transformation.Contrast
Assembly: Terminaux.dll
Syntax
public static class ColorContrast
Methods
GetContrastColorHalf(Color)
Gets the color contrast appropriate for the specified color using the half white integer
Declaration
public static Color GetContrastColorHalf(this Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | Target color to work on |
Returns
Type | Description |
---|---|
Color | Black if the color is greater than half white; otherwise, false. |
GetContrastColorNtsc(Color)
Gets the color contrast appropriate for the specified color using the luma part of the YIQ color space (NTSC 1953)
Declaration
public static Color GetContrastColorNtsc(this Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | Target color to work on |
Returns
Type | Description |
---|---|
Color | Black if the luma info is less than or equal to 128, or white if greater than 128 |
IsSeeable(Color)
Checks to see if the specified color is considered seeable
Declaration
public static bool IsSeeable(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to use |
Returns
Type | Description |
---|---|
bool | True if the specified color is considered "seeable." False otherwise. |
Exceptions
Type | Condition |
---|---|
TerminauxException |
IsSeeable(ColorType, int, int, int, int, ColorSettings?)
Checks to see if the specified color is considered seeable
Declaration
public static bool IsSeeable(ColorType type, int colorLevel, int colorR, int colorG, int colorB, ColorSettings? settings = null)
Parameters
Type | Name | Description |
---|---|---|
ColorType | type | The color type to use |
int | colorLevel | The color level that is in the range of 0-255 |
int | colorR | The red color level |
int | colorG | The green color level |
int | colorB | The blue color level |
ColorSettings | settings | Settings to use |
Returns
Type | Description |
---|---|
bool | True if the specified color is considered "seeable." False otherwise. |
Exceptions
Type | Condition |
---|---|
TerminauxException |