Struct RadialGradient
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
centerPointCenter point of the gradient.
radiusNFloatRadius of the gradient spread.
gradientStopsReadOnlySpan<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
startCenterPointCenter of the inner circle.
startRadiusNFloatRadius of the inner circle.
endCenterPointCenter of the outer circle.
endRadiusNFloatRadius of the outer circle.
gradientStopsReadOnlySpan<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
EndRadius
The radius of the ending circle (outer circle), defining the spread of the gradient.
public NFloat EndRadius
Field Value
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
StartCenter
The center point of the starting circle (inner circle).
public Point StartCenter
Field Value
StartRadius
The radius of the starting circle (inner circle), usually 0 for solid centers.
public NFloat StartRadius