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!" }Add Paintbrush to your Gemfile:
gem 'paintbrush'Build your bundle:
bundle installSee the Official Documentation for examples and configuration options.
Paintbrush is released under the MIT License.
