Discuss Scratch

YtArie5
Scratcher
1000+ posts

Simpler "touching color ()" block

You know this block?
<touching color [#716db7] ?>
I would like it if there was also a block like this
touching color [Red v] ? ::sensing boolean
It would be like the first block, but it would detect a broader range of colors instead of just one specific color.
Basically, the example I made would detect if it was touching any shade of red and not just one specific red.

Note: I am not trying to replace the original block, I just want this extra one!

Last edited by YtArie5 (Dec. 14, 2022 19:28:19)

cookieclickerer33
Scratcher
1000+ posts

Simpler "touching color ()" block

YtArie5 wrote:

You know this block?
<touching color [#716db7] ?>
I would like it if there was also a block like this
touching color [Red v] ? ::sensing boolean
It would be like the first block, but it would detect a broader range of colors instead of just one specific color.
Basically, the example I made would detect if it was touching any shade of red and not just one specific red.

Note: I am not trying to replace the original block, I just want this extra one!
How would it detect purple? It’s an exact mix between red and blue
lolecksdeehaha
Scratcher
1000+ posts

Simpler "touching color ()" block

This block seems concise and useful to use, but a problem with it is how it would detect the color; would it use a list of colors and snap the hex code to the nearest one, maybe? Example: Color #ee0022, snaps to #f00; Color #8c00ff, snaps to #6600ff (or another purple)
YtArie5
Scratcher
1000+ posts

Simpler "touching color ()" block

lolecksdeehaha wrote:

This block seems concise and useful to use, but a problem with it is how it would detect the color; would it use a list of colors and snap the hex code to the nearest one, maybe? Example: Color #ee0022, snaps to #f00; Color #8c00ff, snaps to #6600ff (or another purple)
Probably this way
lolecksdeehaha
Scratcher
1000+ posts

Simpler "touching color ()" block

cookieclickerer33 wrote:

YtArie5 wrote:

You know this block?
<touching color [#716db7] ?>
I would like it if there was also a block like this
touching color [Red v] ? ::sensing boolean
It would be like the first block, but it would detect a broader range of colors instead of just one specific color.
Basically, the example I made would detect if it was touching any shade of red and not just one specific red.

Note: I am not trying to replace the original block, I just want this extra one!
How would it detect purple? It’s an exact mix between red and blue
As I said in my previous post (also expanding on it), it would probably snap the color to “lines” and return true for the colors for those lines.
Essentially, if the color was orange, it would snap to the lines it is in between (red and yellow, but also orange if there is a line for that):

I also demonstrated this with 2 other colors. (Arrows are the lines it snaps to)
lolecksdeehaha
Scratcher
1000+ posts

Simpler "touching color ()" block

bump
pizzafox20109
Scratcher
100+ posts

Simpler "touching color ()" block

YtArie5 wrote:

lolecksdeehaha wrote:

This block seems concise and useful to use, but a problem with it is how it would detect the color; would it use a list of colors and snap the hex code to the nearest one, maybe? Example: Color #ee0022, snaps to #f00; Color #8c00ff, snaps to #6600ff (or another purple)
Probably this way
Maybe then it should be
(closest simple color being touched)?

so to replicate the functionality you could use <(closest simple color being touched) = “red”>, but then the language you have scratch set to could break it… Or maybe just (color being touched), then you could define your own colors and it would be more flexible (and it would report in HSB, which is just numbers.)
medians
Scratcher
1000+ posts

Simpler "touching color ()" block

YtArie5 wrote:

lolecksdeehaha wrote:

This block seems concise and useful to use, but a problem with it is how it would detect the color; would it use a list of colors and snap the hex code to the nearest one, maybe? Example: Color #ee0022, snaps to #f00; Color #8c00ff, snaps to #6600ff (or another purple)
Probably this way
That seems really specific.
An0therRand0mC0der
Scratcher
1000+ posts

Simpler "touching color ()" block

Maybe just “red orange yellow green blue purple black brown pink white” so there's no in betweens
YtArie5
Scratcher
1000+ posts

Simpler "touching color ()" block

An0therRand0mC0der wrote:

Maybe just “red orange yellow green blue purple black brown pink white” so there's no in betweens
Yes
PGBFLITE6373
Scratcher
1000+ posts

Simpler "touching color ()" block

An0therRand0mC0der wrote:

Maybe just “red orange yellow green blue purple black brown pink white” so there's no in betweens
Now I have to ask you something. Brown, is a shade of orange. So, if the thing was touching brown, would it return yes for orange? And if it was touching orange, would it return yes for brown?
YtArie5
Scratcher
1000+ posts

Simpler "touching color ()" block

PGBFLITE6373 wrote:

An0therRand0mC0der wrote:

Maybe just “red orange yellow green blue purple black brown pink white” so there's no in betweens
Now I have to ask you something. Brown, is a shade of orange. So, if the thing was touching brown, would it return yes for orange? And if it was touching orange, would it return yes for brown?
Ok maybe not brown, just orange, so brown would register as orange?

Last edited by YtArie5 (Dec. 16, 2022 16:08:26)

gdfsgdfsgdfg
Scratcher
1000+ posts

Simpler "touching color ()" block

no support

there is a-lot of colors in scratch and this will break this block
An0therRand0mC0der
Scratcher
1000+ posts

Simpler "touching color ()" block

gdfsgdfsgdfg wrote:

no support

there is a-lot of colors in scratch and this will break this block

YtArie5 wrote:

Note: I am not trying to replace the original block, I just want this extra one!
YtArie5
Scratcher
1000+ posts

Simpler "touching color ()" block

bump
ajskateboarder
Scratcher
1000+ posts

Simpler "touching color ()" block

Why only basic colors??? Hex codes are much more preferable IMO since it allows for colors in between (and i use them so often in frontend dev). Perhaps it can allow both basic colors and basic colors?

Powered by DjangoBB