Method: Common::Color#printf_color
- Defined in:
- lib/common/color.rb
#printf_color(text, color, bold, stdout = STDOUT) ⇒ Object
Print a color text.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/common/color.rb', line 16 def printf_color(text, color, bold, stdout = STDOUT) # set bold if bold == nil || bold == false || bold == 0 bold=0 else bold=1 end stdout.printf("\033[%d;%dm%s\033[0m", bold, color, text) end |