module NoTBJ::Color

Public Instance Methods

blue() click to toggle source
# File lib/no_tbj/color.rb, line 11
def blue
  colorize(94)
end
Also aliased as: info
colorize(color_code) click to toggle source
# File lib/no_tbj/color.rb, line 29
def colorize(color_code)
  if color_code == 90
    bright = 37
  else
    bright = color_code + 60
  end
  "\033[#{color_code}m#{self}\033[0m".gsub(/\{(.*?)\}/) { |m| "\033[#{bright}m#{$1}\033[#{color_code}m" }
end
error()
Alias for: red
gray() click to toggle source
# File lib/no_tbj/color.rb, line 19
def gray
  colorize(37)
end
Also aliased as: minfo
green() click to toggle source
# File lib/no_tbj/color.rb, line 7
def green
  colorize(32)
end
Also aliased as: success
info()
Alias for: blue
minfo()
Alias for: gray
red() click to toggle source
# File lib/no_tbj/color.rb, line 3
def red
  colorize(31)
end
Also aliased as: error
success()
Alias for: green
warn()
Alias for: yellow
yellow() click to toggle source
# File lib/no_tbj/color.rb, line 15
def yellow
  colorize(33)
end
Also aliased as: warn