Module: Spyglass::ColorSpace

Defined in:
lib/spyglass/color_space.rb

Class Method Summary collapse

Class Method Details

.[](mapping) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/spyglass/color_space.rb', line 3

def self.[](mapping)
  code = mapping.to_a.join("_TO_").upcase
  if !const_defined?(code)
    raise ArgumentError.new("color conversion not available")
  end

  const_get(code.upcase)
end