Class: Vedeu::Foreground

Inherits:
Translator show all
Defined in:
lib/vedeu/output/foreground.rb

Overview

The class represents one half (the other, can be found at Background) of a terminal colour escape sequence.

Instance Method Summary collapse

Methods included from Coercions

#coerce, #coercer, included

Methods included from Common

#defined_value?, #to_sentence

Constructor Details

This class inherits a constructor from Vedeu::Translator

Instance Method Details

#named_codesString (private)

Returns:

  • (String)


15
16
17
# File 'lib/vedeu/output/foreground.rb', line 15

def named_codes
  Esc.foreground_codes[colour]
end

#numbered_prefixString (private)

Returns:

  • (String)


20
21
22
# File 'lib/vedeu/output/foreground.rb', line 20

def numbered_prefix
  "\e[38;5;"
end

#rgb_prefixString (private)

Returns:

  • (String)


25
26
27
# File 'lib/vedeu/output/foreground.rb', line 25

def rgb_prefix
  "\e[38;2;%s;%s;%sm"
end