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

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

Instance Method Details

#aqua(text) ⇒ Object

alias



31
# File 'lib/ccp/utils/colorize.rb', line 31

def aqua   (text) CYAN    + text.to_s + CLEAR; end

#black(text) ⇒ Object



22
# File 'lib/ccp/utils/colorize.rb', line 22

def black  (text) BLACK   + text.to_s + CLEAR; end

#blue(text) ⇒ Object



26
# File 'lib/ccp/utils/colorize.rb', line 26

def blue   (text) BLUE    + text.to_s + CLEAR; end

#colorize(text, code) ⇒ Object



20
# File 'lib/ccp/utils/colorize.rb', line 20

def colorize(text, code); code + text.to_s + CLEAR; end

#cyan(text) ⇒ Object



30
# File 'lib/ccp/utils/colorize.rb', line 30

def cyan   (text) CYAN    + text.to_s + CLEAR; end

#green(text) ⇒ Object



24
# File 'lib/ccp/utils/colorize.rb', line 24

def green  (text) GREEN   + text.to_s + CLEAR; end

#magenta(text) ⇒ Object



27
# File 'lib/ccp/utils/colorize.rb', line 27

def magenta(text) MAGENTA + text.to_s + CLEAR; end

#pink(text) ⇒ Object

alias



29
# File 'lib/ccp/utils/colorize.rb', line 29

def pink   (text) MAGENTA + text.to_s + CLEAR; end

#purple(text) ⇒ Object

alias



28
# File 'lib/ccp/utils/colorize.rb', line 28

def purple (text) MAGENTA + text.to_s + CLEAR; end

#red(text) ⇒ Object



23
# File 'lib/ccp/utils/colorize.rb', line 23

def red    (text) RED     + text.to_s + CLEAR; end

#white(text) ⇒ Object



32
# File 'lib/ccp/utils/colorize.rb', line 32

def white  (text) WHITE   + text.to_s + CLEAR; end

#yellow(text) ⇒ Object



25
# File 'lib/ccp/utils/colorize.rb', line 25

def yellow (text) YELLOW  + text.to_s + CLEAR; end