Class: Vedeu::Background
- Inherits:
-
ColourTranslator
- Object
- ColourTranslator
- Vedeu::Background
- Defined in:
- lib/vedeu/models/attributes/background.rb
Instance Attribute Summary
Attributes inherited from ColourTranslator
Instance Method Summary collapse
- #background_codes ⇒ Hash private private
- #named ⇒ String private private
- #numbered ⇒ String private private
- #rgb ⇒ String private private
Methods inherited from ColourTranslator
#blue, #codes, #css_to_numbered, #css_to_rgb, #escape_sequence, escape_sequence, #green, #initialize, #named?, #no_colour?, #numbered?, #red, #rgb?, #valid_name?, #valid_range?, #valid_rgb?
Constructor Details
This class inherits a constructor from Vedeu::ColourTranslator
Instance Method Details
#background_codes ⇒ Hash (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
32 33 34 |
# File 'lib/vedeu/models/attributes/background.rb', line 32 def background_codes codes.inject({}){ |h, (k, v)| h.merge(k => v + 10) } end |
#named ⇒ String (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/vedeu/models/attributes/background.rb', line 8 def named ["\e[", background_codes[colour], "m"].join end |
#numbered ⇒ String (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 15 16 |
# File 'lib/vedeu/models/attributes/background.rb', line 14 def numbered ["\e[48;5;", css_to_numbered, "m"].join end |
#rgb ⇒ String (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 23 24 25 26 27 28 |
# File 'lib/vedeu/models/attributes/background.rb', line 20 def rgb if Configuration.colour_mode == 16777216 sprintf("\e[48;2;%s;%s;%sm", *css_to_rgb) else numbered end end |