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

Discussion in 'Ruby' started by Gavin Sinclair, Jul 25, 2010.

  1. 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)
    Gavin Sinclair, Jul 25, 2010
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wolfgang
    Replies:
    3
    Views:
    458
    Marco Schmidt
    Feb 7, 2004
  2. pabbu
    Replies:
    8
    Views:
    721
    Marc Boyer
    Nov 7, 2005
  3. Scorpiion
    Replies:
    1
    Views:
    1,346
    Scorpiion
    Dec 25, 2008
  4. Nathan Rice
    Replies:
    3
    Views:
    289
    Nathan Rice
    Jul 17, 2010
  5. Replies:
    8
    Views:
    208
    Eric Sosman
    Apr 20, 2013
Loading...

Share This Page