Module: Mack::Utils::Ansi::Color

Defined in:
lib/mack/utils/ansi/ansi_color.rb

Class Method Summary collapse

Class Method Details

.wrap(color, string) ⇒ Object



7
8
9
10
11
12
# File 'lib/mack/utils/ansi/ansi_color.rb', line 7

def self.wrap(color, string)
  if configatron.mack.log.use_colors
    return "\e[#{[Mack::Utils::Ansi::ColorRegistry.registered_items[color.to_sym] || 0].flatten.first}m#{string}\e[0m"
  end
  return string
end