22 lines
527 B
Python
22 lines
527 B
Python
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')
|