Table of Contents

Struct LinearGradient

Namespace
Xui.Core.Canvas
Assembly
Core.dll

Represents a linear gradient brush that transitions between colors along a straight line, following the same behavior as the HTML5 Canvas createLinearGradient().

public ref struct LinearGradient
Inherited Members

Constructors

LinearGradient(Point, Point, ReadOnlySpan<GradientStop>)

Creates a new LinearGradient with the given start and end points and gradient stops.

public LinearGradient(Point start, Point end, ReadOnlySpan<GradientStop> gradient)

Parameters

start Point

The start point of the gradient.

end Point

The end point of the gradient.

gradient ReadOnlySpan<GradientStop>

A span of gradient stops sorted by offset.

Fields

EndPoint

The ending point of the gradient, in user space coordinates.

public Point EndPoint

Field Value

Point

GradientStops

The sequence of gradient stops that define color transitions along the line. Offsets are typically in the range [0, 1].

public ReadOnlySpan<GradientStop> GradientStops

Field Value

ReadOnlySpan<GradientStop>

StartPoint

The starting point of the gradient, in user space coordinates.

public Point StartPoint

Field Value

Point