Utility class for color-based operations.
Inheritance
object
Methods
Section titled "Methods"ColorToInt(Color)
Section titled "ColorToInt(Color)"Converts a color to its integer representation for use in bitmaps.
public static int ColorToInt(Color color) Parameters
- color:
Color
Returns any
ColorToString(Color, bool)
Section titled "ColorToString(Color, bool)"public static string ColorToString(Color c, bool useRgba) Parameters
- c:
Color - useRgba:
bool
Returns any
FromAHSL(double, double, double, double)
Section titled "FromAHSL(double, double, double, double)"Gets a color from the specified ahsl components
public static Color FromAHSL(double alpha, double hue, double saturation, double lightness) Parameters
- alpha:
double - hue:
double - saturation:
double - lightness:
double
Returns any
FromAHSV(double, double, double, double)
Section titled "FromAHSV(double, double, double, double)"Gets a color from the specified ahsv components
public static Color FromAHSV(double alpha, double hue, double saturation, double value) Parameters
- alpha:
double - hue:
double - saturation:
double - value:
double
Returns any
FromArgb(int)
Section titled "FromArgb(int)"Converts ARGB integer to a Color, e.g. -65536 (red pixel)
public static Color FromArgb(int argb) Parameters
- argb:
int
Returns any
FromArgb(string)
Section titled "FromArgb(string)"Converts ARGB string to a Color, e.g. '#AARRGGBB'
public static Color FromArgb(string hex) Parameters
- hex:
string
Returns any
FromHex(string)
Section titled "FromHex(string)"Converts color hex string to a Color, e.g. '#AARRGGBB', '#RRGGBB', or '#RGB'
public static Color FromHex(string colorHex) Parameters
- colorHex:
string
Returns any
FromRGB(string)
Section titled "FromRGB(string)"Converts RGB string a Color, e.g. 'RGB, R,G,B'
public static Color FromRGB(string rgb) Parameters
- rgb:
string
Returns any
FromRGBA(string)
Section titled "FromRGBA(string)"Converts RGBA string a Color, e.g. 'RGBA, R,G,B,A',
public static Color FromRGBA(string rgba) Parameters
- rgba:
string
Returns any
FromString(string)
Section titled "FromString(string)"Converts string format to a Color, e.g. 'DodgerBlue', '#AARRGGBB', '#RRGGBB', 'RGBA, R,G,B,A', or 'RGB, R,G,B'
public static Color FromString(string colorFormat) Parameters
- colorFormat:
string
Returns any
GetAHSL(Color)
Section titled "GetAHSL(Color)"Gets the ahsl components of this color
public static double[] GetAHSL(this Color color) Parameters
- color:
Color
Returns any
GetAHSV(Color)
Section titled "GetAHSV(Color)"Gets the ahsv components of this color
public static double[] GetAHSV(this Color color) Parameters
- color:
Color
Returns any
GetAHSVInterpolation(double[], double, double[])
Section titled "GetAHSVInterpolation(double[], double, double[])"Get an interpolated color between two colors.
public static Color GetAHSVInterpolation(double[] minimum, double interpolation, double[] maximum) Parameters
- minimum:
double[] - interpolation:
double - maximum:
double[]
Returns any
GetColor(Brush)
Section titled "GetColor(Brush)"Returns the main color of the given brush.
public static Color GetColor(Brush brush) Parameters
- brush:
Brush
Returns any
GetInterpolation(Color, double, Color, InterpolationMode)
Section titled "GetInterpolation(Color, double, Color, InterpolationMode)"Get an interpolation from the current color to the specified color
public static Color GetInterpolation(this Color minimum, double interpolation_, Color maximum_, InterpolationMode interpolationMode) Parameters
- minimum:
Color - interpolation_:
double - maximum_:
Color - interpolationMode:
InterpolationMode
Returns any
GetL(Color)
Section titled "GetL(Color)"public static double GetL(this Color color) Parameters
- color:
Color
Returns any
GetRandomColor(int)
Section titled "GetRandomColor(int)"Get a random color from generated array of colors.
public static Color GetRandomColor(int index) Parameters
- index:
int
Returns any
GetsRGB(Color)
Section titled "GetsRGB(Color)"public static double[] GetsRGB(this Color color) Parameters
- color:
Color
Returns any
RGBAToRGB(Color, Color)
Section titled "RGBAToRGB(Color, Color)"public static Color RGBAToRGB(this Color color, Color background) Parameters
- color:
Color - background:
Color
Returns any
RandomColor(byte)
Section titled "RandomColor(byte)"Returns a random color.
public static Color RandomColor(byte alpha) Parameters
- alpha:
byte
Returns any
RandomHue(Color)
Section titled "RandomHue(Color)"Get a random color
public static Color RandomHue(Color color) Parameters
- color:
Color
Returns any
ToGrayscale(Color)
Section titled "ToGrayscale(Color)"public static Color ToGrayscale(Color color) Parameters
- color:
Color