Class: Vedeu::Background

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

Overview

The class represents one half (the other, can be found at Foreground) 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)


11
12
13
# File 'lib/vedeu/output/background.rb', line 11

def named_codes
  Esc.background_codes[colour]
end

#numbered_prefixString (private)

Returns:

  • (String)


16
17
18
# File 'lib/vedeu/output/background.rb', line 16

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

#rgb_prefixString (private)

Returns:

  • (String)


21
22
23
# File 'lib/vedeu/output/background.rb', line 21

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