redgreenblue 0.6.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/redgreenblue.rb +17 -13
- data/lib/redgreenblue/24bit.rb +38 -5
- data/lib/redgreenblue/48bit.rb +12 -5
- data/lib/redgreenblue/base.rb +58 -12
- data/lib/redgreenblue/bgr24bit.rb +5 -5
- data/lib/redgreenblue/cie.rb +45 -0
- data/lib/redgreenblue/gamma.rb +44 -0
- data/lib/redgreenblue/gif.rb +3 -2
- data/lib/redgreenblue/gpl.rb +30 -0
- data/lib/redgreenblue/hex.rb +46 -15
- data/lib/redgreenblue/hsb.rb +61 -0
- data/lib/redgreenblue/hsl.rb +96 -0
- data/lib/redgreenblue/hsv.rb +96 -0
- data/lib/redgreenblue/hsx_shared.rb +94 -0
- data/lib/redgreenblue/inspect.rb +69 -0
- data/lib/redgreenblue/int.rb +22 -0
- data/lib/redgreenblue/lazy.rb +44 -2
- data/lib/redgreenblue/math.rb +9 -0
- data/lib/redgreenblue/misc.rb +20 -41
- data/lib/redgreenblue/mix.rb +65 -0
- data/lib/redgreenblue/opt/philipshue.rb +54 -0
- data/lib/redgreenblue/os/mac.rb +24 -10
- data/lib/redgreenblue/ostwald.rb +45 -0
- data/lib/redgreenblue/random.rb +11 -3
- data/lib/redgreenblue/rgb565.rb +9 -10
- data/lib/redgreenblue/terminal.rb +19 -0
- data/lib/redgreenblue/version.rb +9 -1
- data/lib/redgreenblue/web.rb +10 -0
- metadata +23 -6
- data/lib/redgreenblue/nice.rb +0 -7
@@ -0,0 +1,19 @@
|
|
1
|
+
class RGB
|
2
|
+
|
3
|
+
# With help from:
|
4
|
+
# - https://gist.github.com/XVilka/8346728
|
5
|
+
# - https://unix.stackexchange.com/questions/404414
|
6
|
+
|
7
|
+
# Returns the ANSI escape sequence required to set the foreground color on a terminal to this color.
|
8
|
+
# Only works on terminals that support 24-bit colors, so-called "true color".
|
9
|
+
def terminal_foreground
|
10
|
+
"\e[38;2;%d;%d;%dm" % rgb
|
11
|
+
end
|
12
|
+
|
13
|
+
# Returns the ANSI escape sequence required to set the background color on a terminal to this color.
|
14
|
+
# Only works on terminals that support 24-bit colors, so-called "true color".
|
15
|
+
def terminal_background
|
16
|
+
"\e[48;2;%d;%d;%dm" % rgb
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/lib/redgreenblue/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redgreenblue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lllist.eu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -21,20 +21,37 @@ files:
|
|
21
21
|
- lib/redgreenblue/48bit.rb
|
22
22
|
- lib/redgreenblue/base.rb
|
23
23
|
- lib/redgreenblue/bgr24bit.rb
|
24
|
+
- lib/redgreenblue/cie.rb
|
25
|
+
- lib/redgreenblue/gamma.rb
|
24
26
|
- lib/redgreenblue/gif.rb
|
27
|
+
- lib/redgreenblue/gpl.rb
|
25
28
|
- lib/redgreenblue/hex.rb
|
29
|
+
- lib/redgreenblue/hsb.rb
|
30
|
+
- lib/redgreenblue/hsl.rb
|
31
|
+
- lib/redgreenblue/hsv.rb
|
32
|
+
- lib/redgreenblue/hsx_shared.rb
|
33
|
+
- lib/redgreenblue/inspect.rb
|
34
|
+
- lib/redgreenblue/int.rb
|
26
35
|
- lib/redgreenblue/lazy.rb
|
36
|
+
- lib/redgreenblue/math.rb
|
27
37
|
- lib/redgreenblue/misc.rb
|
28
|
-
- lib/redgreenblue/
|
38
|
+
- lib/redgreenblue/mix.rb
|
39
|
+
- lib/redgreenblue/opt/philipshue.rb
|
29
40
|
- lib/redgreenblue/os.rb
|
30
41
|
- lib/redgreenblue/os/mac.rb
|
42
|
+
- lib/redgreenblue/ostwald.rb
|
31
43
|
- lib/redgreenblue/random.rb
|
32
44
|
- lib/redgreenblue/rgb565.rb
|
45
|
+
- lib/redgreenblue/terminal.rb
|
33
46
|
- lib/redgreenblue/version.rb
|
47
|
+
- lib/redgreenblue/web.rb
|
34
48
|
homepage: https://github.com/lllisteu/redgreenblue
|
35
49
|
licenses:
|
36
50
|
- MIT
|
37
|
-
metadata:
|
51
|
+
metadata:
|
52
|
+
homepage_uri: https://github.com/lllisteu/redgreenblue
|
53
|
+
changelog_uri: https://github.com/lllisteu/redgreenblue/blob/master/History.md
|
54
|
+
documentation_uri: https://www.rubydoc.info/gems/redgreenblue/RGB
|
38
55
|
post_install_message:
|
39
56
|
rdoc_options: []
|
40
57
|
require_paths:
|
@@ -50,8 +67,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
50
67
|
- !ruby/object:Gem::Version
|
51
68
|
version: '0'
|
52
69
|
requirements: []
|
53
|
-
rubygems_version: 3.
|
70
|
+
rubygems_version: 3.1.2
|
54
71
|
signing_key:
|
55
72
|
specification_version: 4
|
56
|
-
summary:
|
73
|
+
summary: A simple Ruby library for handling RGB colors.
|
57
74
|
test_files: []
|