Class: ColorConversion::HsvConverter

Inherits:
ColorConverter show all
Defined in:
lib/color_conversion/converters/hsv_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
9
# File 'lib/color_conversion/converters/hsv_converter.rb', line 4

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

  color.include?(:h) && color.include?(:s) && 
  ( color.include?(:v) || color.include?(:b) )
end