Module: Sevgi::Function::Color
- Included in:
- Sevgi::Function
- Defined in:
- lib/sevgi/function/color.rb
Overview
ANSI color and style helpers for terminal output.
Instance Method Summary collapse
-
#blue(string) ⇒ String
Wraps a string in the blue terminal style.
-
#bold(string) ⇒ String
Wraps a string in the bold terminal style.
-
#cyan(string) ⇒ String
Wraps a string in the cyan terminal style.
-
#dim(string) ⇒ String
Wraps a string in the dim terminal style.
-
#green(string) ⇒ String
Wraps a string in the green terminal style.
-
#magenta(string) ⇒ String
Wraps a string in the magenta terminal style.
-
#red(string) ⇒ String
Wraps a string in the red terminal style.
-
#yellow(string) ⇒ String
Wraps a string in the yellow terminal style.
Instance Method Details
#blue(string) ⇒ String
Wraps a string in the blue terminal style.
10 |
# File 'lib/sevgi/function/color.rb', line 10 def blue(string) = "\e[1m\e[38;5;81m#{string}\e[0m" |
#bold(string) ⇒ String
Wraps a string in the bold terminal style.
40 |
# File 'lib/sevgi/function/color.rb', line 40 def bold(string) = "\e[1m#{string}\e[0m" |
#cyan(string) ⇒ String
Wraps a string in the cyan terminal style.
15 |
# File 'lib/sevgi/function/color.rb', line 15 def cyan(string) = "\e[1m\e[38;5;51m#{string}\e[0m" |
#dim(string) ⇒ String
Wraps a string in the dim terminal style.
45 |
# File 'lib/sevgi/function/color.rb', line 45 def dim(string) = "\e[1m\e[2m#{string}\e[0m" |
#green(string) ⇒ String
Wraps a string in the green terminal style.
20 |
# File 'lib/sevgi/function/color.rb', line 20 def green(string) = "\e[1m\e[38;5;35m#{string}\e[0m" |
#magenta(string) ⇒ String
Wraps a string in the magenta terminal style.
25 |
# File 'lib/sevgi/function/color.rb', line 25 def magenta(string) = "\e[1m\e[38;5;200m#{string}\e[0m" |
#red(string) ⇒ String
Wraps a string in the red terminal style.
30 |
# File 'lib/sevgi/function/color.rb', line 30 def red(string) = "\e[1m\e[38;5;197m#{string}\e[0m" |
#yellow(string) ⇒ String
Wraps a string in the yellow terminal style.
35 |
# File 'lib/sevgi/function/color.rb', line 35 def yellow(string) = "\e[1m\e[38;5;227m#{string}\e[0m" |