This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-04-02 17:38:37

scmb1
Scratch Team
Registered: 2009-03-19
Posts: 1000+

Detecting Pixel Color

I haven't messed around with the source  code much or explored Advanced Topics very much, so please excuse me if this has already been asked or solved.  smile

Anyway, has anyone made a reporter block that can return the number of the color of a pixel in Scratch (perhaps the center pixel a sprite is touching)? For instance, if the sprite is touching red, it will return 0.

I hope my question was clear- I don't hang around here much, so I don't know the lingo.


http://i48.tinypic.com/2z5pqad.png

Offline

 

#2 2011-04-02 17:51:25

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Detecting Pixel Color

I've not heard of one that works using the 0-200 colour system of the Scratch colour effect, but if you look at the modified version of Scratch, Panther there are blocks in there that allow you to read the colour of a specified pixel in either Hexadecimal or RGB. The source code for the blocks can be found in the browser by following the path dev>turn fill screen off in Panther. Hope this helps!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#3 2011-04-02 17:56:16

scmb1
Scratch Team
Registered: 2009-03-19
Posts: 1000+

Re: Detecting Pixel Color

sparks wrote:

I've not heard of one that works using the 0-200 colour system of the Scratch colour effect, but if you look at the modified version of Scratch, Panther there are blocks in there that allow you to read the colour of a specified pixel in either Hexadecimal or RGB. The source code for the blocks can be found in the browser by following the path dev>turn fill screen off in Panther. Hope this helps!

Oo, cool. Thanks. I'll check it out.  smile


http://i48.tinypic.com/2z5pqad.png

Offline

 

Board footer