Module: Mayl::Colors
- Included in:
- Repl
- Defined in:
- lib/mayl/colors.rb
Instance Method Summary collapse
Instance Method Details
#color(name, str) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/mayl/colors.rb', line 3 def color(name, str) code = case name when :black then "\033[30m" when :red then "\033[31m" when :green then "\033[32m" when :brown then "\033[33m" when :blue then "\033[34m" when :magenta then "\033[35m" when :cyan then "\033[36m" when :gray then "\033[37m" end endcode = "\033[0m" [code,str,endcode].join end |