Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit 50ffadf

Browse files
authored
Merge pull request #22 from DirectiveAthena/v6.0.0_Proposal
V6.0.0 proposal
2 parents bed797b + 2d62ac6 commit 50ffadf

39 files changed

+702
-776
lines changed

Tests/ColorObjects/test_ColorObjectConversions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import unittest
77

88
# Custom Library
9-
from AthenaColor.Color.ColorObjectConversion import *
10-
from AthenaColor.Color.ColorSystem import RGB,HEX,CMYK,HSL,HSV,RGBA,HEXA
9+
from AthenaColor import *
10+
from AthenaColor.functions.color_object_conversion import *
1111

1212
# Custom Packages
1313
# ----------------------------------------------------------------------------------------------------------------------
@@ -101,7 +101,7 @@ def test_to_hsv(self):
101101
for value, output_value in cases:
102102
with self.subTest(value=value, output_value=output_value):
103103
self.assertEqual(
104-
to_HSV(value),
104+
HSV(*(round(n, 3) for n in to_HSV(value))),
105105
output_value
106106
)
107107

@@ -119,7 +119,7 @@ def test_to_hsl(self):
119119
for value, output_value in cases:
120120
with self.subTest(value=value, output_value=output_value):
121121
self.assertEqual(
122-
to_HSL(value),
122+
HSL(*(round(n, 3) for n in to_HSL(value))),
123123
output_value
124124
)
125125

@@ -137,7 +137,7 @@ def test_to_cmyk(self):
137137
for value, output_value in cases:
138138
with self.subTest(value=value, output_value=output_value):
139139
self.assertEqual(
140-
to_CMYK(value),
140+
CMYK(*(round(n, 3) for n in to_CMYK(value))),
141141
output_value
142142
)
143143

Tests/ColorObjects/test_ColorTupleConversions.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import unittest
77

88
# Custom Library
9-
from AthenaColor.Color.ColorTupleConversion import *
9+
from AthenaColor.functions.color_tuple_conversion import *
1010

1111
# Custom Packages
1212
# ----------------------------------------------------------------------------------------------------------------------
@@ -16,7 +16,7 @@ class ColorObject_TupleConversion(unittest.TestCase):
1616
def test_NormalizeRgb(self):
1717
for i in range(256):
1818
with self.subTest(i=i):
19-
NormalizeRgb(i,i,i)
19+
normalize_rgb(i, i, i)
2020

2121
def test_hex_to_rgb(self):
2222
cases = (
@@ -157,7 +157,7 @@ def test_rgb_to_hsv(self):
157157
for rgb_value, hsv_value in cases:
158158
with self.subTest(rgb_value=rgb_value, hsv_value=hsv_value):
159159
self.assertEqual(
160-
rgb_to_hsv(*rgb_value),
160+
(*(round(n,3) for n in rgb_to_hsv(*rgb_value)),),
161161
hsv_value
162162
)
163163

@@ -173,7 +173,7 @@ def test_hex_to_hsv(self):
173173
for hex_value, hsv_value in cases:
174174
with self.subTest(hex_value=hex_value, hsv_value=hsv_value):
175175
self.assertEqual(
176-
hex_to_hsv(hex_value),
176+
(*(round(n,3) for n in hex_to_hsv(hex_value)),),
177177
hsv_value
178178
)
179179

@@ -189,7 +189,7 @@ def test_cmyk_to_hsv(self):
189189
for cmyk_value, hsv_value in cases:
190190
with self.subTest(cmyk_value=cmyk_value, hsv_value=hsv_value):
191191
self.assertEqual(
192-
cmyk_to_hsv(*cmyk_value),
192+
(*(round(n, 3) for n in cmyk_to_hsv(*cmyk_value)),),
193193
hsv_value
194194
)
195195

@@ -205,7 +205,7 @@ def test_hsl_to_hsv(self):
205205
for hsl_value, hsv_value in cases:
206206
with self.subTest(hsl_value=hsl_value, hsv_value=hsv_value):
207207
self.assertEqual(
208-
hsl_to_hsv(*hsl_value),
208+
(*(round(n,3) for n in hsl_to_hsv(*hsl_value)),),
209209
hsv_value
210210
)
211211

@@ -221,7 +221,7 @@ def test_rgb_to_cmyk(self):
221221
for rgb_value, cmyk_value in cases:
222222
with self.subTest(cmyk_value=cmyk_value, rgb_value=rgb_value):
223223
self.assertEqual(
224-
rgb_to_cmyk(*rgb_value),
224+
(*(round(n,3) for n in rgb_to_cmyk(*rgb_value)),),
225225
cmyk_value
226226
)
227227

@@ -237,7 +237,7 @@ def test_hex_to_cmyk(self):
237237
for hex_value, cmyk_value in cases:
238238
with self.subTest(cmyk_value=cmyk_value, hex_value=hex_value):
239239
self.assertEqual(
240-
hex_to_cmyk(hex_value),
240+
(*(round(n, 3) for n in hex_to_cmyk(hex_value)),),
241241
cmyk_value
242242
)
243243

@@ -253,7 +253,7 @@ def test_hsv_to_cmyk(self):
253253
for hsv_value, cmyk_value in cases:
254254
with self.subTest(cmyk_value=cmyk_value, hsv_value=hsv_value):
255255
self.assertEqual(
256-
hsv_to_cmyk(*hsv_value),
256+
(*(round(n,3) for n in hsv_to_cmyk(*hsv_value)),),
257257
cmyk_value
258258
)
259259

@@ -269,7 +269,7 @@ def test_rgb_to_hsl(self):
269269
for rgb_value, hsl_value in cases:
270270
with self.subTest(rgb_value=rgb_value, hsl_value=hsl_value):
271271
self.assertEqual(
272-
rgb_to_hsl(*rgb_value),
272+
(*(round(n,3) for n in rgb_to_hsl(*rgb_value)),),
273273
hsl_value
274274
)
275275

@@ -285,7 +285,7 @@ def test_hex_to_hsl(self):
285285
for hex_value, hsl_value in cases:
286286
with self.subTest(hex_value=hex_value, hsl_value=hsl_value):
287287
self.assertEqual(
288-
hex_to_hsl(hex_value),
288+
(*(round(n,3) for n in hex_to_hsl(hex_value)),),
289289
hsl_value
290290
)
291291

@@ -301,7 +301,7 @@ def test_hsv_to_hsl(self):
301301
for hsv_value, hsl_value in cases:
302302
with self.subTest(hsl_value=hsl_value, hsv_value=hsv_value):
303303
self.assertEqual(
304-
hsv_to_hsl(*hsv_value),
304+
(*(round(n,3) for n in hsv_to_hsl(*hsv_value)),),
305305
hsl_value
306306
)
307307

@@ -317,7 +317,7 @@ def test_cmyk_to_hsl(self):
317317
for cmyk_value, hsl_value in cases:
318318
with self.subTest(cmyk_value=cmyk_value, hsl_value=hsl_value):
319319
self.assertEqual(
320-
cmyk_to_hsl(*cmyk_value),
320+
(*(round(n, 3) for n in cmyk_to_hsl(*cmyk_value)),),
321321
hsl_value
322322
)
323323

Tests/ColorObjects/test_Dunders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import operator
88

99
# Custom Library
10-
from AthenaColor import RGB, RGBA, HEX, HEXA, HSL, HSV, CMYK
10+
from AthenaColor import *
1111

1212
# Custom Packages
1313
from Tests.BulkTests import BulkTests

Tests/ColorObjects/test_HSL.py

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -46,31 +46,31 @@ def test_dunder_tuples(self):
4646

4747
# math
4848
self.assertEqual(
49-
round(color + (.25,.25,.25),init.decimalPlaces),
49+
round(color + (.25,.25,.25),3),
5050
HSL(60.25,0.75,1.0)
5151
)
5252
self.assertEqual(
53-
round(color - (.25,.5,0.75),init.decimalPlaces),
53+
round(color - (.25,.5,0.75),3),
5454
HSL(59.75,0.0,0.0)
5555
)
5656
self.assertEqual(
57-
round(color * (.1,.5,0.75),init.decimalPlaces),
57+
round(color * (.1,.5,0.75),3),
5858
HSL(6.0,0.25,0.562)
5959
)
6060
self.assertEqual(
61-
round(color / (.1,.5,0.75),init.decimalPlaces),
61+
round(color / (.1,.5,0.75),3),
6262
HSL(360,1.0,1.0)
6363
)
6464
self.assertEqual(
65-
round(color // (.1,.5,0.75),init.decimalPlaces),
65+
round(color // (.1,.5,0.75),3),
6666
HSL(360,1.0,1.0)
6767
)
6868
self.assertEqual(
69-
round(color ** (.1,.5,0.75),init.decimalPlaces),
69+
round(color ** (.1,.5,0.75),3),
7070
HSL(1.506,0.707,0.806)
7171
)
7272
self.assertEqual(
73-
round(color % (.1,.5,0.75),init.decimalPlaces),
73+
round(color % (.1,.5,0.75),3),
7474
HSL(0.1, 0.0, 0.0)
7575
)
7676

@@ -87,31 +87,31 @@ def test_dunder_RGB(self):
8787

8888
# math
8989
self.assertEqual(
90-
round(color + RGB(32, 64, 128),init.decimalPlaces),
90+
round(color + RGB(32, 64, 128),3),
9191
HSL(280.0,1,1)
9292
)
9393
self.assertEqual(
94-
round(color - RGB(32, 64, 128),init.decimalPlaces),
94+
round(color - RGB(32, 64, 128),3),
9595
HSL(0,0,0.436)
9696
)
9797
self.assertEqual(
98-
round(color * RGB(4, 3, 2),init.decimalPlaces),
98+
round(color * RGB(4, 3, 2),3),
9999
HSL(360,0.167,0.009)
100100
)
101101
self.assertEqual(
102-
round(color / RGB(4, 3, 2),init.decimalPlaces),
102+
round(color / RGB(4, 3, 2),3),
103103
HSL(2.0,1,1)
104104
)
105105
self.assertEqual(
106-
round(color // RGB(9, 7, 5),init.decimalPlaces),
106+
round(color // RGB(9, 7, 5),3),
107107
HSL(2.0,1.0,1)
108108
)
109109
self.assertEqual(
110-
round(color ** RGB(2, 2, 1),init.decimalPlaces),
110+
round(color ** RGB(2, 2, 1),3),
111111
HSL(360, 0.794, 0.998)
112112
)
113113
self.assertEqual(
114-
round(color % RGB(9, 7, 5),init.decimalPlaces),
114+
round(color % RGB(9, 7, 5),3),
115115
HSL(0.0, 0.214, 0.021)
116116
)
117117

@@ -127,31 +127,31 @@ def test_dunder_HEX(self):
127127

128128
# math
129129
self.assertEqual(
130-
round(color + HEX("#204080"),init.decimalPlaces),
130+
round(color + HEX("#204080"),3),
131131
HSL(280.0, 1, 1)
132132
)
133133
self.assertEqual(
134-
round(color - HEX("#204080"),init.decimalPlaces),
134+
round(color - HEX("#204080"),3),
135135
HSL(0, 0, 0.436)
136136
)
137137
self.assertEqual(
138-
round(color * HEX("#040302"),init.decimalPlaces),
138+
round(color * HEX("#040302"),3),
139139
HSL(360, 0.167, 0.009)
140140
)
141141
self.assertEqual(
142-
round(color / HEX("#040302"),init.decimalPlaces),
142+
round(color / HEX("#040302"),3),
143143
HSL(2.0, 1, 1)
144144
)
145145
self.assertEqual(
146-
round(color // HEX("#090705"),init.decimalPlaces),
146+
round(color // HEX("#090705"),3),
147147
HSL(2.0, 1.0, 1)
148148
)
149149
self.assertEqual(
150-
round(color ** HEX("#020201"),init.decimalPlaces),
150+
round(color ** HEX("#020201"),3),
151151
HSL(360, 0.794, 0.998)
152152
)
153153
self.assertEqual(
154-
round(color % HEX("#090705"),init.decimalPlaces),
154+
round(color % HEX("#090705"),3),
155155
HSL(0.0, 0.214, 0.021)
156156
)
157157

@@ -167,31 +167,31 @@ def test_dunder_HSL(self):
167167

168168
# math
169169
self.assertEqual(
170-
round(color + HSL(.25,.25,.25),init.decimalPlaces),
170+
round(color + HSL(.25,.25,.25),3),
171171
HSL(60.25,0.75,1.0)
172172
)
173173
self.assertEqual(
174-
round(color - HSL(.25,.5,0.75),init.decimalPlaces),
174+
round(color - HSL(.25,.5,0.75),3),
175175
HSL(59.75,0.0,0.0)
176176
)
177177
self.assertEqual(
178-
round(color * HSL(.1,.5,0.75),init.decimalPlaces),
178+
round(color * HSL(.1,.5,0.75),3),
179179
HSL(6.0,0.25,0.562)
180180
)
181181
self.assertEqual(
182-
round(color / HSL(.1,.5,0.75),init.decimalPlaces),
182+
round(color / HSL(.1,.5,0.75),3),
183183
HSL(360,1.0,1.0)
184184
)
185185
self.assertEqual(
186-
round(color // HSL(.1,.5,0.75),init.decimalPlaces),
186+
round(color // HSL(.1,.5,0.75),3),
187187
HSL(360,1.0,1.0)
188188
)
189189
self.assertEqual(
190-
round(color ** HSL(.1,.5,0.75),init.decimalPlaces),
190+
round(color ** HSL(.1,.5,0.75),3),
191191
HSL(1.506,0.707,0.806)
192192
)
193193
self.assertEqual(
194-
round(color % HSL(.1,.5,0.75),init.decimalPlaces),
194+
round(color % HSL(.1,.5,0.75),3),
195195
HSL(0.1, 0.0, 0.0)
196196
)
197197

@@ -207,31 +207,31 @@ def test_dunder_HSV(self):
207207

208208
# math
209209
self.assertEqual(
210-
round(color + HSV(.25, .25, .25),init.decimalPlaces),
210+
round(color + HSV(.25, .25, .25),3),
211211
HSL(60.0,0.643,0.97)
212212
)
213213
self.assertEqual(
214-
round(color - HSV(.25, .5, 0.75),init.decimalPlaces),
214+
round(color - HSV(.25, .5, 0.75),3),
215215
HSL(60.0,0.074,0.187)
216216
)
217217
self.assertEqual(
218-
round(color * HSV(.1, .5, 0.75),init.decimalPlaces),
218+
round(color * HSV(.1, .5, 0.75),3),
219219
HSL(0.0,0.213,0.422)
220220
)
221221
self.assertEqual(
222-
round(color / HSV(30, .5, 0.75),init.decimalPlaces),
222+
round(color / HSV(30, .5, 0.75),3),
223223
HSL(2,1,1)
224224
)
225225
self.assertEqual(
226-
round(color // HSV(30, .5, 0.75),init.decimalPlaces),
226+
round(color // HSV(30, .5, 0.75),3),
227227
HSL(2.0,1.0,1.0)
228228
)
229229
self.assertEqual(
230-
round(color ** HSV(.1, .5, 0.75),init.decimalPlaces),
230+
round(color ** HSV(.1, .5, 0.75),3),
231231
HSL(1.0, 0.744, 0.85)
232232
)
233233
self.assertEqual(
234-
round(color % HSV(30, .5, 0.75),init.decimalPlaces),
234+
round(color % HSV(30, .5, 0.75),3),
235235
HSL(0,0.074,0.187)
236236
)
237237

@@ -247,30 +247,30 @@ def test_dunder_CMYK(self):
247247

248248
# math
249249
self.assertEqual(
250-
round(color + CMYK(.9,.9,.75,.1),init.decimalPlaces),
250+
round(color + CMYK(.9,.9,.75,.1),3),
251251
HSL(300.0,0.925,0.907)
252252
)
253253
self.assertEqual(
254-
round(color - CMYK(.9,.9,.75,.1),init.decimalPlaces),
254+
round(color - CMYK(.9,.9,.75,.1),3),
255255
HSL(0,0.075,0.593)
256256
)
257257
self.assertEqual(
258-
round(color * CMYK(.9,.9,.75,.9),init.decimalPlaces),
258+
round(color * CMYK(.9,.9,.75,.9),3),
259259
HSL(360,0.167,0.013)
260260
)
261261
self.assertEqual(
262-
round(color / CMYK(.9,.9,.75,.9),init.decimalPlaces),
262+
round(color / CMYK(.9,.9,.75,.9),3),
263263
HSL(0.25,1,1)
264264
)
265265
self.assertEqual(
266-
round(color // CMYK(.9,.9,.75,.9),init.decimalPlaces),
266+
round(color // CMYK(.9,.9,.75,.9),3),
267267
HSL(0.0,1.0,1)
268268
)
269269
self.assertEqual(
270-
round(color ** CMYK(.01,.1,.1,.2),init.decimalPlaces),
270+
round(color ** CMYK(.01,.1,.1,.2),3),
271271
HSL(1.0,0.904,0.804)
272272
)
273273
self.assertEqual(
274-
round(color % CMYK(0.75,0.25,0.25,0.15),init.decimalPlaces),
274+
round(color % CMYK(0.75,0.25,0.25,0.15),3),
275275
HSL(60.0,0.5,0.325)
276276
)

0 commit comments

Comments
 (0)