Module: Colors

Defined in:
lib/paintbucket/paintbucket.rb

Instance Method Summary collapse

Instance Method Details

#colorize(text, color_code) ⇒ Object



4
5
6
# File 'lib/paintbucket/paintbucket.rb', line 4

def colorize(text, color_code)
  "\033[#{color_code}m#{text}\033[0m"
end

#dividerObject



38
39
40
# File 'lib/paintbucket/paintbucket.rb', line 38

def divider
  puts "\n#{cyan("=================================")}"
end

#error(msg) ⇒ Object



30
31
32
# File 'lib/paintbucket/paintbucket.rb', line 30

def error(msg)
  puts "\n#{colorize("#{msg}", 31)}"
end

#hint(msg) ⇒ Object



22
23
24
# File 'lib/paintbucket/paintbucket.rb', line 22

def hint(msg)
  puts black("   #{msg}")
end

#message(msg) ⇒ Object



42
43
44
# File 'lib/paintbucket/paintbucket.rb', line 42

def message(msg)
  puts "\n#{cyan(msg)}\n\n"
end

#success(msg) ⇒ Object



34
35
36
# File 'lib/paintbucket/paintbucket.rb', line 34

def success(msg)
  puts "\n#{colorize("#{msg}", 32)}"
end

#warn(msg) ⇒ Object



26
27
28
# File 'lib/paintbucket/paintbucket.rb', line 26

def warn(msg)
  puts yellow("" + msg)
end