Major refactors

This commit is contained in:
Akko
2023-05-17 16:27:52 +02:00
parent e157af78bf
commit 6379bc5962
10 changed files with 209 additions and 353 deletions

View File

@@ -1,4 +1,6 @@
#!/usr/bin/env ipython
from types import FunctionType
def clamp(val, low, high):
return min(high, max(low, val))
@@ -10,3 +12,14 @@ def rgb2hex(r, g, b, a=None):
int(b * 255)
)
return hex_value
def any_map(f: FunctionType, lst: list):
result = []
for itm in lst:
if isinstance(itm, list):
result.append(any_map(f, itm))
else:
result.append(f(itm))
return result