class Colors::Gradient
- Colors::Gradient
- Reference
- Object
Included Modules
- Enumerable(Colors::Color)
Defined in:
colors/gradient.crConstructors
- .new(low_color : ValidColor = :red, high_color : ValidColor = :green, from : ColorValue | UInt8 = ColorValue.off, upto : ColorValue | UInt8 = ColorValue.full, max = 100_i64)
- .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 Summary
- #[](val) : Color
- #check_colors
-
#each(&)
Must yield this collection's elements to the block.
- #from : Colors::ColorValue | UInt8
- #from=(from)
- #high_color : Colors::ValidColor
- #low_color : Colors::ValidColor
-
#max : Int64
Returns the element with the maximum value in the collection.
- #max=(max)
-
#min : Int64
Returns the element with the minimum value in the collection.
- #min=(min)
- #range : Range(Int64, Int64)
- #range=(range : Range(Int64, Int64))
- #upto : Colors::ColorValue | UInt8
- #upto=(upto)
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 each(&)
#
Description copied from module Enumerable(Colors::Color)
Must yield this collection's elements to the block.
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 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.