class Blend2D::Styling::Gradient

Defined in:

blend2d/styling/gradient.cr

Class Method Summary

Instance Method Summary

Instance methods inherited from class Blend2D::BLStructure

finalize finalize, pointer : Pointer pointer

Class Method Detail

def self.conical(point : Point, angle, extend_mode = ExtendMode::Pad) #

Creates a new conical gradient with the specified parameters.


[View source]
def self.conical(x0, y0, angle, extend_mode = ExtendMode::Pad) #

Creates a new conical gradient with the specified parameters.


[View source]
def self.linear(x0, y0, x1, y1, extend_mode = ExtendMode::Pad) #

Creates a new linear gradient with the specified coordinates.


[View source]
def self.linear(a : Point, b : Point, extend_mode = ExtendMode::Pad) #

Creates a new linear gradient with the specified parameters.


[View source]
def self.radial(x0, y0, x1, y1, r, extend_mode = ExtendMode::Pad) #

Creates a new radial gradient with the specified parameters.


[View source]
def self.radial(a : Point, b : Point, r, extend_mode = ExtendMode::Pad) #

Creates a new radial gradient with the specified parameters.


[View source]

Instance Method Detail

def <<(stop : GradientStop) #

Adds a stop to the gradient given a GradientStop.


[View source]
def ==(other : Gradient) #

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


[View source]
def add_stop(offset : Float64, color : RGBA32) #

Adds a stop to the gradient.


[View source]
def add_stop(offset : Float64, color : RGBA64) #

Adds a stop to the gradient.


[View source]
def add_stop(stop : GradientStop) #

Adds a stop to the gradient given a GradientStop.


[View source]
def extend_mode #

Fetch this gradient's extend mode.


[View source]
def extend_mode=(extend_mode : ExtendMode) #

Set this gradient's extend mode.


[View source]
def finalize #
Description copied from class Blend2D::BLStructure

Called when Crystal's garbage collector collects this instance.


[View source]
def index_of(offset : Float64) : Int32 #

Get the index of a stop by its offset.


[View source]
def matrix_operation(operation : MatrixOperation, data : Array(Float64)) #

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


[View source]
def remove_stop(index : Int32) #

Removes a stop from the gradient based on its index.


[View source]
def remove_stops(start_index : Int32, end_index : Int32) #

Remove a range of stops.


[View source]
def remove_stops_between(min : Float64, max : Float64) #

Remove a range of stops.


[View source]
def replace_stop(index : Int32, offset : Float64, color : RGBA32) #

Replace a stop with another.


[View source]
def replace_stop(index : Int32, offset : Float64, color : RGBA64) #

Replace a stop with another.


[View source]
def replace_stop(index : Int32, stop : GradientStop) #

Replace a stop with another.


[View source]
def reset_stops #

Resets the stops of this gradient.


[View source]
def set_stops(stops : Array(GradientStop)) #

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


[View source]
def shrink #

[View source]
def stops #

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


[View source]