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

Commit 9c1a50b

Browse files
author
DirectiveAthena
committed
Removed init.RoundUp
1 parent af30336 commit 9c1a50b

File tree

3 files changed

+14
-20
lines changed

3 files changed

+14
-20
lines changed

Tests/SpeedTest.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,16 @@ def TextNestedBig():
4444
StyleNest.Bold(
4545
StyleNest.Bold(
4646
"Bold"))))))))))
47-
return a
47+
return
48+
49+
def ObjectCreation():
50+
RGB(255, 255, 255)
4851

4952
if __name__ == '__main__':
50-
print(f"Conversion:{ForeNest.Red(timeit.repeat(lambda: Conversion(), number=1_000_000, repeat=5))}")
51-
print(f"ConversionInline:{ForeNest.Red(timeit.repeat(lambda: ConversionInline(), number=1_000_000, repeat=5))}")
53+
# print(f"Conversion:{ForeNest.Red(timeit.repeat(lambda: Conversion(), number=1_000_000, repeat=5))}")
54+
# print(f"ConversionInline:{ForeNest.Red(timeit.repeat(lambda: ConversionInline(), number=1_000_000, repeat=5))}")
5255
# print(f"TextInline:{ForeNest.Red(timeit.repeat(lambda: TextInline(), number=1_000_000, repeat=5))}")
5356
# print(f"TextNested:{ForeNest.Red(timeit.repeat(lambda: TextNested(), number=1_000_000, repeat=5))}")
5457
# print(f"TextNestedBig:{ForeNest.Red(timeit.repeat(lambda: TextNestedBig(), number=1_000_000, repeat=5))}")
58+
print(f"ObjectCreation:{ForeNest.Red(timeit.repeat(lambda: ObjectCreation(), number=1_000_000, repeat=5))}")
5559

src/AthenaColor/InitClass.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,6 @@ def __init__(self):
3333
if sys.platform == 'win32':
3434
os.system("color")
3535

36-
@property
37-
def roundUp(self):
38-
return self._roundUp
39-
@roundUp.setter
40-
def roundUp(self,value:bool):
41-
if isinstance(value,bool):
42-
self._roundUp = value
43-
else:
44-
raise ValueError
45-
4636
@property
4737
def esc(self):
4838
return self._esc

src/AthenaColor/Objects/Color/ColorSystem.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,21 +189,21 @@ def r(self) -> int:
189189
return self._r
190190
@r.setter
191191
def r(self, value: int|float):
192-
self._r = RoundHalfUp(Constrain(value, 255)) if init.roundUp else round(Constrain(value, 255))
192+
self._r = round(Constrain(value, 255))
193193

194194
@property
195195
def g(self) -> int:
196196
return self._g
197197
@g.setter
198198
def g(self, value: int|float):
199-
self._g = RoundHalfUp(Constrain(value, 255)) if init.roundUp else round(Constrain(value, 255))
199+
self._g = round(Constrain(value, 255))
200200

201201
@property
202202
def b(self) -> int:
203203
return self._b
204204
@b.setter
205205
def b(self, value: int|float):
206-
self._b = RoundHalfUp(Constrain(value, 255)) if init.roundUp else round(Constrain(value, 255))
206+
self._b = round(Constrain(value, 255))
207207

208208
# ------------------------------------------------------------------------------------------------------------------
209209
# MAGIC Methods
@@ -296,29 +296,29 @@ def r(self) -> int:
296296
return self._r
297297
@r.setter
298298
def r(self, value: int|float):
299-
self._r = RoundHalfUp(Constrain(value, 255)) if init.roundUp else round(Constrain(value, 255))
299+
self._r = round(Constrain(value, 255))
300300

301301
@property
302302
def g(self) -> int:
303303
return self._g
304304
@g.setter
305305
def g(self, value: int|float):
306-
self._g = RoundHalfUp(Constrain(value, 255)) if init.roundUp else round(Constrain(value, 255))
306+
self._g = round(Constrain(value, 255))
307307

308308
@property
309309
def b(self) -> int:
310310
return self._b
311311
@b.setter
312312
def b(self, value: int|float):
313-
self._b = RoundHalfUp(Constrain(value, 255)) if init.roundUp else round(Constrain(value, 255))
313+
self._b = round(Constrain(value, 255))
314314

315315

316316
@property
317317
def a(self) -> int:
318318
return self._a
319319
@a.setter
320320
def a(self, value: int|float):
321-
self._a = RoundHalfUp(Constrain(value, 255)) if init.roundUp else round(Constrain(value, 255))
321+
self._a = round(Constrain(value, 255))
322322
# ------------------------------------------------------------------------------------------------------------------
323323
# MAGIC Methods
324324
# ------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)