Class: Abachrome::Converters::OklchToSrgb

Inherits:
Base
  • Object
show all
Defined in:
lib/abachrome/converters/oklch_to_srgb.rb

Instance Attribute Summary

Attributes inherited from Base

#from_space, #to_space

Class Method Summary collapse

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.

Parameters:

Returns:



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