GradientStop.Color Property


Gets or sets the color of the gradient stop.

 property Color Color { Color get(); void set(Color value); };
Color Color();

void Color(Color value);
public Color Color { get; set; }
var color = gradientStop.color;
gradientStop.color = color;
Public 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" />

Applies to