Complementary_Color 0.1.1 → 0.1.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +49 -0
- data/README.md +3 -0
- data/lib/color/error/hex_code_error.rb +11 -0
- data/lib/color/hex.rb +7 -2
- data/lib/color/version.rb +1 -1
- data/lib/color.rb +1 -10
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a380970a605d79d87714bc1b170012bd7eb4582eea80ed232807c6638d82f84
|
4
|
+
data.tar.gz: afe9ddc86fd328eb4b90a7aa008e09a424ed93d07eb31f1adaf93004ed03cb3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67c6835e8679f615226ec4ec699440cabcfec133369c997fb4265779f4192438de35ead8cfdfc821bcf0d0326f8ad41cde30e673e7b6e6f89b01c9e4b17623d7
|
7
|
+
data.tar.gz: c359d74408e6bb159c6c15d336e5b602cb64d5b2100de28a54df178053341bbe2f2938d70fc1631eb79c6e93aeeef58ea8d3a11d24bd5fa9cae55c1131df1293
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,55 @@
|
|
2
2
|
|
3
3
|
- First functionality added
|
4
4
|
|
5
|
+
## [0.7.0](https://www.github.com/TimHi/Compelementary-Color/compare/v0.6.0...v0.7.0) (2022-06-25)
|
6
|
+
|
7
|
+
|
8
|
+
### Features
|
9
|
+
|
10
|
+
* test ([90475db](https://www.github.com/TimHi/Compelementary-Color/commit/90475db7a6b65740e69d02004b058531aa86497c))
|
11
|
+
|
12
|
+
## [0.6.0](https://www.github.com/TimHi/Compelementary-Color/compare/v0.5.0...v0.6.0) (2022-06-25)
|
13
|
+
|
14
|
+
|
15
|
+
### Features
|
16
|
+
|
17
|
+
* updating ci ([a50944c](https://www.github.com/TimHi/Compelementary-Color/commit/a50944c43d0dc3d3f996557b325a96ce17920aba))
|
18
|
+
|
19
|
+
## [0.5.0](https://www.github.com/TimHi/Compelementary-Color/compare/v0.4.0...v0.5.0) (2022-06-25)
|
20
|
+
|
21
|
+
|
22
|
+
### Features
|
23
|
+
|
24
|
+
* dummy commit to test action ([bf86695](https://www.github.com/TimHi/Compelementary-Color/commit/bf8669576ce8bb18f423d5d840353cee657a1fdd))
|
25
|
+
|
26
|
+
## [0.4.0](https://www.github.com/TimHi/Compelementary-Color/compare/v0.3.0...v0.4.0) (2022-06-25)
|
27
|
+
|
28
|
+
|
29
|
+
### Features
|
30
|
+
|
31
|
+
* test release ([eb004cd](https://www.github.com/TimHi/Compelementary-Color/commit/eb004cd523dbed9bf20d2b2d33eb0f4e1410771c))
|
32
|
+
|
33
|
+
## [0.3.0](https://www.github.com/TimHi/Compelementary-Color/compare/v0.2.0...v0.3.0) (2022-06-25)
|
34
|
+
|
35
|
+
|
36
|
+
### Features
|
37
|
+
|
38
|
+
* dummy commit to test action ([4aa8117](https://www.github.com/TimHi/Compelementary-Color/commit/4aa81179154c56334191525e4dccb5ca054ea440))
|
39
|
+
|
40
|
+
## [0.2.0](https://www.github.com/TimHi/Compelementary-Color/compare/v0.1.0...v0.2.0) (2022-06-25)
|
41
|
+
|
42
|
+
|
43
|
+
### Features
|
44
|
+
|
45
|
+
* adding new tests ([1c4807e](https://www.github.com/TimHi/Compelementary-Color/commit/1c4807e2a762d084bd0e089c0b09c31b2854b2b1))
|
46
|
+
|
47
|
+
## 0.1.0 (2022-06-25)
|
48
|
+
|
49
|
+
|
50
|
+
### Features
|
51
|
+
|
52
|
+
* dummy commit to test action ([6779bd9](https://www.github.com/TimHi/Compelementary-Color/commit/6779bd92d9621a8ba1a63e1868ae4f9f82fab89a))
|
53
|
+
|
5
54
|
## [0.1.0] - 2022-06-21
|
6
55
|
|
7
56
|
- Initial release
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# ColoR
|
2
2
|
|
3
|
+
[](https://badge.fury.io/rb/Complementary_Color)
|
4
|
+
[](https://github.com/TimHi/Compelementary-Color/actions/workflows/main.yml)
|
5
|
+
|
3
6
|
ColoR's main aspect is the creation of complementary color palettes. It also offers RGB to hex conversions.
|
4
7
|
|
5
8
|
## Installation
|
data/lib/color/hex.rb
CHANGED
@@ -9,7 +9,12 @@ module Hex
|
|
9
9
|
long_hex_color.downcase
|
10
10
|
end
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
# Test wether a given color is a valid hex color.
|
13
|
+
def self.hex?(color_to_test)
|
14
|
+
if color_to_test.is_a? String
|
15
|
+
color_to_test.match("^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$")
|
16
|
+
else
|
17
|
+
false
|
18
|
+
end
|
14
19
|
end
|
15
20
|
end
|
data/lib/color/version.rb
CHANGED
data/lib/color.rb
CHANGED
@@ -1,21 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "color/version"
|
4
|
+
require "color/error/hex_code_error"
|
4
5
|
|
5
6
|
# Offering functionality to get the complementary colors of a given input.
|
6
7
|
module ColoR
|
7
8
|
class Error < StandardError; end
|
8
9
|
|
9
|
-
# Error class to capture illegal hex codes being passed to the class.
|
10
|
-
class HexCodeError < StandardError
|
11
|
-
attr_reader :wrong_color
|
12
|
-
|
13
|
-
def initialize(wrong_color)
|
14
|
-
super
|
15
|
-
@wrong_color = wrong_color
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
10
|
def self.get_complementary_color(color)
|
20
11
|
raise HexCodeError.new("Not a valid Hex Color"), color unless ::Hex.hex?(color)
|
21
12
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Complementary_Color
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Hiller
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Create complementary colors based on a given color.
|
14
14
|
email:
|
@@ -24,17 +24,19 @@ files:
|
|
24
24
|
- README.md
|
25
25
|
- Rakefile
|
26
26
|
- lib/color.rb
|
27
|
+
- lib/color/error/hex_code_error.rb
|
27
28
|
- lib/color/hex.rb
|
28
29
|
- lib/color/rgb.rb
|
29
30
|
- lib/color/version.rb
|
30
31
|
- sig/color.rbs
|
31
32
|
homepage: https://github.com/TimHi/coloR
|
32
|
-
licenses:
|
33
|
+
licenses:
|
34
|
+
- AGPL-3.0-or-later
|
33
35
|
metadata:
|
34
36
|
homepage_uri: https://github.com/TimHi/coloR
|
35
37
|
source_code_uri: https://github.com/TimHi/coloR
|
36
38
|
changelog_uri: https://github.com/TimHi/coloR/blob/main/CHANGELOG.md
|
37
|
-
rubygems_mfa_required: '
|
39
|
+
rubygems_mfa_required: 'false'
|
38
40
|
post_install_message:
|
39
41
|
rdoc_options: []
|
40
42
|
require_paths:
|