[Ann] Col 1.0.0 -- high-level console color library

G

Gavin Sinclair

col: high-level console color formatting for Ruby

If you want a dash of color in your Ruby console program, use Term::ANSIColor.
If your color formatting requirements are more complicated, use Col.
Col provides as much convenience as possible without modifying builtin classes.

Synopsis

require 'col'

puts Col("Hello world!").red.bold
puts Col("Hello world!").rb
puts Col("Hello world!").fmt [:red, :bold]
puts Col("Hello world!").fmt :rb

puts Col("Hello ", "world!").fmt :red, :green
puts Col("Hello ", "world!").fmt "r,g"

puts Col("Hello ", "world!").fmt [:red, :bold], [:green, :bold]
puts Col("Hello ", "world!").fmt "rb,gb"

puts Col("Hello ", "world!").fmt [:bold], [:cyan, :italic, :eek:n_white]
puts Col("Hello ", "world!").fmt "_b,ciow"

puts Col("Hello ", "world!").fmt [:blue, :eek:n_yellow], [:eek:n_green]
puts Col("Hello ", "world!").fmt "b_oy,__og"

puts Col.inline( "Hello ", :red, "world!", :blue )

puts Col.inline(
"Hello ", [:red, :bold, :eek:n_white],
"world!", :b_oy
)

See http://gsinclair.github.com/col.html for full details.

(Installation: gem install col)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top