.NET Framework Class Library for Silverlight
SolidColorBrush..::.Color Property

Gets or sets the color of this SolidColorBrush.

Namespace:  System.Windows.Media
Assembly:  System.Windows (in System.Windows.dll)
Syntax

Visual Basic (Declaration)
Public Property Color As Color
    Get
    Set
Visual Basic (Usage)
Dim instance As SolidColorBrush
Dim value As Color

value = instance.Color

instance.Color = value
C#
public Color Color { get; set; }
XAML Attribute Usage
<SolidColorBrush Color="predefinedColorName"/>
- or -
<SolidColorBrush Color="#rgb"/>
- or -
<SolidColorBrush Color="#argb"/>
- or -
<SolidColorBrush Color="#rrggbb"/>
- or -
<SolidColorBrush Color="#aarrggbb"/>
- or -
<SolidColorBrush Color="sc#scR,scG,scB"/>
- or -
<SolidColorBrush Color="sc#scA,scR,scG,scB"/>

XAML Values

predefinedColorName

One of the colors predefined by the Colors class (static properties), or one of the other named colors. See Remarks.

rgb

A three-character hexadecimal value. The first character specifies the color's R value, the second character specifies the G value, and the third character specifies the B value. For example, #00F.

argb

A four-character hexadecimal value. The first character specifies the color's A value, the second character specifies its R value, the third character specifies the G value, and the fourth character specifies its B value. For example, #F00F.

rrggbb

A six-character hexadecimal value. The first two characters specify the color's R value, the next two specify its G value, and the final two specify its B value. For example, #0000FF.

aarrggbb

An eight-character hexadecimal value. The first two characters specify the color's A value, the next two specify its R value, the next two specify its G value, and the final two specify its B value. For example, #FF0000FF.

scA

The color's ScA value as a value between 0 and 1. ScA is not exposed as a Color property directly.

scR

The color's ScR value as a value between 0 and 1. ScR is not exposed as a Color property directly

scG

The color's ScG value as a value between 0 and 1. ScG is not exposed as a Color property directly

scB

The color's ScB value as a value between 0 and 1. ScB is not exposed as a Color property directly

Property Value

Type: System.Windows.Media..::.Color
The brush's color. The default value is Transparent.
Remarks

Dependency property identifier field: ColorProperty

The Color property of SolidColorBrush uses the same type conversion as the SolidColorBrush class construction behavior, which in turn is forwarded as the default attribute type conversion for all Brush properties. This syntax enables you to specify a string value for a property or attribute that takes a Brush, and the string is interpreted within a number of possible conventions, which include named colors, sRGB, or scRGB.

Predefined Colors

ms613054.JOLT_local_-485375713_art_color_table(en-us,VS.95).png

Both sRGB and scRGB schemes can specify an alpha value.

For more information on the XAML syntax, see SolidColorBrush, Color and Brush.

If you deliberately set a Transparent value, as opposed to a null value, a Transparent value is hit testable and will intercept mouse actions that you might have intended for objects beneath the transparency.

For information on setting Color to a predefined color name rather than an existing value of Color, see "Setting Predefined Colors for a SolidColorBrush in Code" section of SolidColorBrush.

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

Other Resources

Tags :


Page view tracker