Module: Lexdrill::Colorizer
- Defined in:
- lib/lexdrill/colorizer.rb
Overview
Wraps text in a randomly-picked ANSI color code from a fixed palette.
Constant Summary collapse
- CODES =
[31, 32, 33, 34, 35, 36, 91, 92, 93, 94, 95, 96].freeze
Class Method Summary collapse
Class Method Details
.paint(text) ⇒ Object
7 8 9 |
# File 'lib/lexdrill/colorizer.rb', line 7 def self.paint(text) "\e[#{CODES.sample}m#{text}\e[0m" end |