corol 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/corol.rb +139 -0
  3. metadata +44 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7cc8cc216dc25d3e52792348b396567eb033f2ee
4
+ data.tar.gz: daf9226935db3e87734f2a0d507ba74d87984c19
5
+ SHA512:
6
+ metadata.gz: 1a8d5ad257e28c6ad35e2da295e61d8d86ed3724f78a903232769c67144de703d5a977ed78fe40ea6779fd5c2da6dd400ae31c02d5ed325ec20c1fee1a3fdba8
7
+ data.tar.gz: b14e0fca7fb6662e4c06de414d6a5f0806fe9f989dbef3d70133565089810bd7f50c1ffa39137e85039b830f6f23b0cc9b1eace9734d0d5faf876154191bd210
@@ -0,0 +1,139 @@
1
+ #### Text Colors Codes ####
2
+ RED = "\e[31m" #Variable and Color code for red
3
+ WHITE = "\e[0m" #Variable and Color code for white and resetting color or format
4
+ BLACK = "\e[30m" #Variable and Color code for black
5
+ GREEN = "\e[32m" #Variable and Color code for green
6
+ YELLOW = "\e[33m" #Variable and Color code for yellow
7
+ BLUE = "\e[34m" #Variable and Color code for blue
8
+ MAGENTA = "\e[35m" #Variable and Color code for magenta
9
+ CYAN = "\e[36m" #Variable and Color code for cyan
10
+ LIGHT_RED = "\e[91m" #Variable and Color code for light red
11
+ LIGHT_GREEN = "\e[92m" #Variable and Color code for light green
12
+ LIGHT_YELLOW = "\e[93m" #Variable and Color code for light yellow
13
+ LIGHT_BLUE = "\e[94m" #Variable and Color code for light blue
14
+ LIGHT_MAGENTA = "\e[95m" #Variable and Color code for light magenta
15
+ LIGHT_CYAN = "\e[96m" #Variable and Color code for light cyan
16
+
17
+ #### BackGround Colors Codes ####
18
+ BACK_RED = "\e[41m" #Variable and Color code for Background red
19
+ BACK_GREEN = "\e[42m" #Variable and Color code for Background green
20
+ BACK_YELLOW = "\e[43m" #Variable and Color code for Background yellow
21
+ BACK_BLUE = "\e[44m" #Variable and Color code for Background blue
22
+ BACK_MAGENTA = "\e[45m" #Variable and Color code for Background magenta
23
+ BACK_CYAN = "\e[46m" #Variable and Color code for Background cyan
24
+ BACK_LIG_RED = "\e[101m" #Variable and Color code for Background light red
25
+ BACK_LIG_GREEN = "\e[102m" #Variable and Color code for Background light green
26
+ BACK_LIG_YELLOW = "\e[103m" #Variable and Color code for Background light yellow
27
+ BACK_LIG_BLUE = "\e[104m" #Variable and Color code for Background light blue
28
+ BACK_LIG_MAGENTA = "\e[105m" #Variable and Color code for Background light magenta
29
+ BACK_LIG_CYAN = "\e[106m" #Variable and Color code for Background light cyan
30
+
31
+
32
+
33
+ #### Formatting Codes ####
34
+ BOLD = "\e[1m" #Variable and code for bold
35
+ DIM = "\e[2m" #Variable and code for dim
36
+ UND_LINE = "\e[4m" #Variable and code for underline
37
+ HIDDEN = "\e[8m" #Variable and code for hidden text . For passwords
38
+
39
+
40
+ module Colors
41
+ def red
42
+ return RED+"#{self}"+WHITE
43
+ end
44
+ def white
45
+ return WHITE+"#{self}"+WHITE
46
+ end
47
+ def black
48
+ return BLACK+"#{self}"+WHITE
49
+ end
50
+ def green
51
+ return GREEN+"#{self}"+WHITE
52
+ end
53
+ def yellow
54
+ return YELLOW+"#{self}"+WHITE
55
+ end
56
+ def blue
57
+ return BLUE+"#{self}"+WHITE
58
+ end
59
+ def magenta
60
+ return MAGENTA+"#{self}"+WHITE
61
+ end
62
+ def cyan
63
+ return CYAN+"#{self}"+WHITE
64
+ end
65
+ def light_red
66
+ return LIGHT_RED+"#{self}"+WHITE
67
+ end
68
+ def light_green
69
+ return LIGHT_GREEN+"#{self}"+WHITE
70
+ end
71
+ def light_yellow
72
+ return LIGHT_YELLOW+"#{self}"+WHITE
73
+ end
74
+ def light_blue
75
+ return LIGHT_BLUE+"#{self}"+WHITE
76
+ end
77
+ def light_magenta
78
+ return LIGHT_MAGENTA+"#{self}"+WHITE
79
+ end
80
+ def light_cyan
81
+ return LIGHT_CYAN+"#{self}"+WHITE
82
+ end
83
+ end
84
+
85
+ module BG_Colors
86
+ def back_red
87
+ return BACK_RED+"#{self}"+WHITE
88
+ end
89
+ def back_green
90
+ return BACK_GREEN+"#{self}"+WHITE
91
+ end
92
+ def back_yellow
93
+ return BACK_YELLOW+"#{self}"+WHITE
94
+ end
95
+ def back_blue
96
+ return BACK_BLUE+"#{self}"+WHITE
97
+ end
98
+ def back_magenta
99
+ return BACK_MAGENTA+"#{self}"+WHITE
100
+ end
101
+ def back_cyan
102
+ return BACK_CYAN+"#{self}"+WHITE
103
+ end
104
+ def back_light_red
105
+ return BACK_LIG_RED+"#{self}"+WHITE
106
+ end
107
+ def back_light_green
108
+ return BACK_LIG_GREEN+"#{self}"+WHITE
109
+ end
110
+ def back_light_yellow
111
+ return BACK_LIG_YELLOW+"#{self}"+WHITE
112
+ end
113
+ def back_light_blue
114
+ return BACK_BLUE+"#{self}"+WHITE
115
+ end
116
+ def back_light_magenta
117
+ return BACK_LIG_MAGENTA+"#{self}"+WHITE
118
+ end
119
+ def back_light_cyan
120
+ return BACK_LIG_CYAN+"#{self}"+WHITE
121
+ end
122
+ end
123
+
124
+ module Formatting
125
+ def bold
126
+ return BOLD+"#{self}"+WHITE
127
+ end
128
+ def dim
129
+ return DIM+"#{self}"+WHITE
130
+ end
131
+ def und_line
132
+ return UND_LINE+"#{self}"+WHITE
133
+ end
134
+ def hidden
135
+ return HIDDEN+"#{self}"+WHITE
136
+ end
137
+ end
138
+ class String ; include Colors, BG_Colors,Formatting ; end # include modules to using as instance methods
139
+
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: corol
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Farhad
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-05-15 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email: farhad9801@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/corol.rb
20
+ homepage: http://rubygems.org/gems/corol
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.6.10
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Simple gem for make texts beautiful
44
+ test_files: []