Class: Vedeu::Colours::Foreground

Inherits:
Translator show all
Defined in:
lib/vedeu/colours/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

Constructor Details

This class inherits a constructor from Vedeu::Colours::Translator

Instance Method Details

#named_codesString (private)

Returns:

  • (String)


14
15
16
# File 'lib/vedeu/colours/foreground.rb', line 14

def named_codes
  Vedeu::EscapeSequences::Esc.foreground_codes[colour]
end

#numbered_prefixString (private)

Returns:

  • (String)


19
20
21
# File 'lib/vedeu/colours/foreground.rb', line 19

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

#repositoryVedeu::Colours::Foregrounds (private)



24
25
26
# File 'lib/vedeu/colours/foreground.rb', line 24

def repository
  Vedeu.foreground_colours
end

#rgb_prefixString (private)

Returns:

  • (String)


29
30
31
# File 'lib/vedeu/colours/foreground.rb', line 29

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