- Defined in:
#color(string, *colors) ⇒ String
This method provides easy access to ANSI color sequences, without the user needing to remember to CLEAR at the end of each sequence. Just pass the string to color, followed by a list of colors you would like it to be affected by. The colors can be HighLine class constants, or symbols (:blue for BLUE, for example). A CLEAR will automatically be embedded to the end of the returned String.
This method returns the original string unchanged if use_color? is
321 322 323 324
# File 'lib/highline.rb', line 321 def color(string, *colors) return string unless use_color? HighLine.Style(*colors).color(string) end