First-class colors (snap 10.8)

Please note:
1 - I am not a snap developer, I am just playing around with this :slight_smile:
2 - Like all dev features, these are experimental and may not make it into :snap:

Blocks w/ examples so far:

first-class colors script pic (1)


first-class colors script pic (2)

Anyway, I can't believe we might be getting something like this in unmodded Snap!! I thought I recalled bh saying that Jens believed first-class colors were not necessary, and the C&C library was enough. Correct me if I'm wrong.

Changes found so far:
new blocks in pen, new data type (visible in is [] a [color V]? block), new pen [color V] option, all blocks with previous color inputs are no longer static, new LIBRARY!, you can use lists of rgba on color inputs, you can now have DEFAULT color inputs!!!, new [colors V] of costume [current V] block, use an rgba list on the color [rgb(146,26,68)] :: pen reporter block

He did say that. I guess he changed his mind. It does happen. ;~)

I feel like it might have been due to the fact that first-class colors were already half made, with the color input being exposed to the user, and the extension functions to actually deal with it. I feel like at that point, it should be finished (aka, adding a visual representation, and adding new blocks to easier interact with it), which is what Jens did.

This is a small but good QOL update. I like the new color preview, similar to the C&C preview but not too big. :wink:

To the devs, if I could, may I add a suggestion? When right clicking the result, I think it should show some options like this:

\textsf{copy as hex color}
\textsf{copy as RGBA color}

when (and what) was that?

the colors and crayons library

I meant the preview.

They're talking about seeing the color in the result.

oh, that makes a lot more sense.

what menu are you talking about?

Sorry, I meant to say "result". Fixed.

oh wow, I didn't realize there was a right click menu.


Anyway, I really hope we can soon change the default for color inputs.
EDIT:now we can!!!

The "object" option in the input selector was replaced with "color"
image
image

Kinda makes some sense because, quite literally, any input can be an object, so I think that would make the object input obsolete.

I don't think I've ever seen a block that actually utilizes the object input

"Object," in this context, means a sprite, the stage, a costume, or a sound. I think we're probably going to end up adding a row to the long form input dialog, so we can promote some things from inside that quarter-gear button, e.g., the piano keyboard. That discussion is on the agenda for our team meeting (in person!) next week.

You can't put those in the input though

Yes, you can.

object [Sprite V] my [stage V] item (1 v) of (my [costumes V]) item (1 v) of (my [sounds V])

I thought he meant like these things in inputs
image

That's a sprite. You can put it in an input. :~)

Sorry, I was low on time, I thought you meant putting the actual morph of the above in an input as a stand-in for a costume