Class ColorUtilities
Static helper class related to color.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.WinControls.RadDiagram.dll
Syntax
public static class ColorUtilities
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
Color
The random blue color. |
RandomBrush
Gets the random brush where the color is picked from the known Color.
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
ColorToString(Color)
Converts the specified color to a format #AARRGGBB. Use the Color
Declaration
public static string ColorToString(Color color)
Parameters
Color
color
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
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
Color
The corresponding color. |
HexStringFromSolidColor(Color)
Declaration
public static string HexStringFromSolidColor(Color color)
Parameters
Color
color
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
Color
color
The color. |
System. The factor. |
Returns
Parse(Int32)
Parses the specified value and converts it to a color.
Declaration
public static Color Parse(int value)
Parameters
System. The value. |
Returns
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
ParseToBrush(String)
Parses to brush.
Declaration
public static SolidBrush 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
Color
colorRgb
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
Color
A Color value that is deserialized from the specified string. |
Sum(Color, Color)
Adds the two given Color.
Declaration
public static Color Sum(Color color1, Color color2)
Parameters
Returns
ToValue(Color)
Returns the unsigned integer value of the color.
Declaration
public static int ToValue(Color color)
Parameters
Color
color
The color. |
Returns
System.
|