pybricks / support

Pybricks support and general discussion
MIT License
105 stars 6 forks source link

[Feature] Prepopulate toolbox with color equality test #1552

Open laurensvalk opened 5 months ago

laurensvalk commented 5 months ago

Is your feature request related to a problem? Please describe. We currently have a read color block and a color literal instead of a boolean "is this color block".

This provides for a lot of flexibility, but it can be tricky for new users. Instead of making a new block, we can make the union of that commonly used combination of blocks directly on the toolbox.

laurensvalk commented 5 months ago

So we could change this:

image

To:

image

After you drag this out, you can still get each of the blocks separately.

laurensvalk commented 5 months ago

@ggramlich - would you like to see the separate blocks on there, as well?

ggramlich commented 5 months ago

@laurensvalk Keeping the (sensor color/hsv) block in the toolbox would be nice. For the (red...) color block - I don't think that you actually need it as a separate block, if you can drag it out of the comparison block.

BertLindeman commented 5 months ago

Laurens, this example above showed me how to do the color test.

If I would only want to print the color, I would need to pull a color-comparison block, pluck it apart and then place the color-block into a print. Not really beginner-friendly, I think.

I would prefer the separate color block as well in the input box.

laurensvalk commented 5 months ago

Like this?

image

ggramlich commented 5 months ago

@laurensvalk That would be fine for me. I am not sure, if @BertLindeman also wanted the color block itself to be available separately.

BertLindeman commented 5 months ago

@laurensvalk That would be fine for me. I am not sure, if @BertLindeman also wanted the color block itself to be available separately.

I would the color block for beginners sake separately, but I am not fanatic about it. Children learn so quick.

laurensvalk commented 5 months ago

Thanks both of you for your insights!

laurensvalk commented 5 months ago

Probably also need the color block separately as well, see https://github.com/orgs/pybricks/discussions/1563#discussioncomment-8887567

laurensvalk commented 4 months ago

Other block brought back too now.

laurensvalk commented 3 months ago

When you drag the populated block onto the canvas, it doesn't run the callback that automatically picks an available sensor.