Inherit from Thor::Shell::Basic and add set_color behavior. Check Thor::Shell::Basic to see all available methods.
Set the terminal's foreground ANSI color to black.
Set the terminal's foreground ANSI color to blue.
The start of an ANSI bold sequence.
Embed in a String to clear all previous ANSI sequences.
Set the terminal's foreground ANSI color to cyan.
Set the terminal's foreground ANSI color to green.
Set the terminal's foreground ANSI color to magenta.
Set the terminal's background ANSI color to black.
Set the terminal's background ANSI color to blue.
Set the terminal's background ANSI color to cyan.
Set the terminal's background ANSI color to green.
Set the terminal's background ANSI color to magenta.
Set the terminal's background ANSI color to red.
Set the terminal's background ANSI color to white.
Set the terminal's background ANSI color to yellow.
Set the terminal's foreground ANSI color to red.
Set the terminal's foreground ANSI color to white.
Set the terminal's foreground ANSI color to yellow.
Set color by using a string or one of the defined constants. If a third option is set to true, it also adds bold to the string. This is based on Highline implementation and it automatically appends CLEAR to the end of the returned String.
# File lib/thor/shell/color.rb, line 53 def set_color(string, color, bold=false) color = self.class.const_get(color.to_s.upcase) if color.is_a?(Symbol) bold = bold ? BOLD : "" "#{bold}#{color}#{string}#{CLEAR}" end
Generated with the Darkfish Rdoc Generator 2.