Sha256: 28e2b3aef9ff5b67e589e7323b35c23e3d27933bf93c876096e83ef80c700d6b

Contents?: true

Size: 265 Bytes

Versions: 6

Compression:

Stored size: 265 Bytes

Contents

# String#colorize

# Extend `String` to include some fancy colors
class String
  def colorize(c); "\e[#{c}m#{self}\e[0m" end
  def bold;  colorize('1')    end
  def info;  colorize('1;34') end
  def warn;  colorize('1;33') end
  def error; colorize('1;31') end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby2d-0.9.2 lib/ruby2d/colorize.rb
ruby2d-0.9.1 lib/ruby2d/colorize.rb
ruby2d-0.9.0 lib/ruby2d/colorize.rb
ruby2d-0.8.1 lib/ruby2d/colorize.rb
ruby2d-0.8.0 lib/ruby2d/colorize.rb
ruby2d-0.7.0 lib/ruby2d/colorize.rb