Discuss Scratch

OhYeeter
Scratcher
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:
  1. 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
Scratcher
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
Scratcher
18 posts

Can Scratch MEASURE light or colour values?

kRxZy_kRxZy wrote:

I think you can do it with the lego extensions.
Yeah I gotcha but I think it only works with the actual lego extension, and I'm not working on a real robot anyway
4Mahoney21
Scratcher
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
Scratcher
18 posts

Can Scratch MEASURE light or colour values?

4Mahoney21 wrote:

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
Thank you for the info! I didn't know griffpatch's Ray-Casting series included colour detection…
At least now I know that colours can be translated into a variable number

Powered by DjangoBB