Color (GradientStop)

Gets or sets the color of a gradient stop.

<object Color="colorString"  .../>
value = object.Color
object.Color = value

XAML Values




The Color for a SolidColorBrush expressed as an attribute string. This can be a named color, an RGB value, or an ScRGB value. RGB or ScRGB may also specify alpha information. See the "colorString Grammar" section in Color.

Property Value

Type: Color

The color of the gradient stop.

This property is read/write. The default value is Transparent.

Managed Equivalent



You cannot specify a Brush object element such as LinearGradientBrush for this property value by using property element syntax. You can only use XAML attribute syntax to set Color to a color string, as documented in the "colorString Grammar" section of the Color reference topic.

Setting this property in JavaScript also requires the colorString grammar to specify the value as a string, unless you set it to the value of another object's property that is also a Color. See the "Remarks" section in Color for additional information about the scripting usage of the Color object.


The following example creates a LinearGradientBrush with four gradient stops in the implicit GradientStopCollection, which is used to paint a Rectangle.


  <!-- This rectangle is painted with a diagonal linear gradient. -->
  <Rectangle Width="200" Height="100">
      <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
        <GradientStop Color="Yellow" Offset="0.0" />
        <GradientStop Color="Red" Offset="0.25" />
        <GradientStop Color="Blue" Offset="0.75" />
        <GradientStop Color="LimeGreen" Offset="1.0" />

Applies To