snapcon colors

by bh
See Code Download Embed
Start by reading https://people.eecs.berkeley.edu/~bh/color-proposal.pdf

The main purpose of this project is to include an implementation of the SET PEN block with the additional options in the bh color proposal.  It also has scripts to draw the diagrams in the color proposal paper:

C - color Chart
P - color Picker
F - Full color picker (all 100 crayons)
S - fairnesS chart
G - hue Graph
R - SV Rotary graph
T - animated rotary colors
U - animated rotary fair hues
D - Darkest colors in each family
I - Integer color numbers
B - Big (2xH, 2xW) color picker
A - continuousness demo
L - blue/yellow brightness demo
W - make stage white
H - hue scale
E - add fair hue scale

Clicking the sprite sets the pen color to the color under the sprite, so that it can be examined with the "RGB COLOR" and "HSV COLOR" blocks.

The project includes two main command blocks: SET PEN (dimension) TO (value) and SET PEN TO CRAYON (number), and a reporter PEN (dimension).  The reporter can always tell you RGB, HSL, or HSV dimensions, but can report color, crayon, fair hue, or other fair dimensions only if the color was most recently set using those dimensions.  In other words, the reporter doesn't try to find, say, the closest fit color scale value to the actual color.

For the 3-D color spaces, you can set the entire color as a vector (a list of three or four values; the fourth sets transparency if present).  In the case of RGB you can also set or read the color as six hex digits.

Ultimately the idea is not to have a separate crayon block; instead, if you choose "crayon" in the SET PEN block, the second (value) input displays the down-arrowhead menu symbol and you can select crayons from the menu.  Similarly, if you select "color" you'll have access to a menu with entries such as "first yellow" and "spectral yellow."  But I can't do that in a custom block.

There's also a CHANGE PEN (thing) BY block, with the same restrictions about changing scales as the PEN reporter.

Created July 25, 2021

Last updated July 29, 2021

Published July 29, 2021