Class: ColorConverters::HslConverter
- Inherits:
-
BaseConverter
- Object
- BaseConverter
- ColorConverters::HslConverter
- Defined in:
- lib/color_converters/converters/hsl_converter.rb
Constant Summary
Constants inherited from BaseConverter
BaseConverter::IMPORT_DP, BaseConverter::OUTPUT_DP
Instance Attribute Summary
Attributes inherited from BaseConverter
Class Method Summary collapse
Methods inherited from BaseConverter
#alpha, #cielab, #cielch, #cmyk, factory, #hex, #hsb, #hsl, #hsv, inherited, #initialize, #name, #oklab, #oklch, #rgb, #xyz
Constructor Details
This class inherits a constructor from ColorConverters::BaseConverter
Class Method Details
.bounds ⇒ Object
11 12 13 |
# File 'lib/color_converters/converters/hsl_converter.rb', line 11 def self.bounds { h: [0.0, 360.0], s: [0.0, 100.0], l: [0.0, 100.0], a: [0.0, 1.0] } end |
.matches?(colour_input) ⇒ Boolean
5 6 7 8 9 |
# File 'lib/color_converters/converters/hsl_converter.rb', line 5 def self.matches?(colour_input) return false unless colour_input.is_a?(Hash) colour_input.keys - [:h, :s, :l] == [] || colour_input.keys - [:h, :s, :l, :a] == [] end |