Table of Contents

Struct RadialGradient

Namespace
Xui.Core.Canvas
Assembly
Core.dll

Represents a radial gradient brush that transitions colors outward from one circle to another, similar to createRadialGradient() in the HTML5 Canvas API.

public ref struct RadialGradient
Inherited Members

Constructors

RadialGradient(Point, NFloat, ReadOnlySpan<GradientStop>)

Initializes a radial gradient from a single point and radius, fading outward from a solid center. This is equivalent to setting the start radius to zero and both centers to the same point.

public RadialGradient(Point center, NFloat radius, ReadOnlySpan<GradientStop> gradientStops)

Parameters

center Point

Center point of the gradient.

radius NFloat

Radius of the gradient spread.

gradientStops ReadOnlySpan<GradientStop>

Span of color stops defining the gradient transition.

RadialGradient(Point, NFloat, Point, NFloat, ReadOnlySpan<GradientStop>)

Initializes a radial gradient that transitions between two circles.

public RadialGradient(Point startCenter, NFloat startRadius, Point endCenter, NFloat endRadius, ReadOnlySpan<GradientStop> gradientStops)

Parameters

startCenter Point

Center of the inner circle.

startRadius NFloat

Radius of the inner circle.

endCenter Point

Center of the outer circle.

endRadius NFloat

Radius of the outer circle.

gradientStops ReadOnlySpan<GradientStop>

Span of color stops defining the gradient transition.

Fields

EndCenter

The center point of the ending circle (outer circle).

public Point EndCenter

Field Value

Point

EndRadius

The radius of the ending circle (outer circle), defining the spread of the gradient.

public NFloat EndRadius

Field Value

NFloat

GradientStops

A sequence of color stops defining how colors are interpolated from the inner to the outer circle. Offsets are typically in the range [0, 1].

public ReadOnlySpan<GradientStop> GradientStops

Field Value

ReadOnlySpan<GradientStop>

StartCenter

The center point of the starting circle (inner circle).

public Point StartCenter

Field Value

Point

StartRadius

The radius of the starting circle (inner circle), usually 0 for solid centers.

public NFloat StartRadius

Field Value

NFloat