Light Mode Dark Mode

Nested Colors

Paintbrush supports unlimited levels of nesting, allowing you to use one color inside another color and have the text revert back to its previous color. This lets you create complex colorized strings without having to revert back manually.

subject do
  paintbrush do
    green "green, #{blue "blue, #{cyan "cyan #{yellow "and yellow"}, back to cyan"}, back to blue"}, and back to green"

it { include "and yellow" }
green, blue, cyan and yellow, back to cyan, back to blue, and back to green

Documentation generated by rspec-documentation