Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

arrow_back Color Picker (Part 2 of 2)

Transcript

In this add-on, you will program a special rainbow button in the artist’s color palette.

The button uses a forever loop to constantly change the pen color, so, once the rainbow color is selected, it’s the only one that can be used to draw.

Start by selecting dot2, the costume tab, and the rainbow costume.

Next, select the scripts tab.

When this sprite is clicked, it should broadcast a new message.

Change the message that says "green" to "rainbow."

Then, click the pencil, and change the "when I receive" message to "rainbow."

Next, click the pen menu.

To make the pen appear like a rainbow, use a "change pen color by" block.

Every color in Scratch has a number value.

This block changes the colors based on those values.

Click the control menu, and place a forever loop around this block.

When this runs, it will constantly change the color of the pen.

Try it out now.

Click the flag and the rainbow sprite.

Awesome!

The pencil now draws as a rainbow! Tinker with the value in the "set pen color" block until you get an effect that you like.

Now it’s your turn: Select the rainbow costume in sprite 2.

Broadcast the message "rainbow" when the rainbow sprite is clicked.

Program the pen to constantly change colors using the "change pen color by" block and forever loop.

Choose an Add-On
Color Picker (Part 1 of 2)
Lets the user change the color of the pen.
Color Picker (Part 2 of 2)
Lets the user change the color of the pen.
Pen Size Adjustment
Allow the users to change the size of the pen.
Monkey Animation
Make the Monkey do a little dance and introduce the game.
Draw inside the lines
Make it impossible to draw outside the white spaces.
Sound Effects
Add sound to your game.
arrow_backward Back
Next arrow_forward
Instructions
  1. Choose an Add-On, and click "watch" to learn how to build it.
  2. Once you finish one Add-On, try another one below the video!