Class ColorHelper
- Namespace
- HelixToolkit.Wpf
- Assembly
- HelixToolkit.Wpf.dll
Helper methods for Color.
public static class ColorHelper
- Inheritance
-
ColorHelper
- Inherited Members
Fields
UndefinedColor
The undefined color #00000000.
public static readonly Color UndefinedColor
Field Value
Methods
ChangeAlpha(Color, byte)
Change the alpha value of a color
public static Color ChangeAlpha(this Color c, byte alpha)
Parameters
Returns
ChangeIntensity(Color, double)
Changes the intensity.
public static Color ChangeIntensity(this Color c, double factor)
Parameters
Returns
ColorDifference(Color, Color)
Calculates the difference between two Colors
public static double ColorDifference(Color c1, Color c2)
Parameters
Returns
- double
L2-norm in RGBA space
ColorToHex(Color)
Convert a Color to a hexadecimal string.
public static string ColorToHex(Color color)
Parameters
colorColor
Returns
- string
The color to hex.
ColorToHsv(Color)
Converts from a Color to HSV values (double)
public static double[] ColorToHsv(Color color)
Parameters
colorColor
Returns
- double[]
Array of [Hue,Saturation,Value] in the range [0,1]
ColorToHsvBytes(Color)
Converts from a Color to HSV values (byte)
public static byte[] ColorToHsvBytes(Color color)
Parameters
colorColor
Returns
- byte[]
Array of [Hue,Saturation,Value] in the range [0,255]
ColorToUint(Color)
Convert a Color to unsigned int
public static uint ColorToUint(Color c)
Parameters
cColor
Returns
- uint
The color to uint.
Complementary(Color)
Calculates the complementary color
public static Color Complementary(Color c)
Parameters
cColor
Returns
HexToColor(string)
Convert a hexadecimal string to Color.
public static Color HexToColor(string value)
Parameters
valuestring
Returns
HsvToColor(byte, byte, byte)
Converts from HSV to a RGB Color
public static Color HsvToColor(byte hue, byte saturation, byte value)
Parameters
Returns
HsvToColor(double, double, double)
Convert from HSV to Color http://en.wikipedia.org/wiki/HSL_color_space
public static Color HsvToColor(double hue, double sat, double val)
Parameters
Returns
HsvToColor(double[])
Create a color from the specified HSV.
public static Color HsvToColor(double[] hsv)
Parameters
hsvdouble[]The HSV.
Returns
- Color
A color.
HueDifference(Color, Color)
Calculate the difference in hue between two Colors.
public static double HueDifference(Color c1, Color c2)
Parameters
Returns
- double
The hue difference.
Interpolate(Color, Color, double)
Linear interpolation between two Colors.
public static Color Interpolate(Color c0, Color c1, double x)
Parameters
Returns
UIntToColor(uint)
Convert an unsigned int (32bit) to Color
public static Color UIntToColor(uint color)
Parameters
coloruint