class Blend2D::Styling::Gradient
- Blend2D::Styling::Gradient
- Blend2D::BLStructure
- Reference
- Object
Defined in:
blend2d/styling/gradient.crClass Method Summary
-
.conical(point : Point, angle, extend_mode = ExtendMode::Pad)
Creates a new conical gradient with the specified parameters.
-
.conical(x0, y0, angle, extend_mode = ExtendMode::Pad)
Creates a new conical gradient with the specified parameters.
-
.linear(x0, y0, x1, y1, extend_mode = ExtendMode::Pad)
Creates a new linear gradient with the specified coordinates.
-
.linear(a : Point, b : Point, extend_mode = ExtendMode::Pad)
Creates a new linear gradient with the specified parameters.
-
.radial(x0, y0, x1, y1, r, extend_mode = ExtendMode::Pad)
Creates a new radial gradient with the specified parameters.
-
.radial(a : Point, b : Point, r, extend_mode = ExtendMode::Pad)
Creates a new radial gradient with the specified parameters.
Instance Method Summary
-
#<<(stop : GradientStop)
Adds a stop to the gradient given a
GradientStop
. -
#==(other : Gradient)
Checks whether or not this gradient is equal to another based on its low-level C counterpart.
-
#add_stop(offset : Float64, color : RGBA32)
Adds a stop to the gradient.
-
#add_stop(offset : Float64, color : RGBA64)
Adds a stop to the gradient.
-
#add_stop(stop : GradientStop)
Adds a stop to the gradient given a
GradientStop
. -
#extend_mode
Fetch this gradient's extend mode.
-
#extend_mode=(extend_mode : ExtendMode)
Set this gradient's extend mode.
-
#finalize
Called when Crystal's garbage collector collects this instance.
-
#index_of(offset : Float64) : Int32
Get the index of a stop by its offset.
-
#matrix_operation(operation : MatrixOperation, data : Array(Float64))
Apply a matrix operation to the gradient.
-
#remove_stop(index : Int32)
Removes a stop from the gradient based on its index.
-
#remove_stops(start_index : Int32, end_index : Int32)
Remove a range of stops.
-
#remove_stops_between(min : Float64, max : Float64)
Remove a range of stops.
-
#replace_stop(index : Int32, offset : Float64, color : RGBA32)
Replace a stop with another.
-
#replace_stop(index : Int32, offset : Float64, color : RGBA64)
Replace a stop with another.
-
#replace_stop(index : Int32, stop : GradientStop)
Replace a stop with another.
-
#reset_stops
Resets the stops of this gradient.
-
#set_stops(stops : Array(GradientStop))
Sets the stops of this gradient from an
Array(GradientStop)
. - #shrink
-
#stops
Returns an
Array(GradientStop)
representing the stops of this gradient.
Instance methods inherited from class Blend2D::BLStructure
finalize
finalize,
pointer : Pointer
pointer
Class Method Detail
Creates a new conical gradient with the specified parameters.
Creates a new conical gradient with the specified parameters.
Creates a new linear gradient with the specified coordinates.
Creates a new linear gradient with the specified parameters.
Creates a new radial gradient with the specified parameters.
Creates a new radial gradient with the specified parameters.
Instance Method Detail
Checks whether or not this gradient is equal to another based on its low-level C counterpart.
Called when Crystal's garbage collector collects this instance.
Apply a matrix operation to the gradient. See Context#matrix_operation
for more information.
Replace a stop with another.
Replace a stop with another.
Sets the stops of this gradient from an Array(GradientStop)
.