# ansi_color Add some simple methods that allow you to colourise and style your Strings with lovely Ruby syntactic sugar. ## Contributors [Kacper Cieśla][comboy] improved print and puts loads with this [commit](http://github.com/comboy/ansi_color/commit/a66e3baf47aef2d3d60495c65a6a83153e7fa688). Thanks for your contributions [Kacper][comboy]! ## Examples require 'rubygems' require 'ansi_color' AnsiColor.print('plain string') # => "plain string" AnsiColor.puts('plain string') # => "plain string\n" AnsiColor.print('coloured string', :color => :red, :background => :black, :effects => [:blink, :bold]) # => "\e[31;40;5;1mcoloured string\e[0m" AnsiColor.puts('coloured string', :color => :red, :background => :black, :effects => [:blink, :bold]) # => "\e[31;40;5;1mcoloured string\e[0m\n" AnsiColor.red # => 31 AnsiColor.red_background # => 41 AnsiColor.blink # => 5 ## Adding colour methods to String ### This doesn't work properly! Chaining methods works but isn't particularly ingenious. require 'rubygems' require 'ansi_color' class String include AnsiColor::String end 'coloured string'.red.bold.blink # => "\e[5m\e[1m\e[31mcoloured string\e[0m\e[0m\e[0m" [jcf]: http://github.com/jcf [comboy]: http://github.com/comboy