Discuss Scratch

panda-wat
Scratcher
100+ posts

Custom block "color" input

currently, when making a custom block, there are two options for inputs you can add: reporters and booleans. however, when trying to make a pen game, which relied a lot on color, I noticed a lack of the color option with custom blocks. this means that the following blocks can't be supported by custom blocks:
set pen color to [#972227]
<touching color [#45e660] ?>
<color [#70e849] is touching [#93fc53] ?>
can we have a block like this?
demo custom block [#972227]::custom 
This would be useful in scripts like:
define draw line with thickness of (pen size) from X: (X1) Y: (Y1) to X: (X2) Y: (Y2) with color [pen color]
pen up
set pen color to (pen color)
set pen size to (pen size)
go to x: (X1) y: (Y1)
pen down
go to x: (X2) y: (Y2)

draw line with thickness of (20) from X: (-200) Y: (-100) to X: (0) Y: (-100) with color [#93fc53]

Last edited by panda-wat (Oct. 19, 2020 23:46:25)

Byron_Inc
Scratcher
1000+ posts

Custom block "color" input

If we uses it, will we get a colour palette to get the colour or an eyedropper?

Uh, and also, in the meantime, you can use hex code instead.
help_with_scripts
Scratcher
100+ posts

Custom block "color" input

panda-wat wrote:

currently, when making a custom block, there are two options for inputs you can add: reporters and booleans. however, when trying to make a pen game, which relied a lot on color, I noticed a lack of the color option with custom blocks. this means that the following blocks can't be supported by custom blocks:
set pen color to [#972227]
<touching color [#45e660] ?>
<color [#70e849] is touching [#93fc53] ?>
can we have a block like this?
demo custom block [#972227]::custom 
This would be useful in scripts like:
define draw line with thickness of (pen size) from X: (X1) Y: (Y1) to X: (X2) Y: (Y2) with color [pen color]
pen up
set pen color to (pen color)
set pen size to (pen size)
go to x: (X1) y: (Y1)
pen down
go to x: (X2) y: (Y2)

draw line with thickness of (20) from X: (-200) Y: (-100) to X: (0) Y: (-100) with color [#93fc53]
We can use RGB and the number input that scratch has, which is the same with sprite graphic effects.

Last edited by Paddle2See (Oct. 19, 2020 15:02:23)

panda-wat
Scratcher
100+ posts

Custom block "color" input

Byron_Inc wrote:

If we uses it, will we get a colour palette to get the colour or an eyedropper?
you'd use the thing used to select colors on all other blocks with color inputs.

Byron_Inc wrote:

you can use hex code instead.

help_with_scripts wrote:

We can use RGB and the number input that scratch has, which is the same with sprite graphic effects.
I don't even know what these are.
help_with_scripts
Scratcher
100+ posts

Custom block "color" input

panda-wat wrote:

Byron_Inc wrote:

If we uses it, will we get a colour palette to get the colour or an eyedropper?
you'd use the thing used to select colors on all other blocks with color inputs.

Byron_Inc wrote:

you can use hex code instead.

help_with_scripts wrote:

We can use RGB and the number input that scratch has, which is the same with sprite graphic effects.
I don't even know what these are.
RGB:
https://scratch-mit-edu.ezproxyberklee.flo.org/projects/10071595/
Set () effect to () graphic effects appear in sprite's looks menu:
set [ v] effect to (0) 
panda-wat
Scratcher
100+ posts

Custom block "color" input

IK what the graphic effects are.
also, that really detailed workaround would be tricky for scratchers who aren't master coders to use.
help_with_scripts
Scratcher
100+ posts

Custom block "color" input

panda-wat wrote:

IK what the graphic effects are.
also, that really detailed workaround would be tricky for scratchers who aren't master coders to use.
It's not difficult, it's just the universal color system, and the graphic effects are the set () to () block I put in the post. There are many different ways to determine pen color, at least 3 in total.
panda-wat
Scratcher
100+ posts

Custom block "color" input

help_with_scripts wrote:

It's not difficult, it's just the universal color system. There are many different ways to determine pen color, at least 3 in total.
How do I get the color code? Also once again, there are probably many scratchers unfamiliar with the universal color system.

help_with_scripts wrote:

and the graphic effects are the set () to () block I put in the post.
I know what graphic effects are
PkmnQ
Scratcher
1000+ posts

Custom block "color" input

panda-wat wrote:

help_with_scripts wrote:

It's not difficult, it's just the universal color system. There are many different ways to determine pen color, at least 3 in total.
How do I get the color code? Also once again, there are probably many scratchers unfamiliar with the universal color system.

help_with_scripts wrote:

and the graphic effects are the set () to () block I put in the post.
I know what graphic effects are
Well, color codes are in the form #RRGGBB where each digit is in hexadecimal. RR is the value of red, GG is the value of green, and BB is the value of blue. For example, #FFFF00 is yellow.
As for graphic effects, they can be found in the looks category

Last edited by PkmnQ (Oct. 20, 2020 00:34:57)

panda-wat
Scratcher
100+ posts

Custom block "color" input

Okay, what does F stand for? none?

Also, the next person to write about graphic effects
PkmnQ
Scratcher
1000+ posts

Custom block "color" input

panda-wat wrote:

Okay, what does F stand for? none?

Also, the next person to write about graphic effects
FF is the maximum. That means red is at maximum, and green is at maximum. 80 is around half. 00 is empty.
help_with_scripts
Scratcher
100+ posts

Custom block "color" input

panda-wat wrote:

Okay, what does F stand for? none?

Also, the next person to write about graphic effects
A-F are placeholders because hexadecimal uses 16 digits. They act as the 6 extra digits.
panda-wat
Scratcher
100+ posts

Custom block "color" input

this is a test [#1f46d1] [#00ff00] [#000000]

I guess it works, but not everyone knows hex code.

After all, if they relied on hex code wouldn't we use these blocks instead?

set pen color to [text here]
<color [text] is touching [text] ?>
<touching color [some texxxxxxxxxxt] ?>

Last edited by panda-wat (Oct. 20, 2020 15:56:10)

help_with_scripts
Scratcher
100+ posts

Custom block "color" input

panda-wat wrote:

this is a test [#1f46d1] [#00ff00] [#000000]

I guess it works, but not everyone knows hex code.

After all, if they relied on hex code wouldn't we use these blocks instead?

set pen color to [text here]
<color [text] is touching [text] ?>
<touching color [some texxxxxxxxxxt] ?>
We can use the scale of graphic effects from -200 to 200, or we can use the eyedropper block and insert a join block to make a hacked hexadecimal block.
Penguin646
Scratcher
100+ posts

Custom block "color" input

I love this idea! Though I problably won't use it, it could still be useful do do stuff like this:
draw line with thickness (5) from x: (0) y:(0) to x:(180) y: (160) with color [#efd34a] :: custom
define draw line with thickness (thickness) from x: (startX) y:(startY) to x:(endX) y: (endY) with color [color] :: custom
pen up
go to x: (startX) y: (startY)
set pen size to (thickness)
set pen color to (color)
pen down
go to x: (endX) y: (endY)
pen up
greninjolo
Scratcher
2 posts

Custom block "color" input

how do i make a set color effect to (touching color) script ive tried everything
hotcrystal
Scratcher
100+ posts

Custom block "color" input

Can someone check if this is a dupe? also hi PkmnQ
AvidOsirianGuy
Scratcher
100+ posts

Custom block "color" input

hotcrystal wrote:

(#17)
Can someone check if this is a dupe? also hi PkmnQ
I'm not sure if so. But this is a good idea nonetheless
jmb1293634
Scratcher
100+ posts

Custom block "color" input

what would happen if you did this:
define (#ceebee)
set [ v] to (#ceebee)
I have used #ceebee as an example
NotK3ndricAltAgain
Scratcher
100+ posts

Custom block "color" input

jmb1293634 wrote:

what would happen if you did this:
define (#ceebee)
set [ v] to (#ceebee)
I have used #ceebee as an example
Then it would report the hex code?

Powered by DjangoBB