Color in p and puts method!
Colorputs provides a beatiful color (and format) printing for Ruby console-based applications
gem install colorputs
p 'Hello world!', :red
Will print out "Hello world!" colored in red.
p 'Hello world!', :_bl
Will print out a blinking "Hello world!".
In addition, it's possible to combine both color and mode (for now, only one of each) and if some of them are mispelled, Colorputs will try to parse the another part if this one is well-spelled. Examples:
p 'Hello world!', :blue_u
Will print out an underlined "Hello world!" colored in blue.
p 'Hello world!', :wrong_r
Will not print out the "Hello world!" message colored, but reversed. Same behavior in the opposite case (correct color, wrong format mode)
Symbol | Color |
---|---|
:red | Red |
:blue | Blue |
:green | Green |
:yellow | Yellow |
:cyan | Cyan |
:magenta | Magenta |
:white | White |
:black | Black |
:rainbow | Rainbow colors! |
Symbol | Mode |
---|---|
:_b | Bold |
:_u | Underlined |
:_bl | Blinked |
:_r | Reversed |
- Fork it.
- Create your feature branch (
git checkout -b my-new-feature
). - Commit your changes (
git commit -am 'Add some feature'
). - Push to the branch (
git push origin my-new-feature
). - Create new Pull Request.