tiny_color 1.2.2 → 1.3.0

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 +4 -4
  2. data/lib/tiny_color.rb +9 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97c50b04d124c59d58aaa9de2d5edc7a4a78e3ae06b392037f1ef2be107cdd43
4
- data.tar.gz: fa4e5c91b573928d4053d84a732d8c2bbe53729aec3f95d81771639e0ac88008
3
+ metadata.gz: f2e30d0beb4c0e49eab8227d931f61c809973c68de9aae49ae2cc5fbf237ad58
4
+ data.tar.gz: e009c1ae10900793146a1a8a60f22f5e33b07db1b2b7064a222b01bab97ddd90
5
5
  SHA512:
6
- metadata.gz: a6289e1a77ec0345f5500ddf25f45b85697c86ae84204be543872a208bdd410b7a35f185de7d133e82bf7805c839f1e2de15916c0d2465552a31883bc2fb345a
7
- data.tar.gz: 49231e269ff13d170cdfa263658e0d1f944eaffa0b7d633fbc3a7dc29729cf17295cd5ef8cdc997825f4858a016ab2aeb6e75adcabab3b2d78e1051b2cecfa76
6
+ metadata.gz: 38e27a2a942c5462f91946680cb68e7b05664b5c996aeab349dc233e0a90d36132c459590c674af0f9949fa26114425f19e23f6b4a9c7f1ad411ce3656bac11b
7
+ data.tar.gz: 8501e2106a1617333606074ee5b5a1dddf1911ae7eb99a257f2122a44301c515ba260c146e0dd34c279eea3c5c44d269d09a5a24d39c5d60f844654b98547fad
data/lib/tiny_color.rb CHANGED
@@ -59,11 +59,20 @@ class String
59
59
  define_method color do
60
60
  "\033[#{value}m#{self}\033[0m"
61
61
  end
62
+
62
63
  define_method "on_#{color}" do
63
64
  "\033[#{value + 10}m#{self}\033[0m"
64
65
  end
65
66
  end
66
67
 
68
+ def default
69
+ "\033[39m#{self}\033[0m"
70
+ end
71
+
72
+ def on_default
73
+ "\033[49m#{self}\033[0m"
74
+ end
75
+
67
76
  MODES.each do |mode, value|
68
77
  define_method mode do
69
78
  "\033[#{value}m#{self}\033[0m"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny_color
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Lunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-26 00:00:00.000000000 Z
11
+ date: 2023-08-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: a tiny library for String colorization
14
14
  email: jefflunt@gmail.com