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 : Int64 = 100_i64) #

[View source]
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) #

[View source]

Instance Method Detail

def [](val) : Color #

[View source]
def check_colors #

[View source]
def each(&) #
Description copied from module Enumerable(Colors::Color)

Must yield this collection's elements to the block.


[View source]
def from : Colors::ColorValue | UInt8 #

[View source]
def from=(from : Colors::ColorValue | UInt8) #

[View source]
def high_color : Colors::ValidColor #

[View source]
def low_color : Colors::ValidColor #

[View source]
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.


[View source]
def max=(max : Int64) #

[View source]
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.


[View source]
def min=(min : Int64) #

[View source]
def range : Range(Int64, Int64) #

[View source]
def range=(range : Range(Int64, Int64)) #

[View source]
def upto : Colors::ColorValue | UInt8 #

[View source]
def upto=(upto : Colors::ColorValue | UInt8) #

[View source]