Class: ColorConversion::HslConverter

Inherits:
ColorConverter show all
Defined in:
lib/color_conversion/converters/hsl_converter.rb

Instance Attribute Summary

Attributes inherited from ColorConverter

#rgba

Class Method Summary collapse

Methods inherited from ColorConverter

#alpha, #cmyk, factory, #hex, #hsb, #hsl, #hsv, inherited, #initialize, #name, #rgb

Constructor Details

This class inherits a constructor from ColorConversion::ColorConverter

Class Method Details

.matches?(color) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
8
# File 'lib/color_conversion/converters/hsl_converter.rb', line 4

def self.matches?(color)
  return false unless color.kind_of?(Hash)

  color.include?(:h) && color.include?(:s) && color.include?(:l)
end