Method: HighLine#color_code

Defined in:
lib/highline.rb

#color_code(*colors) ⇒ String

In case you just want the color code, without the embedding and the CLEAR sequence.

Examples:

s = HighLine.Style(:red, :blue)
s.code # => "\e[31m\e[34m"

HighLine.color_code(:red, :blue) # => "\e[31m\e[34m"

cli = HighLine.new
cli.color_code(:red, :blue) # => "\e[31m\e[34m"

Parameters:

  • colors (Array<Symbol>)

Returns:

  • (String)

    ANSI escape code for the given colors.



340
341
342
# File 'lib/highline.rb', line 340

def color_code(*colors)
  HighLine.Style(*colors).code
end