Class: ColorCalculator::Conversion::XyzToLab
- Inherits:
-
Object
- Object
- ColorCalculator::Conversion::XyzToLab
- Extended by:
- ColorCalculator::Composable
- Defined in:
- lib/color_calculator/conversion/xyz_to_lab.rb
Constant Summary collapse
- APPLE =
-> (value) do value ** Rational(1, 3) end
- BANANA =
-> (value) do ((Constants::KAPPA * value) + 16) / 116 end
- FRUIT =
-> (value) do (value > Constants::EPSILON ? APPLE : BANANA).call(value) end
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(xyz) ⇒ XyzToLab
constructor
A new instance of XyzToLab.
Methods included from ColorCalculator::Composable
Constructor Details
#initialize(xyz) ⇒ XyzToLab
25 26 27 |
# File 'lib/color_calculator/conversion/xyz_to_lab.rb', line 25 def initialize(xyz) @xyz = xyz end |
Instance Method Details
#call ⇒ Object
29 30 31 |
# File 'lib/color_calculator/conversion/xyz_to_lab.rb', line 29 def call ColorCalculator::Clump::Lab.new(lightness, alpha, beta) end |