Class: Abachrome::Converters::OklchToSrgb
- Defined in:
- lib/abachrome/converters/oklch_to_srgb.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 sRGB 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 sRGB color space. This is done by first converting from OKLCH to OKLAB, then from OKLAB to sRGB.
35 36 37 38 39 40 41 |
# File 'lib/abachrome/converters/oklch_to_srgb.rb', line 35 def self.convert(oklch_color) # Convert OKLCh to OKLab first oklab_color = OklchToOklab.convert(oklch_color) # Then convert OKLab to sRGB OklabToSrgb.convert(oklab_color) end |