Module: Vt100::DisplayAttributes
- Included in:
- Vt100
- Defined in:
- lib/vt100/display_attributes.rb
Instance Method Summary collapse
- #bg_black(txt) ⇒ Object
- #bg_blue(txt) ⇒ Object
- #bg_cyan(txt) ⇒ Object
- #bg_green(txt) ⇒ Object
- #bg_magenta(txt) ⇒ Object
- #bg_red(txt) ⇒ Object
- #bg_white(txt) ⇒ Object
- #bg_yellow(txt) ⇒ Object
- #bright(txt) ⇒ Object
- #display_attr_esc(attr, txt) ⇒ Object
- #fg_black(txt) ⇒ Object
- #fg_blue(txt) ⇒ Object
- #fg_cyan(txt) ⇒ Object
- #fg_green(txt) ⇒ Object
- #fg_magenta(txt) ⇒ Object
- #fg_red(txt) ⇒ Object
- #fg_white(txt) ⇒ Object
- #fg_yellow(txt) ⇒ Object
- #hidden(txt) ⇒ Object
- #underscore(txt) ⇒ Object
Instance Method Details
#bg_black(txt) ⇒ Object
53 54 55 |
# File 'lib/vt100/display_attributes.rb', line 53 def bg_black(txt) display_attr_esc 40, txt end |
#bg_blue(txt) ⇒ Object
69 70 71 |
# File 'lib/vt100/display_attributes.rb', line 69 def bg_blue(txt) display_attr_esc 44, txt end |
#bg_cyan(txt) ⇒ Object
77 78 79 |
# File 'lib/vt100/display_attributes.rb', line 77 def bg_cyan(txt) display_attr_esc 46, txt end |
#bg_green(txt) ⇒ Object
61 62 63 |
# File 'lib/vt100/display_attributes.rb', line 61 def bg_green(txt) display_attr_esc 42, txt end |
#bg_magenta(txt) ⇒ Object
73 74 75 |
# File 'lib/vt100/display_attributes.rb', line 73 def bg_magenta(txt) display_attr_esc 45, txt end |
#bg_red(txt) ⇒ Object
57 58 59 |
# File 'lib/vt100/display_attributes.rb', line 57 def bg_red(txt) display_attr_esc 41, txt end |
#bg_white(txt) ⇒ Object
81 82 83 |
# File 'lib/vt100/display_attributes.rb', line 81 def bg_white(txt) display_attr_esc 47, txt end |
#bg_yellow(txt) ⇒ Object
65 66 67 |
# File 'lib/vt100/display_attributes.rb', line 65 def bg_yellow(txt) display_attr_esc 43, txt end |
#bright(txt) ⇒ Object
9 10 11 |
# File 'lib/vt100/display_attributes.rb', line 9 def bright(txt) display_attr_esc 1, txt end |
#display_attr_esc(attr, txt) ⇒ Object
5 6 7 |
# File 'lib/vt100/display_attributes.rb', line 5 def display_attr_esc(attr, txt) "\x1B[#{attr}m#{txt}\x1B[0m" end |
#fg_black(txt) ⇒ Object
21 22 23 |
# File 'lib/vt100/display_attributes.rb', line 21 def fg_black(txt) display_attr_esc 30, txt end |
#fg_blue(txt) ⇒ Object
37 38 39 |
# File 'lib/vt100/display_attributes.rb', line 37 def fg_blue(txt) display_attr_esc 34, txt end |
#fg_cyan(txt) ⇒ Object
45 46 47 |
# File 'lib/vt100/display_attributes.rb', line 45 def fg_cyan(txt) display_attr_esc 36, txt end |
#fg_green(txt) ⇒ Object
29 30 31 |
# File 'lib/vt100/display_attributes.rb', line 29 def fg_green(txt) display_attr_esc 32, txt end |
#fg_magenta(txt) ⇒ Object
41 42 43 |
# File 'lib/vt100/display_attributes.rb', line 41 def fg_magenta(txt) display_attr_esc 35, txt end |
#fg_red(txt) ⇒ Object
25 26 27 |
# File 'lib/vt100/display_attributes.rb', line 25 def fg_red(txt) display_attr_esc 31, txt end |
#fg_white(txt) ⇒ Object
49 50 51 |
# File 'lib/vt100/display_attributes.rb', line 49 def fg_white(txt) display_attr_esc 37, txt end |
#fg_yellow(txt) ⇒ Object
33 34 35 |
# File 'lib/vt100/display_attributes.rb', line 33 def fg_yellow(txt) display_attr_esc 33, txt end |
#hidden(txt) ⇒ Object
17 18 19 |
# File 'lib/vt100/display_attributes.rb', line 17 def hidden(txt) display_attr_esc 8, txt end |
#underscore(txt) ⇒ Object
13 14 15 |
# File 'lib/vt100/display_attributes.rb', line 13 def underscore(txt) display_attr_esc 4, txt end |