Module: Vedeu::EscapeSequences::Foreground
- Extended by:
- Forwardable, Foreground
- Included in:
- Esc, Foreground
- Defined in:
- lib/vedeu/esc/foreground.rb
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
- #foreground(sequence, &block) ⇒ String private
- #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
20 21 22 |
# File 'lib/vedeu/esc/foreground.rb', line 20 def black(&block) foreground("\e[30m", &block) end |
#blue(&block) ⇒ String
44 45 46 |
# File 'lib/vedeu/esc/foreground.rb', line 44 def blue(&block) foreground("\e[34m", &block) end |
#cyan(&block) ⇒ String
56 57 58 |
# File 'lib/vedeu/esc/foreground.rb', line 56 def cyan(&block) foreground("\e[36m", &block) end |
#dark_grey(&block) ⇒ String
74 75 76 |
# File 'lib/vedeu/esc/foreground.rb', line 74 def dark_grey(&block) foreground("\e[90m", &block) end |
#default(&block) ⇒ String
68 69 70 |
# File 'lib/vedeu/esc/foreground.rb', line 68 def default(&block) foreground("\e[39m", &block) end |
#foreground(sequence, &block) ⇒ String (private)
125 126 127 128 129 130 131 132 133 |
# File 'lib/vedeu/esc/foreground.rb', line 125 def foreground(sequence, &block) if block_given? sequence + yield + fg_reset else sequence end end |
#green(&block) ⇒ String
32 33 34 |
# File 'lib/vedeu/esc/foreground.rb', line 32 def green(&block) foreground("\e[32m", &block) end |
#light_blue(&block) ⇒ String
98 99 100 |
# File 'lib/vedeu/esc/foreground.rb', line 98 def light_blue(&block) foreground("\e[94m", &block) end |
#light_cyan(&block) ⇒ String
110 111 112 |
# File 'lib/vedeu/esc/foreground.rb', line 110 def light_cyan(&block) foreground("\e[96m", &block) end |
#light_green(&block) ⇒ String
86 87 88 |
# File 'lib/vedeu/esc/foreground.rb', line 86 def light_green(&block) foreground("\e[92m", &block) end |
#light_grey(&block) ⇒ String
62 63 64 |
# File 'lib/vedeu/esc/foreground.rb', line 62 def light_grey(&block) foreground("\e[37m", &block) end |
#light_magenta(&block) ⇒ String
104 105 106 |
# File 'lib/vedeu/esc/foreground.rb', line 104 def light_magenta(&block) foreground("\e[95m", &block) end |
#light_red(&block) ⇒ String
80 81 82 |
# File 'lib/vedeu/esc/foreground.rb', line 80 def light_red(&block) foreground("\e[91m", &block) end |
#light_yellow(&block) ⇒ String
92 93 94 |
# File 'lib/vedeu/esc/foreground.rb', line 92 def light_yellow(&block) foreground("\e[93m", &block) end |
#magenta(&block) ⇒ String
50 51 52 |
# File 'lib/vedeu/esc/foreground.rb', line 50 def magenta(&block) foreground("\e[35m", &block) end |
#red(&block) ⇒ String
26 27 28 |
# File 'lib/vedeu/esc/foreground.rb', line 26 def red(&block) foreground("\e[31m", &block) end |
#white(&block) ⇒ String
116 117 118 |
# File 'lib/vedeu/esc/foreground.rb', line 116 def white(&block) foreground("\e[97m", &block) end |
#yellow(&block) ⇒ String
38 39 40 |
# File 'lib/vedeu/esc/foreground.rb', line 38 def yellow(&block) foreground("\e[33m", &block) end |