class

Blend2D::Styling::Gradient

Inherits Blend2D::BLStructure < Reference < Object

Class methods

conical(point : Point, angle, extend_mode = ExtendMode::Pad)

Creates a new conical gradient with the specified parameters.

Source
conical(x0, y0, angle, extend_mode = ExtendMode::Pad)

Creates a new conical gradient with the specified parameters.

Source
linear(x0, y0, x1, y1, extend_mode = ExtendMode::Pad)

Creates a new linear gradient with the specified coordinates.

Source
linear(a : Point, b : Point, extend_mode = ExtendMode::Pad)

Creates a new linear gradient with the specified parameters.

Source
radial(x0, y0, x1, y1, r, extend_mode = ExtendMode::Pad)

Creates a new radial gradient with the specified parameters.

Source
radial(a : Point, b : Point, r, extend_mode = ExtendMode::Pad)

Creates a new radial gradient with the specified parameters.

Source

Instance methods

<<(stop : GradientStop)

Adds a stop to the gradient given a GradientStop.

Source
==(other : Gradient)

Checks whether or not this gradient is equal to another based on its low-level C counterpart.

Source
add_stop(offset : Float64, color : RGBA32)

Adds a stop to the gradient.

Source
add_stop(offset : Float64, color : RGBA64)

Adds a stop to the gradient.

Source
add_stop(stop : GradientStop)

Adds a stop to the gradient given a GradientStop.

Source
extend_mode

Fetch this gradient's extend mode.

Source
extend_mode=(extend_mode : ExtendMode)

Set this gradient's extend mode.

Source
finalize

Called when Crystal's garbage collector collects this instance.

Source
index_of(offset : Float64) : Int32

Get the index of a stop by its offset.

Source
matrix_operation(operation : MatrixOperation, data : Array(Float64))

Apply a matrix operation to the gradient. See Context#matrix_operation for more information.

Source
remove_stop(index : Int32)

Removes a stop from the gradient based on its index.

Source
remove_stops(start_index : Int32, end_index : Int32)

Remove a range of stops.

Source
remove_stops_between(min : Float64, max : Float64)

Remove a range of stops.

Source
replace_stop(index : Int32, offset : Float64, color : RGBA32)

Replace a stop with another.

Source
replace_stop(index : Int32, offset : Float64, color : RGBA64)

Replace a stop with another.

Source
replace_stop(index : Int32, stop : GradientStop)

Replace a stop with another.

Source
reset_stops

Resets the stops of this gradient.

Source
set_stops(stops : Array(GradientStop))

Sets the stops of this gradient from an Array(GradientStop).

Source
shrink
Source
stops

Returns an Array(GradientStop) representing the stops of this gradient.

Source