mercredi 22 juin 2022

How to generate a 500x500 pixel image in PIL with random place but i can choose what colors?

So for example I want the colors red, blue, and yellow in the 500x500 and the placement has to be random. I was looking at some posts and the documentation but couldn't really find it. With the image I'm going to convert it to a pygame surface using "pygame.image.fromstring".

it should be something like this but in 500x500 and the colors only should be randomized with red, blue and yellow, instead of all those random colors enter image description here

Thank You!




Aucun commentaire:

Enregistrer un commentaire