jmoenig / Snap

a visual programming language inspired by Scratch
http://snap.berkeley.edu
GNU Affero General Public License v3.0
1.49k stars 743 forks source link

Changing Colors behavior #1736

Closed jguille2 closed 5 years ago

jguille2 commented 7 years ago

Hi @brianharvey, I open a new issue to continue (and try to end) the Color discussion from #1659 and #1723 (I think you can close them)


Let's continue... You know changes are documented, and you can run current proposal online.

Joan

brianharvey commented 7 years ago

Now that the forum gang have talked me into

crayon-menu

I withdraw my objection to you using the word "color" in the name of SET PEN COLOR [HUE etc]. :)

Also I think we should consider using the standard names and ranges for RGBHSL, e.g. 0-359 for hue, 0-255 for blue. For the fractional ones (SL) we can use percent. This doesn't change the plans about wrapping; hue wraps in the obvious way, lightness 101-200 goes backwards, etc. We would have a Scratch compatibility library that would have pen color number, pen shade, etc., on the 0-100 scale.

jguille2 commented 7 years ago

Hi @brianharvey, I had already forgotten all this mess...

I'm not sure what are you asking me now ??

Let me know what changes I have to make.

Joan

brianharvey commented 7 years ago

I'm thinking if we're calling it "hue" it should be in degrees, like the rest of the world. We'll have a compatibility library that will translate "color number" (0-100) to hue 0-359.

Similarly we should have "lightness" which I guess is generally in percent, right? So 0-100, with a "shade" compatibility block that takes 0-200 (with the up-and-down wrapping of course).

And saturation in percent, right?

The compatibility blocks will be in a library; the primitives should be in real-world names and values. So, including the libraries, we'll have three distinct ways to think about color:

  1. compatibility mode, just like now only HSL instead of HSV, but with Scratch names and with Snap!-compatible values.
  2. expert mode, HSL/RGB in just the way everybody else does it.
  3. crayon mode, in which you select a crayon by name from a pulldown menu and you see its crayon number. That, too, can be in a library.

Does that sound good?

brianharvey commented 7 years ago

P.S. All the fighting (for which I apologize; I fight too much) was about the meaning of "color number" and whether or not it has some connection with hue. But since I'm now thinking "crayon number" which clearly doesn't sound like anything we had before, everyone should be happy.

cycomachead commented 7 years ago

I'm thinking if we're calling it "hue" it should be in degrees, like the rest of the world. We'll have a compatibility library that will translate "color number" (0-100) to hue 0-359.

Similarly we should have "lightness" which I guess is generally in percent, right? So 0-100, with a "shade" compatibility block that takes 0-200 (with the up-and-down wrapping of course).

And saturation in percent, right?

I feel like this is pretty confusing. I mean, it makes sense in a way, but you do need to know that hue is a degree. If you're new to color, this difference is hard to discover.

Perhaps we can change the block spec to indicate the parameter value, by using º or % after the input.

we'll have three distinct ways to think about color:

I think this makes sense, but definitely seems a bit confusing. I'm not sure isn't any more confusing than all the other suggestions, though, so in the absence of something better, I agree.

jguille2 commented 7 years ago

Hi, I try to explain my thoughts about these three ways... and my doubts...

Last comment. When defining crayons, we must think to connect all three modes. The connection will be with the basic set of colors. Then, our palette palette must have the main crayons, with a well known rgb values.


Finally... Pending to define clearly shade and hue

jmoenig commented 5 years ago

We've since changed colors and added the missing third dimension for the upcoming Snap5. I think it's okay to now close this. Thanks!

brianharvey commented 5 years ago

For what it's worth, I still agree with Joan about HSL vs. HSV, and we just had a user complaint that pure black and pure white aren't selectable in the color picker. I like Joan's color picker with a grayscale bar and individual buttons for black and white.

Not reopening, to not get you angry, but we (Joan and I) formerly disagreed about details but we don't any more because of the crayon library. So we have a single proposal on the table.

jguille2 commented 5 years ago

Hi Brian and Jens, Avoiding long discussions (:smile: ), we can update our picker with a gray scale and some basic colors (including white and black). One ("neutral") proposal would be the 16 initial html web named colors (with well known and clear RGB values). I have added two browns. colorPicker

If you agree this, I can add this picker to the ColorSlotMorph and also to the paint editors.

One question. Is the default Color(145, 26, 68) consciously chosen? If not, we can change it for one of the defined colors. defaultColor

Continue after Jens holidays...

Joan

brianharvey commented 5 years ago

Good that Jens is on vacation so we can get the details agreed before he sees all this. :-)

About the grayscale bar, I think it should have black and white buttons at its ends, like this:

grayscale

The green background is not part of it, just in the picture to clarify its extent. The middle part is a standard grayscale 0-255, but at each end is a square button of constant color, 0 at the left and 255 at the right. The yellow lines (two different yellows for contrast) aren't to choose a yellow color but just to separate the buttons from the gradient. Again, the gradient is 0-255, not 1-254, so if you manage to click exactly at an endpoint you get black or white.

As for the selection of colors at the end, I'll be unhappy if we introduce a competing set of crayons to the ones in the crayons library. Those initial 16 HTML colors were chosen, not because they're a useful palette, but because of the narrow width of color numbers on IBM PCs in the early 1980s. And one of them is hideous olive! So instead we should have the carefully chosen crayon numbers divisible by 5:

crayons

The top row is crayon numbers divisible by 10, and the second row is the first row plus 5.

If someone hates my crayon colors for some reason, we should agree on a new set so that the crayon library and the color picker agree.

There's a slight inefficiency in that there are two black buttons, one at the end of the grayscale bar and one in the crayon box. This doesn't bother me, but it also wouldn't kill me if those first three buttons were crayons 3, 7, and 11 instead of 0, 5, and 10:

crayons3

It should logically be crayons 4, 8, and 12, but these ones are empirically more striking.

The reason for including black but not white in the multiple-of-5 crayon box is that most of the time the background is white, so it's not such a useful pen color (unless you're trying to erase, I guess, in which case you choose it by program, not by mouse). (White is crayon 14.)

I agree that the default color in the color picker input slot is kind of blah, and that we should pick something more vibrant. I guess the obvious choice is red, but it's not my favorite color, so I'd urge blue (crayon 80) or orange (crayon 40).

brianharvey commented 5 years ago

P.S. It just occurred to me that I should make room for the block colors in the 100-crayon box: Lists in the reds, Variables in the oranges, Commands in the yellows, etc.

jguille2 commented 5 years ago

Ok, if you both agree, I will pull these changes. Note that:

Waiting for your decisions.

Joan

brianharvey commented 5 years ago

The thing about the dividing line (the yellow line you don't like) is that without it, I think it's not obvious that it isn't a continuation of the gradient, so that only the very leftmost pixel is black, and only the rightmost pixel is white. The dividing line makes it obviously a button.

I don't insist on yellow. For example, the one on the left could be white and the one on the right could be black!

(Edit: I'm actually very proud of those one-pixel-wide lines, which, I claim, make it entirely obvious what's happening without any help text required!)

jguille2 commented 5 years ago

Ok! I vote for those black/white one-pixel-wide lines.

brianharvey commented 5 years ago

Please wait a day before implementing this. Having had the idea of including the block colors, I'm rearranging the colors within a family by hue, more or less, which will affect the second row of my crayon box. Thanks.

jguille2 commented 5 years ago

Ok, but before reading you, I was trying ...to show a result...

colorPicker2

And doing this, only some details-questions about your crayons:

I know these are only details... but I question about them for the "last" proposal.

Continue.... Joan

brianharvey commented 5 years ago

Nice!

There are CSS colors? I started with the X11 color chart and found more colors here: http://www.workwithcolor.com/red-color-hue-range-01.htm and a few other places. I'll look at the CSS chart and figure out the differences.

brianharvey commented 5 years ago

You mean gray36, right? I'm happy to change the two grays.

The one you want to call "orange" (which is hideous) is "web orange" in my list, crayon 46. But I think that's the one I'm dropping in favor of Variables. :-)

I'll get the official new list done this afternoon. I've reordered them, too, so that other than the multiples of 5 they're either in hue order or in brightness order, whichever subjectively looks better, within each color family.

jguille2 commented 5 years ago

Ok Brian. I wait for your reordered crayons.

But you see the problem were not in CSS vs X11. It was about official standards.

The W3C adopts CSS color module level 3. And yes X11 and CSS names are really the same. The only little conflict is between "web color names" and "x11 names".

The only important is to respect the official names. Then:

And you see there my notes about your "gray26", "gray71" and "orange". And no notice about "Burnt orange" and "Rubber duck". And note that I only checked the 20 crayons for the picker.

Joan

brianharvey commented 5 years ago

I just don't like some of the choices they made. And, as for following standards, the real standard we should be following is the Crayola crayon names! So, here's the compromise: I changed the grays to what you want, and I'm keeping orange the way I want. :-P

Honestly, I started with the X11 chart, and mostly it was usable, but, for one thing, it just doesn't have enough oranges. (For the purposes of the crayon block, I don't want to use names with numbers in them.) And we now have crayons named Motion, Looks, Sound, etc., which aren't in anybody's standard list!

So, here it is:

grays={ 0 black #000000=0 1 gray7 #121212=1 2 gray14 #242424=2 3 gray21 #363636=3 4 gray28 #484848=4 5 gray36 #5c5c5c=5 6 gray43 #6d6d6d=6 7 gray50 #7f7f7f=7 8 gray57 #919191=8 9 gray64 #a3a3a3=9 10 gray71 #b5b5b5=10 11 gray78 #c8c8c8=11 12 gray85 #dadada=12 13 gray92 #ececec=13 14 white #ffffff=14 } pinks={ 15 deep pink #ff1493=15 16 hot pink #ff69b4=16 17 bright pink #ff007f=17 18 raspberry #e30b5d=18 19 amaranth #e52b50=19 } reds={ 20 red #ff0000=20 21 burgundy #900020=21 22 cherry #990000=22 23 dark candy apple red #a40000=23 24 sanguine #c00000=24 25 maroon #800000=25 26 crimson #c90016=26 27 Lists #d94d11=27 28 candy apple red #ff0800=28 29 coquelicot #ff3800=29 } browns={ 30 saddle brown #8b4513=30 31 chocolate #7b3f00=31 32 kobicha #6b4423=32 33 sepia #704214=33 34 chestnut #954535=34 35 dark brown #654321=35 36 brown #964b00=36 37 golden brown #996515=37 38 copper #b87333=38 39 cinnamon #d2691e=39 } oranges={ 40 orange #ff7f00=40 41 Pantone orange #ff5800=41 42 pumpkin #ff7518=42 43 Variables #f3761d=43 44 Spanish orange #e86100=44 45 burnt orange #cc5500=45 46 sinopia #cb410b=46 47 ochre #cc7722=47 48 carrot #ed9121=48 49 tangerine #f28500=49 } yellows={ 50 yellow #ffff00=50 51 Control #e6a822=51 52 dark goldenrod #b8860b=52 53 goldenrod #daa520=53 54 saffron #f4c430=55 55 sandstorm #ecd540=55 56 mustard #ffdb58=56 57 gold #ffd700=57 58 egg yolk #fee33e=58 59 rubber duck #fbe108=59 } greens={ 60 lime #00ff00=60 61 apple green #8db600=61 62 Operators #62c213=62 63 forest green #228b22=63 64 green #008000=64 65 dark green #006400=65 66 dark pastel green #03c03c=66 67 emerald #50c878=67 68 mint #3eb489=68 69 Pen #00a178=69 } cyans={ 70 aqua (cyan) #00ffff=70 71 dark cyan #008b8b=71 72 cerulean #007ba7=72 73 iceberg #71a6d2=73 74 Sensing #0494dc=74 75 teal #008080=75 76 light sky blue #87cefa=76 77 deep sky blue #00bfff=77 78 dodger blue #1e90ff=78 79 azure #007fff=79 } blues={ 80 blue #0000ff=80 81 midnight blue #191970=81 82 dark powder blue #003399=82 83 cobalt #0047ab=83 84 denim #1560bd=84 85 navy blue #000080=85 86 steel blue #4682b4=86 87 Motion #4a6cd4=87 88 cornflower #6495ed=88 89 slate blue #6a5acd=89 } violets={ 90 violet #8f00ff=90 91 Looks #8f56e3=91 92 grape #6f2da8=92 93 indigo #4b0082=93 94 x11 purple #a020f0=94 95 magenta (fuchia) #ff00ff=95 96 dark orchid #9932cc=96 97 Sound #cf4ad9=97 98 purple #7f007f=98 99 dark magenta #8b008b=99 }

jguille2 commented 5 years ago

Ok, done!

colorPicker3

Note that those are not "the colors that I want". I only implementing your crayons, and checking that those "numbers" are right. It's easy to make mistakes, and I need a real reference. I think that W3C was a good standard, because Snap! is running inside browsers.

My opinion, the 140 X11 names supported by browsers (without any variation nor gray%) is really enought to build a set of crayons. And we don't need to introduce "burnt orange", "sandstorm"... But this is only an opinion. For me is not a problem. And if you change crayons lib I can build our color picker related to it.

If the colors are fixed, I also build the editor pickers and then, the PR to close this. Remember we can change the "default color"...finally "red"?

Joan

brianharvey commented 5 years ago

I don't think even Crayola makes a 140-crayon box! So there would be some curation no matter what. I actually learned a lot from the workwithcolor.com pages, both from their grouping of colors (e.g., "pink" is distinct from both red and violet) and from their occasional weird choices. And in the opposite direction, Pantone has thousands of distinct colors.

I suppose red will do for the default color. (Unless you'd rather make it burnt orange...)

Did you have a thought about using crayons 3, 7, and 11 as the grays instead of 0, 5, and 10, so as to avoid duplicating black? I don't really care but didn't want you to have missed that idea, especially since the two black buttons are on top of each other.

brianharvey commented 5 years ago

Oops I didn't answer the main question: Yes, I'm done with colors at least until Snap! 7.0. :-)