Class: Blight::UsesColors
- Inherits:
-
Object
- Object
- Blight::UsesColors
- Defined in:
- lib/blight.rb
Instance Method Summary collapse
-
#initialize(window) ⇒ UsesColors
constructor
A new instance of UsesColors.
- #use(foreground, background) ⇒ Object
Constructor Details
#initialize(window) ⇒ UsesColors
Returns a new instance of UsesColors.
93 94 95 |
# File 'lib/blight.rb', line 93 def initialize(window) @window = window end |
Instance Method Details
#use(foreground, background) ⇒ Object
97 98 99 100 101 102 |
# File 'lib/blight.rb', line 97 def use(foreground, background) Ncurses.init_pair(1, find(foreground), find(background)) Ncurses.attron(Ncurses.COLOR_PAIR(1)) yield Ncurses.attroff(Ncurses.COLOR_PAIR(1)) end |