struct
Crame::Color
- Crame::Color
- Struct
- Value
- Object
Overview
A color in RGBA format.
Defined in:
crame/color.crConstructors
-
.new(r : Float64, g : Float64, b : Float64, a : Float64 = 1.0)
Create a color given its component.
-
.new
Create a color with all its component (except alpha) to 0.
Instance Method Summary
-
#a : Float64
The alpha component.
-
#a=(value : Float64)
The alpha component.
-
#b : Float64
The blue component.
-
#b=(value : Float64)
The blue component.
-
#blend(other : Color) : Color
Returns
selfblended withother. -
#darkened(amount : Float64) : Color
Returns the dark version of
selfby a specificamount. -
#g : Float64
The green component.
-
#g=(value : Float64)
The green component.
-
#inverted : Color
Returns the inverted version of
self. -
#lightened(amount : Float64) : Color
Returns the light version of
selfby a specificamount. -
#r : Float64
The red component.
-
#r=(value : Float64)
The red component.
-
#to_s(io : IO)
Same as
#inspect(io).
Constructor Detail
def self.new(r : Float64, g : Float64, b : Float64, a : Float64 = 1.0)
#
Create a color given its component.