Class: Abachrome::Converters::OklchToLms
- Defined in:
- lib/abachrome/converters/oklch_to_lms.rb
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.convert(oklch_color) ⇒ Abachrome::Color
Converts a color from OKLCH color space to LMS 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(oklch_color) ⇒ Abachrome::Color
Converts a color from OKLCH color space to LMS color space.
This method converts OKLCH to OKLAB first, then to LMS. The OKLCH color space is a cylindrical representation of OKLAB using lightness, chroma, and hue.
the same alpha as the input color
15 16 17 18 19 20 21 22 23 |
# File 'lib/abachrome/converters/oklch_to_lms.rb', line 15 def self.convert(oklch_color) raise_unless oklch_color, :oklch # Convert OKLCH to OKLAB first oklab_color = Converters::OklchToOklab.convert(oklch_color) # Then convert OKLAB to LMS Converters::OklabToLms.convert(oklab_color) end |