Class: Abachrome::Converters::LmsToSrgb
- Defined in:
- lib/abachrome/converters/lms_to_srgb.rb
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.convert(lms_color) ⇒ Abachrome::Color
Converts a color from LMS 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(lms_color) ⇒ Abachrome::Color
Converts a color from LMS color space to sRGB color space.
This method implements a two-step conversion process:
-
First converts from LMS to linear RGB using the standard transformation matrix
-
Then converts from linear RGB to sRGB by applying gamma correction
the same alpha as the input color
14 15 16 17 18 19 20 |
# File 'lib/abachrome/converters/lms_to_srgb.rb', line 14 def self.convert(lms_color) # First convert LMS to linear RGB lrgb_color = LmsToLrgb.convert(lms_color) # Then convert linear RGB to sRGB LrgbToSrgb.convert(lrgb_color) end |