struct Color
- Color
- Struct
- Value
- Object
Defined in:
color.crConstant Summary
-
BLACK =
self.new(0.0)
-
COMPONENTS =
[:r, :g, :b]
-
WHITE =
self.new(1.0)
Constructors
Class Method Summary
- .b
- .from_hex(hex)
- .from_rgba(rgba : StumpyPNG::RGBA)
- .g
- .one
-
.r
Generate some utility constants like
Vector3::Y => Vector3(0.0, 1.0, 0.0)
- .zero
Instance Method Summary
- #*(other : self)
- #*(other : Float64)
- #**(other : Float64)
- #+(other : self)
- #-(other : self)
- #-
- #/(other : Float64)
- #b : Float64
- #b=(b : Float64)
- #black?
- #de_nan
- #dot(other : self)
- #g : Float64
- #g=(g : Float64)
- #inspect
- #length
- #max_component
- #min(other : Float64)
- #mix(other : Color, t : Float64)
-
#normalize
If the vector has just one component precalculating the inverse would not improve the performance TODO: validate if precalculating is faster for 2 components
- #r : Float64
- #r=(r : Float64)
- #squared_length
- #to_rgba(gamma_correction = 1.0)
Constructor Detail
Class Method Detail
Instance Method Detail
def normalize
#
If the vector has just one component precalculating the inverse would not improve the performance
TODO validate if precalculating is faster for 2 components