Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/stringcolors.rb

Instance Method Summary collapse

Instance Method Details

#bg_blackObject



35
36
37
# File 'lib/stringcolors.rb', line 35

def bg_black;
  "\e[40m#{self}\e[0m"
end

#bg_blueObject



51
52
53
# File 'lib/stringcolors.rb', line 51

def bg_blue;
  "\e[44m#{self}\e[0m"
end

#bg_brownObject



47
48
49
# File 'lib/stringcolors.rb', line 47

def bg_brown;
  "\e[43m#{self}\e[0m"
end

#bg_cyanObject



59
60
61
# File 'lib/stringcolors.rb', line 59

def bg_cyan;
  "\e[46m#{self}\e[0m"
end

#bg_grayObject



63
64
65
# File 'lib/stringcolors.rb', line 63

def bg_gray;
  "\e[47m#{self}\e[0m"
end

#bg_greenObject



43
44
45
# File 'lib/stringcolors.rb', line 43

def bg_green;
  "\e[42m#{self}\e[0m"
end

#bg_magentaObject



55
56
57
# File 'lib/stringcolors.rb', line 55

def bg_magenta;
  "\e[45m#{self}\e[0m"
end

#bg_redObject



39
40
41
# File 'lib/stringcolors.rb', line 39

def bg_red;
  "\e[41m#{self}\e[0m"
end

#blackObject



3
4
5
# File 'lib/stringcolors.rb', line 3

def black;
  "\e[30m#{self}\e[0m"
end


79
80
81
# File 'lib/stringcolors.rb', line 79

def blink;
  "\e[5m#{self}\e[25m"
end

#blueObject



19
20
21
# File 'lib/stringcolors.rb', line 19

def blue;
  "\e[34m#{self}\e[0m"
end

#boldObject



67
68
69
# File 'lib/stringcolors.rb', line 67

def bold;
  "\e[1m#{self}\e[22m"
end

#cyanObject



27
28
29
# File 'lib/stringcolors.rb', line 27

def cyan;
  "\e[36m#{self}\e[0m"
end

#grayObject



31
32
33
# File 'lib/stringcolors.rb', line 31

def gray;
  "\e[37m#{self}\e[0m"
end

#greenObject



11
12
13
# File 'lib/stringcolors.rb', line 11

def green;
  "\e[32m#{self}\e[0m"
end

#italicObject



71
72
73
# File 'lib/stringcolors.rb', line 71

def italic;
  "\e[3m#{self}\e[23m"
end

#magentaObject



23
24
25
# File 'lib/stringcolors.rb', line 23

def magenta;
  "\e[35m#{self}\e[0m"
end

#redObject



7
8
9
# File 'lib/stringcolors.rb', line 7

def red;
  "\e[31m#{self}\e[0m"
end

#reverse_colorObject



83
84
85
# File 'lib/stringcolors.rb', line 83

def reverse_color;
  "\e[7m#{self}\e[27m"
end

#underlineObject



75
76
77
# File 'lib/stringcolors.rb', line 75

def underline;
  "\e[4m#{self}\e[24m"
end

#yellowObject



15
16
17
# File 'lib/stringcolors.rb', line 15

def yellow;
  "\e[33m#{self}\e[0m"
end