Module: ExAequo::Color::Colorizer
Constant Summary collapse
- ColorMethodKeywords =
{ ansi: nil, ansi256: nil, rgb: nil, web: nil }.freeze
- StyleKeywords =
{ bold: nil, dim: nil, italic: nil, underline: nil }.freeze
- ColorizeKeywords =
ColorMethodKeywords.merge(StyleKeywords).merge(reset: true)
Instance Method Summary collapse
Instance Method Details
#colorize(text, **kwds) ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ex_aequo/color/colorizer.rb', line 24 def colorize(text, **kwds) kwds = ColorizeKeywords.merge(kwds) _check_args!(kwds) [ _color_code(**kwds), text, _maybe_reset(kwds[:reset]) ].join end |