GradientStop.Color GradientStop.Color GradientStop.Color GradientStop.Color Property

Definition

Gets or sets the color of the gradient stop.

public : Color Color { get; set; }
Color Color();

void Color(Color color);
public Color Color { get; set; }
Public ReadWrite Property Color As Color
<GradientStop Color="colorString" .../>

Property Value

The color of the gradient stop. The default is Transparent.

Examples

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

<StackPanel>
  <!-- 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>
</StackPanel>