"colors" category

this is a "colors" category. it would feature blocks like
(mix colors [#ff0000], [#8811ff] . . . (can have an input list) with ratios (can have an "input list") (1), (50) . . .
would also have a color reporter which would report the color inside it
(hue v) from color [...]
(hsb/hex/rgb/rgba of color [...]
(color from hsb/hex/rgb/rgba [...]
i would also like to add ''color" as an input for custom blocks, and to be able to set vars to colors.

First of all welcome to the forums!Second what would people use this for in their projects?

:page_facing_up: > Libraries...

the problem with all this is colors aren't actually first class data, so it's really hard to do these. Now, I never said they aren't impossible, I mean, the color reporter has actually been made before (using javascript), but in order to use it, they had to create a new custom block that takes that input and sets the pen color to the color in the input.

rgba (and rgb) is already possible, I mean, snap colors are done in rgba.
btw, the color input is possible to get by editing the xml.

It's true that we don't have a color-picker input for custom blocks. But we have many other ways to deal with colors. Everything except the color-picker input is provided by the Colors and Crayons library, of which I'm very proud. See Appendix A of the manual for the gory details.

%clr :smiley:

Oh, I was meaning to ask for a color picker input myself. Would it be too difficult?

Edit the xml.

We don't really encourage that, because then we get bug reports about projects that won't load, that turn out to be the result of malformed xml. We should think about that as a feature; it wouldn't be hard, since, as @18001767679 says, it's really already implemented.

You don't even need to directly edit the XML.
XML Generation Project

Ah, right, I forgot about that, but it doesn't solve the entire problem, because that chunk of XML has to be inserted in the project in a syntactically acceptable place.

Jens agrees that it wouldn't be hard for us to implement, but he wants an example of a project that would actually use it.

I made the remix which actually builds a custom block from generated XML - "Script:Build" example: https://snap.berkeley.edu/snap/snap.html#present:Username=dardoro&ProjectName=XML%20gen%26build

There is another project with prebuilt templates with color picker input : https://snap.berkeley.edu/snap/snap.html#present:Username=dardoro&ProjectName=Make%20color%20picker
Make color picker script pic (1)


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.