module Colors::NamedColors

Constants

MAPPING

Public Class Methods

[](name) click to toggle source
# File lib/colors/named_colors.rb, line 86
def self.[](name)
  MAPPING[name]
end
nth_color?(name) click to toggle source

Return whether `name` is an item in the color cycle.

# File lib/colors/named_colors.rb, line 91
def self.nth_color?(name)
  case name
  when String
    # do nothing
  when Symbol
    name = name.to_s
  else
    return false unless name.respond_to?(:to_str)
    name = name.to_str
  end
  name.match?(/\AC\d+\z/)
end