Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/string.rb
Overview
String color
Instance Method Summary collapse
- #bg_blue ⇒ Object
- #bg_cyan ⇒ Object
- #bg_green ⇒ Object
-
#bg_magenta ⇒ Object
keklul pink alias.
- #bg_pink ⇒ Object
-
#bg_red ⇒ Object
background.
- #bg_white ⇒ Object
- #bg_yellow ⇒ Object
- #blue ⇒ Object
- #colorize(color_code) ⇒ Object
- #cyan ⇒ Object
- #green ⇒ Object
-
#magenta ⇒ Object
keklul pink alias.
- #pink ⇒ Object
-
#red ⇒ Object
foreground.
- #white ⇒ Object
- #yellow ⇒ Object
Instance Method Details
#bg_blue ⇒ Object
61 62 63 |
# File 'lib/string.rb', line 61 def bg_blue colorize(44) end |
#bg_cyan ⇒ Object
74 75 76 |
# File 'lib/string.rb', line 74 def bg_cyan colorize(46) end |
#bg_green ⇒ Object
53 54 55 |
# File 'lib/string.rb', line 53 def bg_green colorize(42) end |
#bg_magenta ⇒ Object
keklul pink alias
70 71 72 |
# File 'lib/string.rb', line 70 def bg_magenta colorize(45) end |
#bg_pink ⇒ Object
65 66 67 |
# File 'lib/string.rb', line 65 def bg_pink colorize(45) end |
#bg_red ⇒ Object
background
49 50 51 |
# File 'lib/string.rb', line 49 def bg_red colorize(41) end |
#bg_white ⇒ Object
78 79 80 |
# File 'lib/string.rb', line 78 def bg_white colorize(47) end |
#bg_yellow ⇒ Object
57 58 59 |
# File 'lib/string.rb', line 57 def bg_yellow colorize(43) end |
#blue ⇒ Object
27 28 29 |
# File 'lib/string.rb', line 27 def blue colorize(34) end |
#colorize(color_code) ⇒ Object
10 11 12 |
# File 'lib/string.rb', line 10 def colorize(color_code) "\e[#{color_code}m#{self}\e[0m" end |
#cyan ⇒ Object
40 41 42 |
# File 'lib/string.rb', line 40 def cyan colorize(36) end |
#green ⇒ Object
19 20 21 |
# File 'lib/string.rb', line 19 def green colorize(32) end |
#magenta ⇒ Object
keklul pink alias
36 37 38 |
# File 'lib/string.rb', line 36 def magenta colorize(35) end |
#pink ⇒ Object
31 32 33 |
# File 'lib/string.rb', line 31 def pink colorize(35) end |
#red ⇒ Object
foreground
15 16 17 |
# File 'lib/string.rb', line 15 def red colorize(31) end |
#white ⇒ Object
44 45 46 |
# File 'lib/string.rb', line 44 def white colorize(37) end |
#yellow ⇒ Object
23 24 25 |
# File 'lib/string.rb', line 23 def yellow colorize(33) end |