ex_aequo 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ex_aequo/color/ansi256.rb +2 -2
- data/lib/ex_aequo/colors.rb +29 -0
- data/lib/ex_aequo/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0499472f115bf5da195d99bdd428ba149cdfdd9aaafa9fcc3142bed9666912c8'
|
4
|
+
data.tar.gz: c5f216790f1eff9d99e779c6e2ca1560f02add2714e7e49286467bdf0a49d34a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e37bb04b1113d2f9dd82736382d3616bccd46e279be3a588bbdb113a34a6788d289d4baf4e2d7c4eaed2340cd4db3b2ea0e4950c278ad6f3435ce6530b7e1e21
|
7
|
+
data.tar.gz: 498f891d7209f9942a121db3d0ee7ae63f7e07399d4a0503ae2880acbf24df4795cdfdd1a75f4f2273a61268db251cf1f565aeb62fcfd6ee4435ddfdf19c6e15
|
@@ -9,10 +9,10 @@ module ExAequo
|
|
9
9
|
|
10
10
|
def ansi256(color, bold: false, dim: false, italic: false, underline: false)
|
11
11
|
case color
|
12
|
-
in
|
12
|
+
in 0..255
|
13
13
|
"\e[38;5;#{color}#{postfix_modifiers(bold:, dim:, italic:, underline:)}m"
|
14
14
|
else
|
15
|
-
raise IllegalColor, "#{color.inspect} is not a color number between
|
15
|
+
raise IllegalColor, "#{color.inspect} is not a color number between 0 and 255"
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'color/colorizer'
|
4
|
+
module ExAequo
|
5
|
+
module Colors
|
6
|
+
extend self
|
7
|
+
|
8
|
+
def ansi(text, ansi, **kwds)
|
9
|
+
ExAequo::Color::Colorizer.colorize(text, ansi:, **kwds)
|
10
|
+
end
|
11
|
+
|
12
|
+
def ansi256(text, ansi256, **kwds)
|
13
|
+
ExAequo::Color::Colorizer.colorize(text, ansi256:, **kwds)
|
14
|
+
end
|
15
|
+
|
16
|
+
def rgb(text, *args, **kwds)
|
17
|
+
if args.size == 1
|
18
|
+
ExAequo::Color::Colorizer.colorize(text, rgb: args.first, **kwds)
|
19
|
+
else
|
20
|
+
ExAequo::Color::Colorizer.colorize(text, rgb: args, **kwds)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def method_missing(name, text, **kwds)
|
25
|
+
ExAequo::Color::Colorizer.colorize(text, web: name, **kwds)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
# SPDX-License-Identifier: Apache-2.0
|
data/lib/ex_aequo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ex_aequo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Dober
|
@@ -28,6 +28,7 @@ files:
|
|
28
28
|
- lib/ex_aequo/color/modifiers.rb
|
29
29
|
- lib/ex_aequo/color/rgb.rb
|
30
30
|
- lib/ex_aequo/color/web.rb
|
31
|
+
- lib/ex_aequo/colors.rb
|
31
32
|
- lib/ex_aequo/kernel.rb
|
32
33
|
- lib/ex_aequo/kernel/access.rb
|
33
34
|
- lib/ex_aequo/kernel/fn.rb
|