A linear gradient Brush.

LinearGradient lets you describe a linear gradient using a collection of GradientStops. The following example displays a Rectangle with a LinearGradient that fades from white at the top, to black at the bottom.

<Rectangle>
    <LinearGradient StartPoint="0,0" EndPoint="0,1">
        <GradientStop Offset="0" Color="#fff" />
        <GradientStop Offset="1" Color="#000" />
    </LinearGradient>
</Rectangle>

You may also specify any number of GradientStops.

<Circle>
    <LinearGradient AngleDegrees="90">
        <GradientStop Offset="0" Color="#f00" />
        <GradientStop Offset="0.3" Color="#f0f" />
        <GradientStop Offset="0.6" Color="#00f" />
        <GradientStop Offset="1" Color="#0ff" />
    </LinearGradient>
</Circle>

The StartPoint and EndPoint properties are both specified as a proportion of the total size of the Shape the brush is applied to. For instance, you can specify a diagonal brush by using StartPoint="0,0" EndPoint="1,1".

Instead of StartPoint and EndPoint, you can also specify an angle. This can either be in radians using the Angle property, or in degrees using the AngleDegrees property.

<LinearGradient Angle="2.4" />
              or
<LinearGradient AngleDegrees="45" />

Location

Namespace
Fuse.Drawing
Package
Fuse.Drawing 2.9.1
Show Uno properties and methods

Interface of LinearGradient

Angle : float ux

The angle of the gradient in radians. Can be used instead of StartPoint and EndPoint.

AngleDegrees : float ux

The angle of the gradient in degrees. Can be used instead of StartPoint and EndPoint.

EndPoint : float2 ux

The ending point of the gradient. Can be used together with StartPoint instead of specifying an Angle. Specified as a proportion of the total size of the Shape the brush is applied to. This means that, for instance, a value of 1, 1 results in the gradient ending at the bottom-right corner.

StartPoint : float2 ux

The starting point of the gradient. Can be used together with EndPoint instead of specifying an Angle. Specified as a proportion of the total size of the Shape the brush is applied to. This means that, for instance, a value of 0, 1 results in the gradient starting at the bottom-left corner.

Inherited from DynamicBrush

Inherited from Brush

Inherited from PropertyObject

Inherited from object

Attached UX Attributes

GlobalKey (attached by Resource) : string ux

The ux:Global attribute creates a global resource that is accessible everywhere in UX markup.

Implemented Interfaces