Paintbrush
Simple and concise string colorization for Ruby without overloading String
methods or requiring verbose class/method invocation.
Paintbrush has zero dependencies and does not pollute any namespaces or objects outside of the #paintbrush
method wherever you include the Paintbrush
module.
Nesting is supported, allowing you to use multiple colors within the same string. The previous color is automatically restored.
include Paintbrush
puts paintbrush { purple "You used #{green 'four'} #{blue "(#{cyan '4'})"} #{yellow 'colors'} today!" }
Installation
Add Paintbrush to your Gemfile
:
gem 'paintbrush'
Build your bundle:
bundle install
Documentation
See the Official Documentation for examples and configuration options.
License
Paintbrush is released under the MIT License.