Discuss Scratch

MCAnimator3D
Scratcher
500+ posts

Delete "set pen color to ( )" Block

I think this should be deleted because there are almost two of the same blocks! There are:
set pen color to [#000] //Keep.  Currently, you can't put a var in it
…and this:
set pen color to (0) //Delete.  It can confuse people!
And if you needed to put a variable in there, you can! (Currently you can't)


scratch
mariobros406
Scratcher
500+ posts

Delete "set pen color to ( )" Block

I agree that it can confuse people. I'm an advanced Scratcher, and even I don't really know how to use that block (kinda, not really).

I only check in to Scratch from time to time to see what others have been up to. I don't really post anything anymore. I'll occasionally post a question in the AT forum if I can't find an answer anywhere else.
AonymousGuy
Scratcher
1000+ posts

Delete "set pen color to ( )" Block

But I like the set pen color to () block. It is very useful for making a color picker, like the one I made.
MCAnimator3D
Scratcher
500+ posts

Delete "set pen color to ( )" Block

AonymousGuy wrote:

It is very useful for making a color picker, like the one I made.
That's why I said it should hold a variable in it.


scratch
AonymousGuy
Scratcher
1000+ posts

Delete "set pen color to ( )" Block

MCAnimator3D wrote:

AonymousGuy wrote:

It is very useful for making a color picker, like the one I made.
That's why I said it should hold a variable in it.
But the color input uses different numbers than the number input. And, you can hack it in.
ProdigyZeta7
Scratcher
1000+ posts

Delete "set pen color to ( )" Block

The first pen color block (with the color square) has millions of colors to choose from based on HSB (hue, saturation, brightness). The second pen color block (with the number input) only has a 200-color cycle and does not support saturation. They are two very different blocks despite their similar purposes.

Sorry, but I'd rather keep both. You can't draw shades of gray with a number!



DadOfMrLog
Scratcher
1000+ posts

Delete "set pen color to ( )" Block

MCAnimator3D wrote:

I think this should be deleted because there are almost two of the same blocks! There are:
set pen color to [#000] //Keep.  Currently, you can't put a var in it
…and this:
set pen color to (0) //Delete.  It can confuse people!
And if you needed to put a variable in there, you can! (Currently you can't)
To elaborate a bit on what PZ7 said, the problem with the two of them is that they are called the same thing but perform quite different functions…

set pen color to [#000] //Note: you *can* put a var in it!
That block allows you to set the colour of the pen to any one of ~16.7 million colours (256 cubed). You can use it to pick a colour, but even more usefully, you can drop a variable or numerical expression into it. The value that goes in there is in terms of the three RGB (red-green-blue) components, calculated as follows:
set pen color to ( ( ( (red) * (65536) ) + ( (green) * (256) ) ) + (blue) ) // this is the colour-picker block
[Note: PZ7 above mentioned HSB (hue-saturation-brightness). You can convert from HSB (or HSL or HSV) colour-spaces to RGB to work out what value to drop into that block - see my project for an example. You can think of “saturation” as related to the “greyness” of the pen - as saturation goes to zero, the colour becomes more grey, whereas increasing saturation makes the colour become more ‘intensely colourful’ rather than grey.]


As for the other colour block (and its related pen shade block)…
set pen color to (0) // This is really setting the "hue" of the pen, in range zero to 199 (200 is same as zero).

set pen shade to (0) //And this is really setting the "lightness" of the pen - but note zero isn't actually black!
That means the above two blocks provide two of the three HSL (hue-saturation-lightness) components (well, almost - as noted, the shade doesn't cover the whole range for “lightness”, since zero doesn't give totally black!)

However, saturation control is missing - there is no “set pen saturation” block - which means you cannot ‘reach’ all of the possible millions of RGB colours using those two blocks (for example, you cannot get any greys, since that requires saturation set to zero, and those two blocks always set pen saturation to maximum). [Note: the project I linked above provides blocks for that missing ‘saturation control’.]


So, the confusion is really in the wording of the blocks - both use the word “color” when they are working in different types of colour-space (I guess the Scratch devs couldn't think up another way to word them without it sounding too complicated…)

Hope that helps explain it!

Last edited by DadOfMrLog (Dec. 16, 2013 12:08:05)



Alternate account: TheLogFather –– HowTos and useful custom blocks (see studio). Examples below…


- String manipulation - - - X to power of Y - - - Clone point to clone - Detect New Scratcher - Speed tests studio -

savaka
Scratcher
1000+ posts

Delete "set pen color to ( )" Block

set pen color to [#f0f]
is for complete color+shade+all that stuff but
set pen color to ()
Is for usage with
set pen shade to ()
to make custom colors with numbers
1234abcdcba4321
Scratcher
1000+ posts

Delete "set pen color to ( )" Block

savaka wrote:

set pen color to [#f0f]
is for complete color+shade+all that stuff but
set pen color to ()
Is for usage with
set pen shade to ()
to make custom colors with numbers
However, that would only work if they have a
set pen grayness to () // category=pen
Why grayness? Newer scratchers will probably understand it more.

Otherwise, you can't make grayish colors.

I think they should just have a block
set pen [rgb v] to (), (), () // category=pen
It would have hsl and hsv, too.

Last edited by 1234abcdcba4321 (Dec. 29, 2013 01:28:46)


I'd highly appreciate it if you were to follow me. Don't forget to go to my profile.
All of my programming suggestions <— You should really get the suggestions move back to the suggestions forum!
Five hundred posts! I never expected to get up there… In only 2-3 months.
Does anyone know what a signature is? I mean, I've already seen 6-7 people get confused.

Powered by DjangoBB