18 lines
760 B
Python
18 lines
760 B
Python
def getRGBfromI(RGBint):
|
|
blue = RGBint & 255
|
|
green = (RGBint >> 8) & 255
|
|
red = (RGBint >> 16) & 255
|
|
return red, green, blue
|
|
|
|
mx = pow(2,24)-1 # i.e. 16777215
|
|
|
|
x = 0
|
|
alphabet = ["A", "Á", "Ä", "B", "C", "Č", "D", "Ď", "E", "É", "F", "G", "H", "CH", "I", "Í", "J", "K", "L", "Ĺ", "Ľ", "M", "N", "Ň", "O", "Ó", "Ô", "P", "Q", "R", "Ŕ", "S", "Š", "T", "Ť", "U", "Ú", "V", "W", "X", "Y", "Ý", "Z", "Ž"]
|
|
interval = int(mx/(len(alphabet)))
|
|
with open("gen.sh", "w") as f:
|
|
for i in range(0, len(alphabet)):
|
|
red, green, blue = getRGBfromI(i*interval)
|
|
letter = alphabet[x]
|
|
f.write("convert -size 32x32 xc:rgb\(" + str(red) + "," + str(green) + "," + str(blue) + "\) " + letter +".png\n")
|
|
x = x + 1
|