Class: Vedeu::ColourTranslator
- Inherits:
-
Object
- Object
- Vedeu::ColourTranslator
- Defined in:
- lib/vedeu/models/attributes/colour_translator.rb
Instance Method Summary collapse
- #background ⇒ Object
- #foreground ⇒ Object
-
#initialize(html_colour = '') ⇒ ColourTranslator
constructor
A new instance of ColourTranslator.
Constructor Details
#initialize(html_colour = '') ⇒ ColourTranslator
3 4 5 |
# File 'lib/vedeu/models/attributes/colour_translator.rb', line 3 def initialize(html_colour = '') @html_colour = html_colour end |
Instance Method Details
#background ⇒ Object
7 8 9 10 11 |
# File 'lib/vedeu/models/attributes/colour_translator.rb', line 7 def background return '' unless valid? ["\e[48;5;", translate, 'm'].join end |
#foreground ⇒ Object
13 14 15 16 17 |
# File 'lib/vedeu/models/attributes/colour_translator.rb', line 13 def foreground return '' unless valid? ["\e[38;5;", translate, 'm'].join end |