Discuss Scratch
- Discussion Forums
- » Suggestions
- » Simpler "touching color ()" block
- YtArie5
-
Scratcher
1000+ posts
Simpler "touching color ()" block
You know this block?
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!
<touching color [#716db7] ?>I would like it if there was also a block like this
touching color [Red v] ? ::sensing booleanIt 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
You know this block?How would it detect purple? It’s an exact mix between red and blue<touching color [#716db7] ?>I would like it if there was also a block like thistouching color [Red v] ? ::sensing booleanIt 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!
- 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
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
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.You know this block?How would it detect purple? It’s an exact mix between red and blue<touching color [#716db7] ?>I would like it if there was also a block like thistouching color [Red v] ? ::sensing booleanIt 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!
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)
- pizzafox20109
-
Scratcher
100+ posts
Simpler "touching color ()" block
Maybe then it should beThis 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
(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
That seems really specific.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
- 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
Maybe just “red orange yellow green blue purple black brown pink white” so there's no in betweensYes
- PGBFLITE6373
-
Scratcher
1000+ posts
Simpler "touching color ()" block
Maybe just “red orange yellow green blue purple black brown pink white” so there's no in betweensNow 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
Ok maybe not brown, just orange, so brown would register as orange?Maybe just “red orange yellow green blue purple black brown pink white” so there's no in betweensNow 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?
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
there is a-lot of colors in scratch and this will break this block
- An0therRand0mC0der
-
Scratcher
1000+ posts
Simpler "touching color ()" block
no support
there is a-lot of colors in scratch and this will break this block
Note: I am not trying to replace the original block, I just want this extra one!
- 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?
- Discussion Forums
- » Suggestions
-
» Simpler "touching color ()" block