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)

(imho, the last one should have 2 newlines (after each of the first number inputs), it's now much longer than skew [ V] to () degrees ()%, which I believe was the previous longest block.)

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!!!

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!!!