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
center
PointCenter point of the gradient.
radius
NFloatRadius 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
PointCenter of the inner circle.
startRadius
NFloatRadius of the inner circle.
endCenter
PointCenter of the outer circle.
endRadius
NFloatRadius 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
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