Book Image

Scratch 2.0 Beginner's Guide: Second Edition

By : Michael Badger
Book Image

Scratch 2.0 Beginner's Guide: Second Edition

By: Michael Badger

Overview of this book

Table of Contents (18 chapters)
Scratch 2.0 Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – coloring our shapes


Let's take a moment to add some color to our drawing by performing the following steps:

  1. In the stack that begins with when (d) key pressed, add a set pen color to () block from the Pen palette below the set pen size to (pen size) block. Enter a value of 15.

    Note

    There are two set pen color to () blocks. One is a color picker, and the other block takes a number input.

  2. Now draw a shape, and you'll see that the shape is in orange color.

  3. Find the set pen shade to () block, and add it after the set pen color to () block. Change the shade value to 25.

  4. Draw the shape again while leaving the color value set to 15. The color of the shape has now changed based on the shade.

  5. Let's iterate through several colors by adding a change pen shade by () block inside the end of the repeat (revs) block. Set its value to 25.

  6. Now draw the shape again, and observe the color change as each pattern gets drawn. Our script looks like the following screenshot:

What just happened?

When we...