Class
ColorUtilities

Static helper class related to color.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Controls.Diagrams.dll

Syntax:

cs-api-definition
public static class ColorUtilities

Inheritance: objectColorUtilities

Fields

NamedColors

Know color names taken over from .Net.

Declaration

cs-api-definition
public static readonly IList<string> NamedColors

Field Value

IList<string>

NamedColorsRgb

The ARGB values corresponding to the NamedColors.

Declaration

cs-api-definition
public static readonly IList<string> NamedColorsRgb

Field Value

IList<string>

Properties

RandomBlues

Gets a random shade of blue.

Declaration

cs-api-definition
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

cs-api-definition
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.

Declaration

cs-api-definition
public static string ByteArrayToHexString(byte[] value)

Parameters

value

byte[]

The bytes.

Returns

string

ColorFromString(string)

Colors from string.

Declaration

cs-api-definition
public static Color ColorFromString(string hexValue)

Parameters

hexValue

string

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

cs-api-definition
public static string ColorToString(Color color)

Parameters

color

Color

The value to convert.

Returns

string

A string representing the specified value.

FromAngle(double)

Creates a color from an angle.

Declaration

cs-api-definition
public static Color FromAngle(double value)

Parameters

value

double

The angle in degrees.

Returns

Color

FromArgb(byte, byte, byte, byte)

Returns brush from ARGB values.

Declaration

cs-api-definition
public static Brush FromArgb(byte alfa, byte red, byte green, byte blue)

Parameters

alfa

byte

The alfa.

red

byte

The red.

green

byte

The green.

blue

byte

The blue.

Returns

Brush

FromHsl(double, double, double)

Returns a color based on its HSL value.

Declaration

cs-api-definition
public static Color FromHsl(double hue, double saturation, double luminance)

Parameters

hue

double

The hue.

saturation

double

The saturation.

luminance

double

The luminance.

Returns

Color

The corresponding color.

HexStringFromSolidColor(Color)

Declaration

cs-api-definition
public static string HexStringFromSolidColor(Color color)

Parameters

color

Color

The color.

Returns

string

HexStringToByteArray(string)

Converts the #AARRGGBB string color to a byte array.

Declaration

cs-api-definition
public static byte[] HexStringToByteArray(string color)

Parameters

color

string

The hex string value of the color.

Returns

byte[]

Multiply(Color, double)

Multiplies/scales the specified color.

Declaration

cs-api-definition
public static Color Multiply(this Color color, double factor)

Parameters

color

Color

The color.

factor

double

The factor.

Returns

Color

Parse(int)

Parses the specified value and converts it to a color.

Declaration

cs-api-definition
public static Color Parse(int value)

Parameters

value

int

The value.

Returns

Color

Parse(string)

Parses the specified color string (e.g. '#FF4B4578').

Declaration

cs-api-definition
public static Color Parse(string value)

Parameters

value

string

The string representation of the color.

Returns

Color

ParseToBrush(string)

Parses to brush.

Declaration

cs-api-definition
public static SolidColorBrush ParseToBrush(string hexValue)

Parameters

hexValue

string

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

cs-api-definition
public static HslColor RgbToHsl(Color colorRgb)

Parameters

colorRgb

Color

The RGB.

Returns

HslColor

StringToColor(string)

Converts the specified string value to Color.

Declaration

cs-api-definition
public static Color StringToColor(string value)

Parameters

value

string

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

cs-api-definition
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

cs-api-definition
public static int ToValue(Color color)

Parameters

color

Color

The color.

Returns

int