mikowitz / color

Home | Edit | New

Home

color

current version : 0.1.1

http://github.com/mikowitz/color

Description

A simple, flexible gem that provides an open-ended API to print colored and styled output in a terminal.

Usage examples

The following are all methods that Color understands, and should give you an idea of what is possible.

  • Color.blue("this will be printed as blue text")
  • Color.on_red("this will be printed on a red background")
  • Color.bold("this will be bold")
  • Color.underline_blue_on_yellow("this will be underlined blue text on a yellow background")

The order of elements in the method name is also unimportant. For example

Color.bold_underline_blue_on_yellow("This should be formatted the same as the line below")

will look the same as

Color.on_yellow_bold_blue_underline("This should be formatted the same as the line above")

Check out "spec/term_test.rb" and `rake proof` if you don’t believe me.

Copyright

Copyright © 2009 Michael Berkowitz. See LICENSE for details.

Last edited by mikowitz, Wed Oct 14 13:48:10 -0700 2009
Home | Edit | New
Versions: