title: How to draw pixels of a specific color in Python?
body: <p>Currently, my program uses a square image of a color from Google and displays it on the screen. I get to choose its dimensions. However, I want to use pixels instead and assign different colors based on some variable (for example, if n=1, color=blue; if n=2, color=red). Then I would just make my program make a square of some size using the pixels (like choosing the dimensions of the picture). To add more context look at the image below.</p>
  <p><a href="https://i.stack.imgur.com/8ONsr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8ONsr.png" alt="enter image description here" /></a></p>
  <p>This square is made up of square images of the color red or blue. However, I call a draw function that scales down the image and displays it hundreds of times. This is not efficient at all and takes a lot of time to draw large squares. Additionally, if I want to add a new color I have to download the image and code everything again. Instead, I want my program to just take a value, for example, n=6, and then it will draw the square but with 6 different colors. I know how to do that, I just don't know how to make a pixel of a specific color.</p>