Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Can Scratch MEASURE light or colour values?
- OhYeeter
-
18 posts
Can Scratch MEASURE light or colour values?
I wanted to create an Edison Robot v2 in a digital format which I took inspiration from their website ‘ edscratchapp.com ’
Any sensing blocks I know need the value to be inputted manually. I don't think there's a built in variable for light or colour but…
What can I do with being able to replace the colour in ‘touching colour _’ with a variable?
Edit: as of writing this I've noted a few things with replacing the value with variables:
Any sensing blocks I know need the value to be inputted manually. I don't think there's a built in variable for light or colour but…
What can I do with being able to replace the colour in ‘touching colour _’ with a variable?
Edit: as of writing this I've noted a few things with replacing the value with variables:
- You can write anything with letters and it'll be TRUE
' 0 100 100 ' is true, but remove the spaces and it is FALSE
hexcodes are mostly accurate unless you go for the subtlest variation of the colour
Last edited by OhYeeter (Nov. 23, 2024 03:07:47)
- kRxZy_kRxZy
-
1000+ posts
Can Scratch MEASURE light or colour values?
I think you can do it with the lego extensions.
Last edited by kRxZy_kRxZy (Nov. 23, 2024 08:09:35)
- OhYeeter
-
18 posts
Can Scratch MEASURE light or colour values?
Yeah I gotcha but I think it only works with the actual lego extension, and I'm not working on a real robot anyway I think you can do it with the lego extensions.
- 4Mahoney21
-
56 posts
Can Scratch MEASURE light or colour values?
Not sure if this is what you're looking for (I don't completely understand the question) but griffpatch has a tutorial on how to detect color at a point on the screen https://www.youtube.com/watch?v=aBTh756kCZw
- OhYeeter
-
18 posts
Can Scratch MEASURE light or colour values?
https://www.youtube.com/watch?v=aBTh756kCZwThank you for the info! I didn't know griffpatch's Ray-Casting series included colour detection… Not sure if this is what you're looking for (I don't completely understand the question) but griffpatch has a tutorial on how to detect color at a point on the screen:
At least now I know that colours can be translated into a variable number
- Discussion Forums
- » Help with Scripts
-
» Can Scratch MEASURE light or colour values?