Method: HighLine.add_to_color_scheme

Defined in:
lib/highline.rb

.add_to_color_scheme(hash) ⇒ Object

Pass a Hash to add new colors to the current scheme.

[View source]

65
66
67
68
69
70
# File 'lib/highline.rb', line 65

def add_to_color_scheme(hash)
  old_hash = (color_scheme || {}).to_hash
  fail "Overlapping color schemes: #{old_hash.keys & hash.keys}"  unless
    (old_hash.keys & hash.keys).empty?
  self.color_scheme = ColorScheme.new(old_hash.merge hash)
end