Upgrade to fancy color changing test pattern while remote

This commit is contained in:
Kenwood 2021-08-20 14:30:02 -04:00
parent 8ac68b6ab0
commit b50cfeaac8
2 changed files with 23 additions and 21 deletions

View File

@ -0,0 +1,23 @@
import time
from PIL import Image, ImageDraw
def testScreen(x=1280, y=720, image=None, stripeList = ["red", "green", "blue", "orange", "purple"]):
if image == None:
image = Image.new("RGB", (x, y))
draw = ImageDraw.Draw(image)
for i, stripe in enumerate(stripeList):
draw.rectangle((
(x/len(stripeList)) * i, 0,
(x/len(stripeList)) * (i + 1), x),
fill=stripe)
return image
if __name__ == '__main__':
masterList = ["red", "white", "blue", "green", "orange", "purple", "cyan", "magenta"]
while True:
for i in range(len(masterList)):
testScreen(stripeList=masterList[i:]).save('Test-Pattern.png')
time.sleep(1)

View File

@ -1,21 +0,0 @@
from PIL import Image, ImageDraw
def testScreen(x=1280, y=720, image=None):
if image == None:
image = Image.new("RGB", (x, y))
draw = ImageDraw.Draw(image)
stripeList = ["red", "green", "blue", "orange", "purple"]
for i, stripe in enumerate(stripeList):
draw.rectangle((
(x/len(stripeList)) * i, 0,
(x/len(stripeList)) * (i + 1), x),
fill=stripe)
return image
if __name__ == '__main__':
print('running')
testScreen().save('test_screen.png')