Revision as of 11:46, 20 May 2018 by Kenny2scratch (talk | contribs) (improved according to Scratch Wiki:Style Guide and removed template) (canned edit summary)

Change Pen Color by ()
2.0 Change Pen Color by ().png
Category Pen
Type Stack

The Change Pen Color by () block is a Pen block and a Stack block. The block increments or decrements the pen's color by the specified value. The color value holds 200 different values of colors (0 to 199, inclusive), so color 200 is the same as color 0. In other words, changing the pen color by 200 color will not change the appearance of the pen.

Example Uses

In projects that use the pen, the pen must have a certain color (no transparency allowed) — this block can change it.

Some common uses for the Change Pen Color by () block are:

  • Iterating through pen color values while the sprite is moved to create colorful art
if <((timer) mod (1)) = [0]> then
change pen color by (1)
  • Varying pen colors for an art program
change pen color by (loudness)
wait (2) secs
  • In projects that "draw" objects with the pen, changing the color of the object(s)
repeat (360)
move (1) steps
turn cw (1) degrees
change pen color by ((2) / (3.6))


This block cannot be replicated with other Scratch blocks, due to the fact that there is no block that holds the pen color.

However, if the block existed, the Change Pen Color by () block could be replaced with the following code:

set pen color to ((pen color) + (amount))

(This is in fact how Scratch handles pen color internally.)

One can use the workaround, though it requires a "pen color" variable and the following script:

when gf clicked
set pen color to (pen color)

To set the pen color, use the Set () to () block; to change it, use the Change () by () block.

See Also

Document stub.png This page no longer has any use and needs to be deleted. The user who added this template does not have permission to delete the page. (Date?)
Reason for deletion: Template:Pen Extension should be moved here as this is the standard name
Admins and Experienced Wikians: remember to check the page history, what links here, patrol all unpatrolled edits, then delete this page.
#REDIRECT Template:Pen Extension