Module: Ccp::Utils::Colorize::Fore
- Extended by:
- Fore
- Included in:
- Ccp::Utils::Colorize, Ccp::Utils::Colorize, Fore
- Defined in:
- lib/ccp/utils/colorize.rb
Overview
- examples
-
Ccp::Utils::Colorize::Fore.red(“hello”) Ccp::Utils::Colorize::Back.red(“hello”) Ccp::Utils::Colorize.red(“hello”) # same as Fore Ccp::Utils::Colorize.strip(ansi_color_string) Ccp::Utils::Colorize::Bar.success(“”, 10, 0.5) # => “[|||| ]”
Constant Summary collapse
- CLEAR =
"\e[0m"
- BLACK =
"\e[30m"
- RED =
"\e[31m"
- GREEN =
"\e[32m"
- YELLOW =
"\e[33m"
- BLUE =
"\e[34m"
- MAGENTA =
"\e[35m"
- CYAN =
"\e[36m"
- WHITE =
"\e[37m"
Instance Method Summary collapse
-
#aqua(text) ⇒ Object
alias.
- #black(text) ⇒ Object
- #blue(text) ⇒ Object
- #colorize(text, code) ⇒ Object
- #cyan(text) ⇒ Object
- #green(text) ⇒ Object
- #magenta(text) ⇒ Object
-
#pink(text) ⇒ Object
alias.
-
#purple(text) ⇒ Object
alias.
- #red(text) ⇒ Object
- #white(text) ⇒ Object
- #yellow(text) ⇒ Object
Instance Method Details
#aqua(text) ⇒ Object
alias
33 |
# File 'lib/ccp/utils/colorize.rb', line 33 def aqua (text) CYAN + text.to_s + CLEAR; end |
#black(text) ⇒ Object
24 |
# File 'lib/ccp/utils/colorize.rb', line 24 def black (text) BLACK + text.to_s + CLEAR; end |
#blue(text) ⇒ Object
28 |
# File 'lib/ccp/utils/colorize.rb', line 28 def blue (text) BLUE + text.to_s + CLEAR; end |
#colorize(text, code) ⇒ Object
22 |
# File 'lib/ccp/utils/colorize.rb', line 22 def colorize(text, code); code + text.to_s + CLEAR; end |
#cyan(text) ⇒ Object
32 |
# File 'lib/ccp/utils/colorize.rb', line 32 def cyan (text) CYAN + text.to_s + CLEAR; end |
#green(text) ⇒ Object
26 |
# File 'lib/ccp/utils/colorize.rb', line 26 def green (text) GREEN + text.to_s + CLEAR; end |
#magenta(text) ⇒ Object
29 |
# File 'lib/ccp/utils/colorize.rb', line 29 def magenta(text) MAGENTA + text.to_s + CLEAR; end |
#pink(text) ⇒ Object
alias
31 |
# File 'lib/ccp/utils/colorize.rb', line 31 def pink (text) MAGENTA + text.to_s + CLEAR; end |
#purple(text) ⇒ Object
alias
30 |
# File 'lib/ccp/utils/colorize.rb', line 30 def purple (text) MAGENTA + text.to_s + CLEAR; end |
#red(text) ⇒ Object
25 |
# File 'lib/ccp/utils/colorize.rb', line 25 def red (text) RED + text.to_s + CLEAR; end |
#white(text) ⇒ Object
34 |
# File 'lib/ccp/utils/colorize.rb', line 34 def white (text) WHITE + text.to_s + CLEAR; end |
#yellow(text) ⇒ Object
27 |
# File 'lib/ccp/utils/colorize.rb', line 27 def yellow (text) YELLOW + text.to_s + CLEAR; end |