This article or section may not have content matching Scratch Wiki editing standards. Please improve it according to Scratch Wiki:Guidelines and Scratch Wiki:Editing Conventions. (July 2019)
An example pen drawing.

Scratch's pen feature can be used to create line drawings, and it can also be used to fill the screen with a picture. This article will show some examples of how to draw pictures with the pen.

## Set Up

Please follow the instructions on this page to create the basic pen drawing script. The only block in the script that we will be interested in is this:

```set pen color to (Equation or Source)
```

## Color

Description Image
One of the nice things about the pen feature is that it can draw practically everything if you ensure that you draw the right colors in the right place. For right now, though, we will draw a green screen. In your pen script, use this:
```set pen color to (66)
```
The above example is plain. To make it more interesting, let's make it change color while drawing. In your pen script, use this:
```set pen color to (x position)
```

Notice how the colors form vertical stripes. That's because all points in a vertical stripe have the same x position.

Let's say you prefer horizontal stripes instead of vertical stripes. In your pen script, use this:
```set pen color to (y position)
```
One interesting twist on the above pen scripts is to add x position to y position. This generates slanted stripes. In your pen script, use this:
```set pen color to ((x position) + (y position))
```
Another option is to draw colored rings. In your pen script, use this:
```set pen color to (distance to [origin v])
```

This method requires that there is a sprite named "origin" at the center of the screen, which is at x=0 and y=0.

Description Image
Scratch has a lot of mathematical functions. Even if you don't understand what they do, they can produce some fun results! For example, sin creates waves. In your pen script, use this:
```set pen color to ((y position) + ((50) * ([sin v] of (x position))))
```
The function atan is great for making a color wheel. Here is how:
```set pen color to (([atan v] of ((y position) / (x position))) / (0.9))
```
Let's try mixing some of the pen drawings. What do you get when you mix a color wheel with rings? Try this to see:
```set pen color to ((([atan v] of ((y position) / (x position))) / (0.9)) + (distance to [origin v]))
```
Let's go further with mixing some of the pen drawings. What if we want wavy rings? Try this!
```set pen color to ((([atan v] of ((y position) / (x position))) / (0.9)) + ((20)* ([sin v] of ((10) * (distance to [origin v])))))
```
• Scroll to see the entire equation.

## Examples

There are many more things that you can do with the pen. Below are some relatively simple examples.

This is an example of one.