Project

paintbrush

0.0
The project is in a healthy, maintained state
Provides a set of encapsulated methods for nested colorization of strings.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

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!" }

example

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.