class Colors::Gradient

Included Modules

Defined in:

colors/gradient.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(low_color : ValidColor = :red, high_color : ValidColor = :green, from : ColorValue | UInt8 = ColorValue.off, upto : ColorValue | UInt8 = ColorValue.full, max = 100_i64) #

def self.new(range : Range(Int64, Int64), low_color : ValidColor = :red, high_color : ValidColor = :green, from : ColorValue | UInt8 = ColorValue.off, upto : ColorValue | UInt8 = ColorValue.full) #

Instance Method Detail

def [](val) : Color #

def check_colors #

def each(&) #
Description copied from module Enumerable(Colors::Color)

Must yield this collection's elements to the block.


def from : Colors::ColorValue | UInt8 #

def from=(from) #

def high_color : Colors::ValidColor #

def low_color : Colors::ValidColor #

def max : Int64 #
Description copied from module Enumerable(Colors::Color)

Returns the element with the maximum value in the collection.

It compares using > so it will work for any type that supports that method.

[1, 2, 3].max        # => 3
["Alice", "Bob"].max # => "Bob"

Raises Enumerable::EmptyError if the collection is empty.


def max=(max) #

def min : Int64 #
Description copied from module Enumerable(Colors::Color)

Returns the element with the minimum value in the collection.

It compares using < so it will work for any type that supports that method.

[1, 2, 3].min        # => 1
["Alice", "Bob"].min # => "Alice"

Raises Enumerable::EmptyError if the collection is empty.


def min=(min) #

def range : Range(Int64, Int64) #

def range=(range : Range(Int64, Int64)) #

def upto : Colors::ColorValue | UInt8 #

def upto=(upto) #