Describes a color in terms of alpha, red, green, and blue channels.
<object property="colorString" .../>
object.property = "colorString"
In Silverlight 1.0, colors are specified through a string that is parsed by one of three conventions or schemes: a named color, a hex string, or an ScRGB string. The hex string convention uses either one-character or two-character hex components, representing 8-bit and 16-bit colors for alpha, red, green, blue components, prefixed by a hash sign (#). The alpha component for hex schemes is optional, defaults to 100% alpha, and is only used if the string following the hash sign is exactly 4 or exactly 8 characters. The ScRGB convention uses the prefix "sc#" (case sensitive), then alpha, red, green, blue components as double values between 0 and 1. Each such value is separated by a separator (either a space or a comma). The alpha component for the ScRGB scheme is optional, defaults to 1, and is only used if there are 4 components (3 separators). All of the examples produce the same color value. Those that specify an alpha value all specify 50% alpha.
|Predefined Color Name||predefinedColorName||"Blue"|
|8-bit hex, no alpha||#RGB||"#00f"|
|8-bit hex, alpha||#ARGB||"#800f"|
|16-bit hex, no alpha||#RRGGBB||"#0000ff"|
|16-bit hex, alpha||#AARRGGBB||"#800000ff"|
|scRGB, no alpha|| ||"sc#0,0,1"|
|scRGB, alpha|| ||"sc#0.5,0,0,1"|
One of the values from the following table.
Alpha component of an 8-bit hex scheme for defining a color. This value can be a hex string from 0 (full alpha, transparent) to F (no alpha, opaque).
Red (R) Green (G) or Blue (B) component of an 8-bit hex scheme for defining a color. This value can be a hex string from 0 (no saturation) to F (full saturation) for each of the R,G,B components.
Alpha component of a 16-bit hex scheme for defining a color. This value can be a hex string from 00 (full alpha, transparent) to FF (no alpha, opaque).
Red (RR) Green (GG) or Blue (BB) component of a 16-bit hex scheme for defining a color. This value can be a hex string from 00 (no saturation) to FF (full saturation) for each of the RR,GG,BB components.
Alpha component of an scRGB scheme for defining a color. This value can be a double from 0 (full alpha, transparent) to 1 (no alpha, opaque).
Red (r) Green (g) or Blue (b) component of an scRGB scheme for defining a color. This value can be a double from 0 (no saturation) to 1 (full saturation) for each of the r,g,b components.
In scripting, you specify a color as a quoted string, and the same type conversion behavior as for XAML attributes is used. You can provide a string for the named color, hex, or ScRGB conventions. If you get the value of most Color properties (such as SolidColorBrush.Color) through scripting, using the ToString() result, the value obtained will generally not be the same string that was used to specify it. This is because the value from scripting is now type converted and no longer reflects any of the input schemes. The runtime scripting value of an existing Color is potentially stored differently on different browsers and platforms. You can compare color values obtained from scripting between existing instances, or set one Color property with the value of another existing Color, but directly comparing these values to named color strings, hex strings, or ScRGB strings that were used to specify the color initially is not supported.
The Silverlight named color choices match the Microsoft .NET Framework version 1.0, Windows Forms, and Microsoft Internet Explorer color names. This representation is based on UNIX X11 named color values.