We continue with our tiny drawing program. The first version saved the image when you pressed any key on the keyboard. Now we check which key was pressed by reading the *key* variable. If we pressed *s*, we save the image. If the *b* key was pressed, we change the background color. And the *c* key changes the line color.
The background color is easy to see, but we don't know about the line color until we draw something. It would be nice to know about our line color *before* drawing anything. To solve this, we draw a thin line on the top border of our drawing which lets us see the current color.
Finally, we show how creating a function can avoid having repeated lines of code. We create a function that draws a line on the top border of the screen, and we call this function in two cases: after setting the background color, and after setting the line (stroke) color.