Class: Abachrome::Converters::SrgbToOklch

Inherits:
Base
  • Object
show all
Defined in:
lib/abachrome/converters/srgb_to_oklch.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(srgb_color) ⇒ Abachrome::Color

Note:

This is a two-step conversion process: first from sRGB to OKLab, then from OKLab to OKLCH

Converts an sRGB color to OKLCH color space

Parameters:

Returns:

See Also:



34
35
36
37
38
39
40
# File 'lib/abachrome/converters/srgb_to_oklch.rb', line 34

def self.convert(srgb_color)
  # First convert sRGB to OKLab
  oklab_color = SrgbToOklab.convert(srgb_color)
  
  # Then convert OKLab to OKLCh
  OklabToOklch.convert(oklab_color)
end