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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 394e714f95ecbb3b54b5a264ce5be367d235fcebe7513b89d48d0491de236312
4
- data.tar.gz: 177328fccfa5fbfd1911944ac5d6a65ccf7a7315589930d91beb764e413b2c4f
3
+ metadata.gz: '0499472f115bf5da195d99bdd428ba149cdfdd9aaafa9fcc3142bed9666912c8'
4
+ data.tar.gz: c5f216790f1eff9d99e779c6e2ca1560f02add2714e7e49286467bdf0a49d34a
5
5
  SHA512:
6
- metadata.gz: c929dc3f52e077403241a32d114e36f76629f62c0da14d4927b03b6845bdfba0e3a1240d5a0b4285b048e2971a5898af675b86a80c5830fb35fc404a52d343ce
7
- data.tar.gz: 2c2966155b1b3ddb5ca671105568248b8e1e1f6e1ebc205d4d91dc3582343969ecf1ca9bd56f2f7906f322011ab376047b699afea2c9925f1bedd399a32f7061
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 1..256
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 1 and 256"
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  module ExAequo
4
4
  module Version
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.4'
6
6
  end
7
7
  end
8
8
  # SPDX-License-Identifier: Apache-2.0
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.3
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