Sha256: b75f5de76a1b1aed5721d8705f429c23ecb67816b891cebaf832ee2220274499

Contents?: true

Size: 262 Bytes

Versions: 6

Compression:

Stored size: 262 Bytes

Contents

module Spyglass
  module ColorSpace
    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
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spyglass-0.0.5.1 lib/spyglass/color_space.rb
spyglass-0.0.5 lib/spyglass/color_space.rb
spyglass-0.0.4.1 lib/spyglass/color_space.rb
spyglass-0.0.4 lib/spyglass/color_space.rb
spyglass-0.0.3 lib/spyglass/color_space.rb
spyglass-0.0.2 lib/spyglass/color_space.rb