ClassColorUtilities
Static helper class related to color.
Definition
Namespace:Telerik.Windows.Diagrams.Core
Assembly:Telerik.Windows.Controls.Diagrams.dll
Syntax:
public static class ColorUtilities
Inheritance: objectColorUtilities
Fields
NamedColors
Know color names taken over from .Net.
NamedColorsRgb
The ARGB values corresponding to the NamedColors.
Properties
RandomBlues
Gets a random shade of blue.
Declaration
public static Color RandomBlues { get; }
Property Value
Color
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
Brush
The random brush.
Methods
ByteArrayToHexString(byte[])
Converts the given byte array to a color in the format #AARRGGBB.
ColorFromString(string)
Colors from string.
Declaration
public static Color ColorFromString(string hexValue)
Parameters
hexValue
The hex string.
Returns
Color
ColorToString(Color)
Converts the specified color to a format #AARRGGBB. Use the to convert a string back to a color.
Declaration
public static string ColorToString(Color color)
Parameters
color
Color
The value to convert.
Returns
A string representing the specified value.
FromAngle(double)
Creates a color from an angle.
Declaration
public static Color FromAngle(double value)
Parameters
value
The angle in degrees.
Returns
Color
FromArgb(byte, byte, byte, byte)
Returns brush from ARGB values.
FromHsl(double, double, double)
Returns a color based on its HSL value.
HexStringFromSolidColor(Color)
Declaration
public static string HexStringFromSolidColor(Color color)
Parameters
color
Color
The color.
Returns
HexStringToByteArray(string)
Converts the #AARRGGBB string color to a byte array.
Multiply(Color, double)
Multiplies/scales the specified color.
Declaration
public static Color Multiply(this Color color, double factor)
Parameters
color
Color
The color.
factor
The factor.
Returns
Color
Parse(int)
Parses the specified value and converts it to a color.
Declaration
public static Color Parse(int value)
Parameters
value
The value.
Returns
Color
Parse(string)
Parses the specified color string (e.g. '#FF4B4578').
Declaration
public static Color Parse(string value)
Parameters
value
The string representation of the color.
Returns
Color
ParseToBrush(string)
Parses to brush.
Declaration
public static SolidColorBrush ParseToBrush(string hexValue)
Parameters
hexValue
The hex string.
Returns
SolidColorBrush
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
colorRgb
Color
The RGB.
Returns
StringToColor(string)
Converts the specified string value to Color.
Declaration
public static Color StringToColor(string value)
Parameters
value
The string value to convert from.
Returns
Color
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
color1
Color
The first color.
color2
Color
The second color.
Returns
Color
ToValue(Color)
Returns the unsigned integer value of the color.
Declaration
public static int ToValue(Color color)
Parameters
color
Color
The color.
Returns