I'm using Snap! for a couple of years and I realize how can I read the colour under mouse pointer and apply over other player.
In other words I want to apply the same colour from one to other object.
I try with
This is totally the right idea, but the costume you're making will be a rectangle filling the entire bounding box of the sprite's original costume; you're losing the costume's shape. Maybe that's okay; @richardsatweb didn't say enough about his project for us to know if shape matters.
In order to preserve the shape, we have to look at the pixels of the original costume and recolor only the ones with a nonzero alpha value:
Also, after thinking for a while, I now see why it didn't work before. The alpha value at the mouse pointer is 255 (not sure how to get a value that isn't that), which is fully visible. If you replace everything in a costume with [1,1,1,1], then multiply that by rgba at mouuse pointer, the alpha value in each pixel will be 255. However, if you kept in the if, it should theoretically still keep the value if it's 0, because it'll be doing 255*1 or 255*0.
In my second one, I just stuck the map in the multiplication block because I didn't want to add the costume. You can just add that as a costume, then multiply the first bit by the pixels of the mask, and it would get the same results.
Also, here's a more elegant way to remove the alpha from the rgba at mouse
Thank you very much for your answers! ego-lay_atman-bay: I treat with your idea (create a global variable "to store the color under the mouse, then make each object set their color to the color variable") but I can read the RGBA value at mousepointer but I can't apply directly RGBA effect to the object.
I can apply RGBA effect to the object but I can't read it directly from mousepointer.
Here is the project (totally incomplete!) as example: