Color sensing block?

Yes! That works…

1 Like

interesting

technically you could do this with values I think

3 Likes

You could very easily do this with variables rn

3 Likes

This is probably possible already - in some way - but I feel like a dedicated block would be easier and nicer! :slight_smile:

4 Likes

Nice idea, but there is one problem.

Unlike in Scratch, Hopscotch has the coding editor on screen at a different time than the stage, so it might be hard to grab colors from characters.

2 Likes

So it might be hard to detect an object’s color because you don’t know the color?
I don’t see how that might be a problem. If you coded it to set color, you’ll know what that color it set to is. And if you forgot, you can go to that object’s code to figure it out.

2 Likes

I’m referring to a Scratch feature where you can select a color from the stage kinda simply by moving your picker onto the color and clicking it

2 Likes

Unless you used a set random color block

Maybe “set color (random), get color (preset color)“ ?

3 Likes
set var((Self)color) to random(1 to 26) // 26 or how many colors there are I forget
set color var((Self)color)
2 Likes

How? Why not show how it can be done?

2 Likes
Monkey {
  Set variable self(color) to 1 // dark purple 
} 
Gorilla {
    When self bumps Monkey
       If monkey(color) = 1 {
  Destroy 
}

}

for hsb colors it’d be hard

2 Likes

Setting color to a variable. This isn’t possible w/ clones though

3 Likes

How isn’t it?

What if for example you wanted to make a color picker in an art pad without using clones? How would you do it without this block?

2 Likes

Without clones? U would have each square set color to h(self(h)) s(self(s)) b(self(b)).
Then a general rule, set (h) to (self(h)) and so on with hsb
Then have the drawer draw in the color h s b

2 Likes

Here’s an example

2 Likes

Interesting

It would be useful for things like making the get color feature in this art pad with a regular art pad that doesn’t have an object for each trail.

5 Likes

Noice.
(hopscotch = scratch?)

2 Likes

Yeah, definately!

If this was true then you can actually pixelate stuff on the screen
Even the whole screen
((Self)color)
((Self)sensed color)

1 Like