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


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.


This 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" />