Introducing the paint gem

require 'paint'
puts Paint['J-_-L', :red] # J-_-L
puts Paint['J-_-L', :green]
puts Paint['Ruby', :red, :blue]    # the second color you define is for background
puts Paint['Ruby', :underline]
puts Paint['Ruby', "#123"] # html hex colour
puts Paint['Ruby', "123"]  # html hex colour

# didn't see any difference on Ubuntu 9.10
Paint['Ruby', :italic, :encircle, :rapid_blink, :overline] # probably not supported effects

The paint gem primarily forces text on the command-line to be printed in colour.

Resources: - janlelis/paint - GitHub [github.com]

Tags:
Source:
1209hrs.txt
Published:
12-12-2011 12:09