module Grably::ShellColors

Contains escape symbols for colors representation in *nix shells. If used adds coloring methods to String object. This module is intendet to be included in String class

Constants

COLOR_RESET

Color code sequence which resets colors to default state. Which is normal (0), default (39) and bg_default (49)

Public Class Methods

color(*args) click to toggle source

Generates color codes sequence to create color effect @param [String | Symbol] args color settigns @return [String] color control sequence

# File lib/grably/core/colors.rb, line 41
def color(*args)
  codes = args.map { |a| COLOR_CODES[a.to_sym] }.compact
  "\e[#{codes.join(';')}m"
end

Public Instance Methods

color(*args) click to toggle source
# File lib/grably/core/colors.rb, line 51
def color(*args)
  Grably::ShellColors.color(*args)
end