Module: Vedeu::EscapeSequences::Foreground
Overview
Provides foreground colour related escape sequences.
See esc
Instance Method Summary collapse
- #black(&block) ⇒ String
- #blue(&block) ⇒ String
- #cyan(&block) ⇒ String
- #dark_grey(&block) ⇒ String
- #default(&block) ⇒ String
- #green(&block) ⇒ String
- #light_blue(&block) ⇒ String
- #light_cyan(&block) ⇒ String
- #light_green(&block) ⇒ String
- #light_grey(&block) ⇒ String
- #light_magenta(&block) ⇒ String
- #light_red(&block) ⇒ String
- #light_yellow(&block) ⇒ String
- #magenta(&block) ⇒ String
- #red(&block) ⇒ String
- #white(&block) ⇒ String
- #yellow(&block) ⇒ String
Instance Method Details
#black(&block) ⇒ String
17 18 19 20 21 22 23 24 25 |
# File 'lib/vedeu/esc/foreground.rb', line 17 def black(&block) if block_given? "\e[30m" + yield + "\e[39m" else "\e[30m" end end |
#blue(&block) ⇒ String
65 66 67 68 69 70 71 72 73 |
# File 'lib/vedeu/esc/foreground.rb', line 65 def blue(&block) if block_given? "\e[34m" + yield + "\e[39m" else "\e[34m" end end |
#cyan(&block) ⇒ String
89 90 91 92 93 94 95 96 97 |
# File 'lib/vedeu/esc/foreground.rb', line 89 def cyan(&block) if block_given? "\e[36m" + yield + "\e[39m" else "\e[36m" end end |
#dark_grey(&block) ⇒ String
125 126 127 128 129 130 131 132 133 |
# File 'lib/vedeu/esc/foreground.rb', line 125 def dark_grey(&block) if block_given? "\e[90m" + yield + "\e[39m" else "\e[90m" end end |
#default(&block) ⇒ String
113 114 115 116 117 118 119 120 121 |
# File 'lib/vedeu/esc/foreground.rb', line 113 def default(&block) if block_given? "\e[39m" + yield + "\e[39m" else "\e[39m" end end |
#green(&block) ⇒ String
41 42 43 44 45 46 47 48 49 |
# File 'lib/vedeu/esc/foreground.rb', line 41 def green(&block) if block_given? "\e[32m" + yield + "\e[39m" else "\e[32m" end end |
#light_blue(&block) ⇒ String
173 174 175 176 177 178 179 180 181 |
# File 'lib/vedeu/esc/foreground.rb', line 173 def light_blue(&block) if block_given? "\e[94m" + yield + "\e[39m" else "\e[94m" end end |
#light_cyan(&block) ⇒ String
197 198 199 200 201 202 203 204 205 |
# File 'lib/vedeu/esc/foreground.rb', line 197 def light_cyan(&block) if block_given? "\e[96m" + yield + "\e[39m" else "\e[96m" end end |
#light_green(&block) ⇒ String
149 150 151 152 153 154 155 156 157 |
# File 'lib/vedeu/esc/foreground.rb', line 149 def light_green(&block) if block_given? "\e[92m" + yield + "\e[39m" else "\e[92m" end end |
#light_grey(&block) ⇒ String
101 102 103 104 105 106 107 108 109 |
# File 'lib/vedeu/esc/foreground.rb', line 101 def light_grey(&block) if block_given? "\e[37m" + yield + "\e[39m" else "\e[37m" end end |
#light_magenta(&block) ⇒ String
185 186 187 188 189 190 191 192 193 |
# File 'lib/vedeu/esc/foreground.rb', line 185 def light_magenta(&block) if block_given? "\e[95m" + yield + "\e[39m" else "\e[95m" end end |
#light_red(&block) ⇒ String
137 138 139 140 141 142 143 144 145 |
# File 'lib/vedeu/esc/foreground.rb', line 137 def light_red(&block) if block_given? "\e[91m" + yield + "\e[39m" else "\e[91m" end end |
#light_yellow(&block) ⇒ String
161 162 163 164 165 166 167 168 169 |
# File 'lib/vedeu/esc/foreground.rb', line 161 def light_yellow(&block) if block_given? "\e[93m" + yield + "\e[39m" else "\e[93m" end end |
#magenta(&block) ⇒ String
77 78 79 80 81 82 83 84 85 |
# File 'lib/vedeu/esc/foreground.rb', line 77 def magenta(&block) if block_given? "\e[35m" + yield + "\e[39m" else "\e[35m" end end |
#red(&block) ⇒ String
29 30 31 32 33 34 35 36 37 |
# File 'lib/vedeu/esc/foreground.rb', line 29 def red(&block) if block_given? "\e[31m" + yield + "\e[39m" else "\e[31m" end end |
#white(&block) ⇒ String
209 210 211 212 213 214 215 216 217 |
# File 'lib/vedeu/esc/foreground.rb', line 209 def white(&block) if block_given? "\e[97m" + yield + "\e[39m" else "\e[97m" end end |
#yellow(&block) ⇒ String
53 54 55 56 57 58 59 60 61 |
# File 'lib/vedeu/esc/foreground.rb', line 53 def yellow(&block) if block_given? "\e[33m" + yield + "\e[39m" else "\e[33m" end end |