I made a "Create Category" Block

untitled script pic (2)

The definition is blank.

untitled script pic (8)

You've only made the visuals of it, but you need to add some scripts to it. I'd consider searching the source code. :wink:

i need a javascript block to the definition

...for the sake of consistency with other blocks such as "rgba at mouse-pointer", I would go with a list input for the colours. And the list will be r,g,b.

Feel free to ignore the list one.

Also the block should be a stack-shape/command (the horizontal jigsaw), not a reporter (a rounded block).

his first reply!!!11!!!1! yayyyyy!!!1!11!11 /! /ot

This is what I did

https://snap.berkeley.edu/snap/snap.html#present:Username=ego-lay_atman-bay&ProjectName=categories%20extension

And here's my javascript: https://ego-lay-atman-bay.github.io/snap-extensions/block-extensions/categories.js

Hmm.
I would've considered a block like this:
[scratchblocks]
(a new category with name [Category] and rgb (list [63][0][127] @delInput @addInput :: list):: grey)
set [a v] to (a new category with name [Category] and rgb (list [63][0][127] @delInput @addInput :: list):: grey)
[/scratchblocks]

Did you just try to introduce first-class categories into Snap!? :thinking:

Is there any peculiar use case it needs to be first class?

add a 'with blocks ⌸ < >' thing

[scratchblocks] (a new category with name [Category] and rgb (list [0][116][143] @delInput@addInput ::list) with blocks ⌸ @delInput @addInput :: grey) (a new block [if %bool %act else %else] with slots (list [2] [5] [5] @delInput @addInput::list) :: grey) [/scratchblocks]

It's already possible in Snap!

(I wonder why block definition tokens in metaprogramming use _ instead of %name. Actually, input names should be defined only once)

I think that's just due to the fact that it would be really awkward to deal with input names being different from what is set in the ring.