diff --git a/companion_software/images/main.py b/companion_software/images/main.py new file mode 100644 index 0000000..75c36bf --- /dev/null +++ b/companion_software/images/main.py @@ -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) diff --git a/companion_software/main.py b/companion_software/main.py deleted file mode 100644 index d2635bf..0000000 --- a/companion_software/main.py +++ /dev/null @@ -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')