"Set Pen Color to ()" redirects here. For the obsolete block with a number input, see Set Pen Color to () (number input block).
Set Pen Color to ()
set pen color to [#ff0000]
Category Pen
Type Stack

The Set Pen Color to () block is a Pen block and stack block. The block sets the pen's color to the given color, which can be selected by clicking on the input.

Example Uses

As this block can change the pen's color, it is mainly used when the pen is drawing something and a different color is desired.

Some common uses for the Set Pen Color to () block are:

  • Creating different objects by using different pen colors (such as a tile that can be colored to look like ice or fire)
  • Choosing the color of objects drawn by the pen
set pen color to [#3aff8c]
repeat until <not <mouse down?>>
    go to (mouse-pointer v)
end

Although this block has a color picker, it can also be used by inputting a hex color code.

when green flag clicked
set pen color to (join [ #2600ff][]

It could also be used to change the pen color to the hex color entered by the user.

when [space v] key pressed
ask [What hex color to change the pen to?] and wait
set pen color to (answer)

See Also

Cookies help us deliver our services. By using our services, you agree to our use of cookies.