Module: Sevgi::Function::Color
- Included in:
- Sevgi::Function
- Defined in:
- lib/sevgi/function/color.rb
Overview
ANSI color and style methods promoted to Sevgi::F. This module organizes the facade implementation; it is not a consumer mixin contract.
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.
11 |
# File 'lib/sevgi/function/color.rb', line 11 def blue(string) = "\e[1m\e[38;5;81m#{string}\e[0m" |
#bold(string) ⇒ String
Wraps a string in the bold terminal style.
41 |
# File 'lib/sevgi/function/color.rb', line 41 def bold(string) = "\e[1m#{string}\e[0m" |
#cyan(string) ⇒ String
Wraps a string in the cyan terminal style.
16 |
# File 'lib/sevgi/function/color.rb', line 16 def cyan(string) = "\e[1m\e[38;5;51m#{string}\e[0m" |
#dim(string) ⇒ String
Wraps a string in the dim terminal style.
46 |
# File 'lib/sevgi/function/color.rb', line 46 def dim(string) = "\e[1m\e[2m#{string}\e[0m" |
#green(string) ⇒ String
Wraps a string in the green terminal style.
21 |
# File 'lib/sevgi/function/color.rb', line 21 def green(string) = "\e[1m\e[38;5;35m#{string}\e[0m" |
#magenta(string) ⇒ String
Wraps a string in the magenta terminal style.
26 |
# File 'lib/sevgi/function/color.rb', line 26 def magenta(string) = "\e[1m\e[38;5;200m#{string}\e[0m" |
#red(string) ⇒ String
Wraps a string in the red terminal style.
31 |
# File 'lib/sevgi/function/color.rb', line 31 def red(string) = "\e[1m\e[38;5;197m#{string}\e[0m" |
#yellow(string) ⇒ String
Wraps a string in the yellow terminal style.
36 |
# File 'lib/sevgi/function/color.rb', line 36 def yellow(string) = "\e[1m\e[38;5;227m#{string}\e[0m" |