Describes a color in terms of alpha, red, green, and blue channels.
In Silverlight 1.0, colors are specified through a string that is parsed by one of three conventions or schemes: a named color, a hexadecimal string, or an ScRGB string. The hexadecimal string convention uses either one-character or two-character hexadecimal components, representing 8-bit and 16-bit colors for alpha, red, green, blue components, prefixed by a hash sign (#). The alpha component for hexadecimal schemes is optional, defaults to 100% alpha, and is used only if the string that follows the hash sign is exactly 4 or 8 characters. The ScRGB convention uses the prefix "sc#" (case-sensitive) and then alpha, red, green, and blue components as double values between 0 and 1. Each such value is separated by either a space or a comma. The alpha component for the ScRGB scheme is optional, defaults to 1, and is used only if there are 4 components (3 separators). All of the examples in the following table produce the same color value. Those that specify an alpha value all specify 50% alpha.
Predefined Color Name
8-bit hexadecimal, no alpha
8-bit hexadecimal, alpha
16-bit hexadecimal, no alpha
16-bit hexadecimal, alpha
scRGB, no alpha
One of the values from the following table.
Alpha component of an 8-bit hexadecimal scheme for defining a color. This value can be a hexadecimal string from 0 (full alpha, transparent) to F (no alpha, opaque).
Red (R), green (G), or blue (B) component of an 8-bit hexadecimal scheme for defining a color. This value can be a hexadecimal string from 0 (no saturation) to F (full saturation) for each of the R, G, and B components.
Alpha component of a 16-bit hexadecimal scheme for defining a color. This value can be a hexadecimal string from 00 (full alpha, transparent) to FF (no alpha, opaque).
Red (RR), green (GG), or blue (BB) component of a 16-bit hexadecimal scheme for defining a color. This value can be a hexadecimal string from 00 (no saturation) to FF (full saturation) for each of the RR, GG, and BB components.
Alpha component of an ScRGB scheme for defining a color. This value can be a decimal value 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 decimal value from 0 (no saturation) to 1 (full saturation) for each of the r, g, and b components.
In scripting, you specify a color as a quoted string, and you use the same type conversion behavior as for XAML attributes. You can use a named color string, a hexadecimal string (either 8-bit or 16-bit color depth), or an ScRGB string. If you get the value of most Color properties (such as Color (SolidColorBrush)) 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 you can set one Color property with the value of another existing Color, but directly comparing these values to named color strings, hexadecimal strings, or ScRGB strings that were used to initially specify the color 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.