commit c8a4483c783556d57237a45f5f9e07d668396120 Author: joak Date: Mon Jan 22 14:36:10 2024 +0100 init diff --git a/colorroute.py b/colorroute.py new file mode 100644 index 0000000..9b2da02 --- /dev/null +++ b/colorroute.py @@ -0,0 +1,89 @@ +import os + +for x in range(0, 256): + namex = hex(x).lstrip("0x") + nextx = hex(x+1).lstrip("0x") + while len(namex) < 2: + namex = "0" + namex + while len(nextx) < 2: + nextx = "0" + nextx + if x is 255: + nextx = "00" + + if not os.path.exists(namex): + os.makedirs(namex) + + for y in range(0, 256): + namey = hex(y).lstrip("0x") + nexty = hex(y+1).lstrip("0x") + while len(namey) < 2: + namey = "0" + namey + while len(nexty) < 2: + nexty = "0" + nexty + if y is 255: + nexty = "00" + if not os.path.exists(namex+"/"+namey): + os.makedirs(namex+"/"+namey) + + for z in range(0, 256): + namez = hex(z).lstrip("0x") + nextz = hex(z+1).lstrip("0x") + while len(namez) < 2: + namez = "0" + namez + while len(nextz) < 2: + nextz = "0" + nextz + if z is 255: + nextz = "00" + color = namex + namey + namez + + file=open(namex+"/"+namey+"/"+namez+".html","w+") + if x is 255 and y is 255 and z is 255: + file.write(""" + + + + +the famous color route #"""+color+""" + + +
+ +""") + elif y is 255 and z is 255: + file.write(""" + + + + +the famous color route #"""+color+""" + + + +""") + + elif z is 255: + file.write(""" + + + + +the famous color route #"""+color+""" + + + +""") + + else: + file.write(""" + + + + +the famous color route #"""+color+""" + + + +""") + file.close() + print (namex+" "+namey+" "+namez) +