-
Notifications
You must be signed in to change notification settings - Fork 0
/
MakePalette.py
36 lines (32 loc) · 1.08 KB
/
MakePalette.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def makePalette(permutations):
print("[")
for i0 in range(permutations):
for i1 in range(permutations):
for i2 in range(permutations):
i=[i0,i1,i2]
print("\t(", end="")
for j in range(3):
intensity = 255 // (permutations - 1) * i[j]
print(intensity, end="")
if j != 2:
print(", ", end="")
if (i[0] == permutations-1 and i[1] == permutations-1 and i[2] == permutations-1):
print(")")
else:
print("),")
print("]")
def makeMonoPalette(permutations, screenColor):
print("[")
for i in range(permutations):
print("\t(", end="")
for j in range(3):
intensity = 255 // (permutations-1) * i
print(intensity*screenColor[j]//255, end="")
if j != 2:
print (", ", end="")
if (i == permutations-1):
print(")")
else:
print("),")
print("]")
makePalette((112, 66, 20))