redgreenblue 0.6.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
@@ -1,3 +1,11 @@
1
1
  class RGB
2
- VERSION = '0.6.0'
2
+
3
+ # redgreenblue version.
4
+ VERSION = '0.11.0'
5
+
6
+ # Returns RGB::VERSION.
7
+ def self.version
8
+ VERSION
9
+ end
10
+
3
11
  end
@@ -0,0 +1,10 @@
1
+ class RGB
2
+
3
+ # Returns the object's RGB value in hexadecimal notation as used in CSS.
4
+ #
5
+ # Shortens to 3 digits when possible.
6
+ def css_hex
7
+ "##{hex true}"
8
+ end
9
+
10
+ end
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.6.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: 2019-07-24 00:00:00.000000000 Z
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/nice.rb
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.0.3
70
+ rubygems_version: 3.1.2
54
71
  signing_key:
55
72
  specification_version: 4
56
- summary: RGB colors for Ruby
73
+ summary: A simple Ruby library for handling RGB colors.
57
74
  test_files: []
@@ -1,7 +0,0 @@
1
- class RGB
2
-
3
- def inspect
4
- "RGB ##{hex} (red=%1.5f green=%1.5f blue=%1.5f)" % [red, green, blue]
5
- end
6
-
7
- end