Class ColorUtilities
Static helper class related to color.
Inheritance
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.Windows.Controls.Diagrams.dll
Syntax
public static class ColorUtilities : Object
Fields
NamedColors
Know color names taken over from .Net.
Declaration
public static readonly IList<string> NamedColors
Field Value
System.
|
NamedColorsRgb
The ARGB values corresponding to the Named
Declaration
public static readonly IList<string> NamedColorsRgb
Field Value
System.
|
Properties
RandomBlues
Gets a random shade of blue.
Declaration
public static Color RandomBlues { get; }
Property Value
System. The random blue color. |
RandomBrush
Gets the random brush where the color is picked from the known colors.
Declaration
public static Brush RandomBrush { get; }
Property Value
System. The random brush. |
Methods
ByteArrayToHexString(Byte[])
Converts the given byte array to a color in the format #AARRGGBB.
Declaration
public static string ByteArrayToHexString(byte[] value)
Parameters
System. The bytes. |
Returns
System.
|
ColorFromString(String)
Colors from string.
Declaration
public static Color ColorFromString(string hexValue)
Parameters
System. The hex string. |
Returns
System.
|
ColorToString(Color)
Converts the specified color to a format #AARRGGBB. Use the Color
Declaration
public static string ColorToString(Color color)
Parameters
System. The value to convert. |
Returns
System. A string representing the specified value. |
FromAngle(Double)
Creates a color from an angle.
Declaration
public static Color FromAngle(double value)
Parameters
System. The angle in degrees. |
Returns
System.
|
FromArgb(Byte, Byte, Byte, Byte)
Returns brush from ARGB values.
Declaration
public static Brush FromArgb(byte alfa, byte red, byte green, byte blue)
Parameters
System. The alfa. |
System. The red. |
System. The green. |
System. The blue. |
Returns
System.
|
FromHsl(Double, Double, Double)
Returns a color based on its HSL value.
Declaration
public static Color FromHsl(double hue, double saturation, double luminance)
Parameters
System. The hue. |
System. The saturation. |
System. The luminance. |
Returns
System. The corresponding color. |
HexStringFromSolidColor(Color)
Declaration
public static string HexStringFromSolidColor(Color color)
Parameters
System. The color. |
Returns
System.
|
HexStringToByteArray(String)
Converts the #AARRGGBB string color to a byte array.
Declaration
public static byte[] HexStringToByteArray(string color)
Parameters
System. The hex string value of the color. |
Returns
System.
|
Multiply(Color, Double)
Multiplies/scales the specified color.
Declaration
public static Color Multiply(this Color color, double factor)
Parameters
System. The color. |
System. The factor. |
Returns
System.
|
Parse(Int32)
Parses the specified value and converts it to a color.
Declaration
public static Color Parse(int value)
Parameters
System. The value. |
Returns
System.
|
Parse(String)
Parses the specified color string (e.g. '#FF4B4578').
Declaration
public static Color Parse(string value)
Parameters
System. The string representation of the color. |
Returns
System.
|
ParseToBrush(String)
Parses to brush.
Declaration
public static SolidColorBrush ParseToBrush(string hexValue)
Parameters
System. The hex string. |
Returns
System.
|
RgbToHsl(Color)
Given a Color (RGB Struct) in range of 0-255 Return H,S,L in the range [0,1].
Declaration
public static HslColor RgbToHsl(Color colorRgb)
Parameters
System. The RGB. |
Returns
StringToColor(String)
Converts the specified string value to Color.
Declaration
public static Color StringToColor(string value)
Parameters
System. The string value to convert from. |
Returns
System. A Color value that is deserialized from the specified string. |
Sum(Color, Color)
Adds the two given colors.
Declaration
public static Color Sum(Color color1, Color color2)
Parameters
System. The first color. |
System. The second color. |
Returns
System.
|
ToValue(Color)
Returns the unsigned integer value of the color.
Declaration
public static int ToValue(Color color)
Parameters
System. The color. |
Returns
System.
|