Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/colorful.rb
Instance Method Summary collapse
- #background(*args) ⇒ Object (also: #bg, #on)
- #foreground(*args) ⇒ Object (also: #fg, #color, #colour)
Instance Method Details
#background(*args) ⇒ Object Also known as: bg, on
73 74 75 76 |
# File 'lib/colorful.rb', line 73 def background(*args) code = ansi_color_code *args inject_ansi_code 48, 5, code end |
#foreground(*args) ⇒ Object Also known as: fg, color, colour
65 66 67 68 |
# File 'lib/colorful.rb', line 65 def foreground(*args) code = ansi_color_code *args inject_ansi_code 38, 5, code end |