Color Property (GradientStop)

Gets or sets the color of a gradient stop.

XAML
<object Color="Color" .../>
Scripting
value = object.Color
object.Color = value

Property Value

Color

The color of the gradient stop.

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

Remarks

See Color for details on the various string formats that can be used to specify a color either in XAML or script.

Examples

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

XAML
<Canvas
  xmlns="http://schemas.microsoft.com/client/2007"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

  <!-- This rectangle is painted with a diagonal linear gradient. -->
  <Rectangle Width="200" Height="100">
    <Rectangle.Fill>
      <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" />
      </LinearGradientBrush>
    </Rectangle.Fill>
  </Rectangle>
</Canvas>

Applies To

GradientStop

See Also

Silverlight Brushes Overview

Community Additions

Show: