ansi256 0.2.2 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -0
- data/bin/ansi256 +8 -1
- data/lib/ansi256/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -109,6 +109,9 @@ ansi256 yellow "Hello world"
|
|
109
109
|
ansi256 /blue "Hello world"
|
110
110
|
ansi256 yellow/blue "Hello world"
|
111
111
|
|
112
|
+
# RGB colors (only support 6-letter hex codes)
|
113
|
+
ansi256 ff9900/000033 "Hello world"
|
114
|
+
|
112
115
|
# Mixed color codes
|
113
116
|
ansi256 yellow/232 "Hello world"
|
114
117
|
|
data/bin/ansi256
CHANGED
@@ -13,7 +13,14 @@ end
|
|
13
13
|
fgbg, *msg = ARGV
|
14
14
|
fg, bg = fgbg.split('/').map { |e|
|
15
15
|
if !e.to_s.empty?
|
16
|
-
|
16
|
+
case e
|
17
|
+
when /^#?[0-9a-f]{6}$/i
|
18
|
+
e
|
19
|
+
when /^\d+$/
|
20
|
+
e.to_i
|
21
|
+
else
|
22
|
+
e.downcase.to_sym
|
23
|
+
end
|
17
24
|
end
|
18
25
|
}
|
19
26
|
|
data/lib/ansi256/version.rb
CHANGED