mirror of
https://codeberg.org/vlw/crtjs.git
synced 2025-09-13 18:03:40 +02:00
27 lines
No EOL
448 B
Python
27 lines
No EOL
448 B
Python
import random
|
|
|
|
def rand():
|
|
dec = random.randint(0,255)
|
|
tohex = str(hex(dec).split("x")[-1])
|
|
|
|
if(dec < 16):
|
|
tohex = "0" + tohex
|
|
|
|
return tohex
|
|
|
|
def randomColor():
|
|
pixel = rand() + rand() + rand()
|
|
return f"\"#{pixel}\""
|
|
|
|
# ----
|
|
|
|
file = open("data.json","a+")
|
|
file.write("[")
|
|
|
|
# 3 Seconds of 64x64px@10fps uncompressed video (~7MB)
|
|
for x in range(737280):
|
|
file.write(randomColor() + ",")
|
|
|
|
file.write(randomColor())
|
|
file.write("]")
|
|
file.close() |