Class: Abachrome::Converters::OklabToXyz
- Defined in:
- lib/abachrome/converters/oklab_to_xyz.rb
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.convert(oklab_color) ⇒ Abachrome::Color
Converts a color from OKLAB color space to XYZ color space.
Methods inherited from Base
#can_convert?, #convert, find_converter, #initialize, raise_unless, register
Constructor Details
This class inherits a constructor from Abachrome::Converters::Base
Class Method Details
.convert(oklab_color) ⇒ Abachrome::Color
Converts a color from OKLAB color space to XYZ color space.
This method converts OKLAB to LMS first, then to XYZ. The OKLAB color space is a perceptually uniform color space, and XYZ is the CIE 1931 color space that forms the basis for most other color space definitions.
the same alpha as the input color
16 17 18 19 20 21 22 23 24 |
# File 'lib/abachrome/converters/oklab_to_xyz.rb', line 16 def self.convert(oklab_color) raise_unless oklab_color, :oklab # Convert OKLAB to LMS first lms_color = Converters::OklabToLms.convert(oklab_color) # Then convert LMS to XYZ Converters::LmsToXyz.convert(lms_color) end |