On Sun, Dec 4, 2011 at 1:00 PM, Kazuyoshi Tlacaelel <kazu.dev / gmail.com> wrote:
>
> Alternatively you can use isna which has simpler approach.
>
> https://github.com/ktlacaelel/isna
>
> puts "Hello World".to_ansi.red
> puts "Hello World".to_ansi.underline.blue
> [...]

There's also my "Col" library, created when I wanted efficient control
over terminal colors without busting into core classes.

https://github.com/gsinclair/col

    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, :on_white]
    puts Col("Hello ", "world!").fmt "_b,ciow"

    puts Col("Hello ", "world!").fmt [:blue, :on_yellow], [:on_green]
    puts Col("Hello ", "world!").fmt "b_oy,__og"

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

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

Gavin