CrImage::Draw::RadialGradient
Inherits Reference / Object
RadialGradient represents a circular color gradient radiating from a center point.
The gradient interpolates colors radially from the center outward to the radius, using the defined color stops. Colors are smoothly blended between stops.
Example:
stops = [
CrImage::Draw::ColorStop.new(0.0, CrImage::Color::WHITE),
CrImage::Draw::ColorStop.new(1.0, CrImage::Color::BLACK),
]
gradient = CrImage::Draw::RadialGradient.new(
CrImage.point(200, 150),
100,
stops
)
Constructors
Instance methods
center
Sourcecenter=(center : Point)
Sourcecolor_at(t : Float64) : Color::Color
Gets the interpolated color at a given distance from center.
Parameters:
t: Normalized distance from center (0.0 = center, 1.0 = radius)
Returns: Interpolated color at distance t
radius
Sourceradius=(radius : Int32)
Sourcestops
Sourcestops=(stops : Array(ColorStop))
Source