GradientStop.Color Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets or sets the color of the gradient stop.
Assembly: System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.
<GradientStop Color="colorString" .../>
XAML Values
Property Value
Type: System.Windows.Media.ColorThe color of the gradient stop. The default is Transparent.
Dependency property identifier field: ColorProperty
You can set a color to a static property value of Colors, to additional named colors using string type conversion, or to a Color returned by methods such as FromArgb. For details, see Color.
The following 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>
