Module: HighLine::BuiltinStyles

Included in:
HighLine
Defined in:
lib/highline/builtin_styles.rb

Overview

Builtin Styles that are included at HighLine initialization. It has the basic styles like :bold and :underline.

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

STYLE_LIST =

Basic styles’ ANSI escape codes like :bold => “e[1m”

{
  erase_line: "\e[K",
  erase_char: "\e[P",
  clear:      "\e[0m",
  reset:      "\e[0m",
  bold:       "\e[1m",
  dark:       "\e[2m",
  underline:  "\e[4m",
  underscore: "\e[4m",
  blink:      "\e[5m",
  reverse:    "\e[7m",
  concealed:  "\e[8m"
}.freeze
STYLES =

Basic Style names like CLEAR, BOLD, UNDERLINE

%w[CLEAR RESET BOLD DARK UNDERLINE
UNDERSCORE BLINK REVERSE CONCEALED].freeze
COLOR_LIST =

A Hash with the basic colors an their ANSI escape codes.

{
  black:   { code: "\e[30m", rgb: [0, 0, 0] },
  red:     { code: "\e[31m", rgb: [128, 0, 0] },
  green:   { code: "\e[32m", rgb: [0, 128, 0] },
  blue:    { code: "\e[34m", rgb: [0, 0, 128] },
  yellow:  { code: "\e[33m", rgb: [128, 128, 0] },
  magenta: { code: "\e[35m", rgb: [128, 0, 128] },
  cyan:    { code: "\e[36m", rgb: [0, 128, 128] },
  white:   { code: "\e[37m", rgb: [192, 192, 192] },
  gray:    { code: "\e[37m", rgb: [192, 192, 192] },
  grey:    { code: "\e[37m", rgb: [192, 192, 192] },
  none:    { code: "\e[38m", rgb: [0, 0, 0] }
}.freeze
BASIC_COLORS =

The builtin styles basic colors like black, red, green.

%w[BLACK RED GREEN YELLOW BLUE
MAGENTA CYAN WHITE GRAY GREY NONE].freeze
COLORS =

The builtin styles’ colors like LIGHT_RED and BRIGHT_BLUE.

colors

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Included callback

Parameters:

  • base (Class, Module)

    base class



9
10
11
# File 'lib/highline/builtin_styles.rb', line 9

def self.included(base)
  base.extend ClassMethods
end