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.



348
349
350
# File 'lib/highline.rb', line 348

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