Class: Colorful

Inherits:
Object
  • Object
show all
Defined in:
lib/webget_ruby_colorful.rb

Constant Summary collapse

COLORS =

These color names are good examples because they are:

  • one word

  • definitely a color (cf. “rose” is also a flower)

  • not white or black

[
    'Red','Orange','Yellow','Green','Blue','Indigo','Violet',
    'Cyan','Magenta','Pink','Purple','Brown',
    'Gold','Silver','Bronze','Copper','Platinum',
    'Aquamarine','Azure','Beige','Cerulean',
    'Chartreuse','Crimson','Fucshia','Khaki',
    'Maroon','Mauve','Scarlet','Sepia',
    'Sienna','Tan','Teal','Turquoise'
]
SHADES =

These shade names are good examples because they are:

  • one word

  • independent of whatever color word is chosen

['Brilliant', 'Bright', 'Dark', 'Deep', 'Light', 'Moderate', 'Pale', 'Vivid']

Class Method Summary collapse

Class Method Details

.choiceObject



69
70
71
# File 'lib/webget_ruby_colorful.rb', line 69

def self.choice
  SHADES[rand*SHADES.length] + ' ' + COLORS[rand*COLORS.length]
end

.colorsObject



61
62
63
# File 'lib/webget_ruby_colorful.rb', line 61

def self.colors
  COLORS
end

.shadesObject



65
66
67
# File 'lib/webget_ruby_colorful.rb', line 65

def self.shades
  SHADES
end