StructColor
Describes a color in terms of alpha, red, green, and blue channels.
Definition
Namespace:Telerik.WinControls.RichTextEditor.UI
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
[TypeConverter(typeof(WpfColorConverter))]
public struct Color : IFormattable
Implements:
Properties
A
Gets or sets the sRGB alpha channel value of the color.
Declaration
public byte A { get; set; }
Property Value
The sRGB alpha channel value of the color.
B
Gets or sets the sRGB blue channel value of the color.
G
Gets or sets the sRGB green channel value of the color.
R
Gets or sets the sRGB red channel value of the color.
ScA
Gets or sets the ScRGB alpha channel value of the color.
ScB
Gets or sets the ScRGB blue channel value of the color.
ScG
Gets or sets the ScRGB green channel value of the color.
Methods
AreClose(Color, Color)
Compares two Color structures for fuzzy equality.
Clamp()
Sets the ScRGB channels of the color to within the gamut of 0 to 1, if they are outside that range.
Declaration
public void Clamp()
Equals(Color)
Tests whether the specified Color structure is identical to the current color.
Equals(Color, Color)
Tests whether two Color structures are identical.
Equals(object)
Tests whether the specified object is a Color structure and is equivalent to the current color.
FromAValues(float, float[], Uri)
Creates a new Color structure by using the specified alpha channel, color channel values, and color profile.
Declaration
public static Color FromAValues(float a, float[] values, Uri profileUri)
Parameters
a
The alpha channel for the new color.
values
float[]
A collection of values that specify the color channels for the new color. These values map to the profileUri.
profileUri
The International Color Consortium (ICC) or Image Color Management (ICM) color profile for the new color.
Returns
A Color structure with the specified values.
FromArgb(byte, byte, byte, byte)
Creates a new Color structure by using the specified sRGB alpha channel and color channel values.
Declaration
public static Color FromArgb(byte a, byte r, byte g, byte b)
Parameters
a
The alpha channel, A, of the new color.
r
The red channel, R, of the new color.
g
The green channel, G, of the new color.
b
The blue channel, B, of the new color.
Returns
A Color structure with the specified values.
FromRgb(byte, byte, byte)
Creates a new Color structure by using the specified sRGB color channel values.
Declaration
public static Color FromRgb(byte r, byte g, byte b)
Parameters
r
The sRGB red channel, R, of the new color.
g
The sRGB green channel, G, of the new color.
b
The sRGB blue channel, B, of the new color.
Returns
A Color structure with the specified values and an alpha channel value of 1.
FromScRgb(float, float, float, float)
Creates a new Color structure by using the specified ScRGB alpha channel and color channel values.
Declaration
public static Color FromScRgb(float a, float r, float g, float b)
Parameters
a
The ScRGB alpha channel, ScA, of the new color.
r
The ScRGB red channel, ScR, of the new color.
g
The ScRGB green channel, ScG, of the new color.
b
The ScRGB blue channel, ScB, of the new color.
Returns
A Color structure with the specified values.
FromValues(float[], Uri)
Creates a new Color structure by using the specified color channel values and color profile.
Declaration
public static Color FromValues(float[] values, Uri profileUri)
Parameters
values
float[]
A collection of values that specify the color channels for the new color. These values map to the profileUri.
profileUri
The International Color Consortium (ICC) or Image Color Management (ICM) color profile for the new color.
Returns
A Color structure with the specified values and an alpha channel value of 1.
GetHashCode()
Gets a hash code for the current Color structure.
GetNativeColorValues()
Gets the color channel values of the color.
Declaration
public float[] GetNativeColorValues()
Returns
float[]
An array of color channel values.
Multiply(Color, float)
Multiplies the alpha, red, blue, and green channels of the specified Color structure by the specified value.
ToString()
Creates a string representation of the color using the ScRGB channels.
Declaration
public override string ToString()
Returns
The string representation of the color.
Overrides
ToString(IFormatProvider)
Creates a string representation of the color by using the ScRGB channels and the specified format provider.
Declaration
public string ToString(IFormatProvider provider)
Parameters
provider
Culture-specific formatting information.
Returns
The string representation of the color.
Operators
operator *(Color, float)
Multiplies the alpha, red, blue, and green channels of the specified Color structure by the specified value.