Class: Abachrome::ColorModels::YIQ

Inherits:
Object
  • Object
show all
Defined in:
lib/abachrome/color_models/yiq.rb

Class Method Summary collapse

Class Method Details

.normalize(y, i, q) ⇒ Array<AbcDecimal>

Normalizes YIQ color component values to their standard ranges.

Parameters:

  • y (Numeric)

    Luma component (brightness), typically in range [0,1]

  • i (Numeric)

    In-phase component (orange-blue), typically in range [-0.5957, 0.5957]

  • q (Numeric)

    Quadrature component (purple-green), typically in range [-0.5226, 0.5226]

Returns:

  • (Array<AbcDecimal>)

    Array of three normalized components as AbcDecimal objects



31
32
33
# File 'lib/abachrome/color_models/yiq.rb', line 31

def normalize(y, i, q)
  [y, i, q].map { |value| AbcDecimal(value) }
end