How to change the color of a custom block

How to change the color of a custom block
In this tutorial, we will learn how to change the color of a custom block

:blue_square: :blue_square: :blue_square: :blue_square: :blue_square: :blue_square: :blue_square: :blue_square: :blue_square: :blue_square: :blue_square: :blue_square: :blue_square: :blue_square: :blue_square:

Step one
Go to the snap homepage and click "Run Snap!"

step two
Click the "make a block" button

THE FINAL STEP
Click one of the category buttons in the black box

  • Clicking Motion will make your block blue.
  • Clicking Looks will make your block purple.
  • Clicking Sound will make your block pink.
  • Clicking Pen will make your block dark green.
  • Clicking Lists will made your block's color in between red and orange.
  • Clicking Control will make your block yellow.
  • Clicking Sensing will make your block light blue.
  • Clicking Operators will make your block green.
  • Clicking Variables will make your block orange.
  • Clicking Other will make your block grey

That's it for now, hope you enjoyed this tutorial! :wink:

btw no pictures because it said I can't mention media

You can also use a custom color by

  1. Right click the blocks pallet
  2. Click on "New category"
  3. Create a name for your category
  4. Select a color from the color picker on the right of the category name input. You can right click the color selector to input specific rgb value.
  5. Click ok
  6. Set the category of your block to your new category.

And you can change the category color by:

  1. Use "New category" on the block palette menu or :file_icon:
  2. Create a new category with the same name and replace the color
  3. Click OK

The blocks in the category may stay in the last color until updated. Same with any script in the scripts area.

Actually this topic is (or should be) about two different subjects:

  1. How to move a block to a different category;
  2. How to change a category's colour.

1. How to move a block to a different category?
There are two ways to move a custom block to a different category:
A. by hand (edit the block, select a category);
B. using code, one block at a time (e.g. untitled script pic (90), or untitled script pic (91)).
C. several blocks at a time, e.g. all blocks from a category:



BTW Primitive blocks can not be moved (unless one edits them first so they become custom blocks).

2. How to change a category's colour
See post #3. It only works for custom categories.


If you use "set [primitive] of block to false", you can then change the color. However the block remains in the same spot in the palette (much like how warp and script variables are gray and of the category "other", but show up in control and variables, respectively).

Wow, I wasn’t aware of that option. Pretty weird!

why are there ID blocks in the last two slots of

I reused a block I made earlier. My reason to use id blocks (IIRC) may have been to facilitate moving text content from one slot to another (especially on a tablet, where one selects text with their fingers).

Oh god, that's cursed. I messed around with it, and now all of my blocks are the wrong color XD

move (10) steps :: sound
turn @turnRight (15) degrees :: variables
point in direction (90 v) :: operators

why set [primitive] of move 10 steps to false?

To make it a custom block, which allows you to change the category.

but i have changed the category without making it a custom block...

You're right, you don't need to do anything other than just run the block, it automatically makes it a custom block when you change the category (I just tested it out).

oh I didn't know snap automatically changes it.