Discuss Scratch

lin2
Scratcher
49 posts

Any way, to "pick" a color, with pen?

Is there any way, to pick a color for the pen, depending on the pixel under the pen?
Like the picker tool, in the scratch-sprite editor, just in the projekt.
I already tryed like that, but it didnt work:

If Greenflag clicked
Repeat until
change {tmp} by 1

So i can make

Set pen color to {tmp}

later.
Why did this not work?

Last edited by lin2 (Jan. 14, 2016 17:01:51)

lin2
Scratcher
49 posts

Any way, to "pick" a color, with pen?

After “reapeat until” is “Touching color {tmp}” of course.
deck26
Scratcher
1000+ posts

Any way, to "pick" a color, with pen?

Check this project https://scratch.mit.edu/projects/15058632/ and see if it would do. Not my idea or code so credit is due to the creator of that bit - not sure if it still exists.
deck26
Scratcher
1000+ posts

Any way, to "pick" a color, with pen?

colour = ‘jaune fish’ and you're seeing if it matches ‘jaune’ which, of course, it doesn't.
Sorry, wrong topic

Last edited by deck26 (Jan. 14, 2016 17:14:15)

lin2
Scratcher
49 posts

Any way, to "pick" a color, with pen?

Thts not a real color picker, he just checks the position, of the mouse pointer.
That would be a real one: https://scratch.mit.edu/projects/57345060/#editor
But its taking much too long time…

Last edited by lin2 (Jan. 14, 2016 17:14:37)

deck26
Scratcher
1000+ posts

Any way, to "pick" a color, with pen?

lin2 wrote:

Thts not a real color picker, he just checks the position, of the mouse pointer.
I know that, but if you want a colour picker for the pen it works.

Ah, you mean like the eye dropper rather than the colour selector. Only by going through a loop checking every possible colour (or at least taking them in small steps - I don't think Scratch will detect it to the exact colour but close enough).
lin2
Scratcher
49 posts

Any way, to "pick" a color, with pen?

If its called eye dropper, then yes
It should just do the close enough.
I want to scan the entire Screen for the Color
So its 480x360
It has to scan 172800 points for color then.
So it has to be really fast
deck26
Scratcher
1000+ posts

Any way, to "pick" a color, with pen?

It only has to scan where the mouse is presumably but has to check for lots of colours.
dcandylion
Scratcher
4 posts

Any way, to "pick" a color, with pen?

try using a if touching color then set pen color to that color

Last edited by dcandylion (Jan. 14, 2016 18:56:30)

BKFighter
Scratcher
1000+ posts

Any way, to "pick" a color, with pen?

lin2 wrote:

If its called eye dropper, then yes
It should just do the close enough.
I want to scan the entire Screen for the Color
So its 480x360
It has to scan 172800 points for color then.
So it has to be really fast
LogFather's project does that but…
It takes a noticeable pause for it to detect colors (at least on my device), and I know from experience it can take up to half an hour to test the entire screen at even a bit of a low resolution from experience with this remix of mine, so its rather unreasonable. But if you were looking for one specific color it would probably be a bit faster.
footsocktoe
Scratcher
1000+ posts

Any way, to "pick" a color, with pen?

lin2 wrote:

Is there any way, to pick a color for the pen, depending on the pixel under the pen?
Like the picker tool, in the scratch-sprite editor, just in the projekt.
I already tryed like that, but it didnt work:

If Greenflag clicked
Repeat until
change {tmp} by 1

So i can make

Set pen color to {tmp}

later.
Why did this not work?

It would only be practical to detect colors in a color picker way for images with a limited palette. If it's a PNG or a GIF with only 32 colors, for example, you could just check if touching those 32.

And all vector images have a limited palette.

But a JPG or a full-range PNG would have 16 million colors, so it would not be practical to detect if touching colors on them.

Powered by DjangoBB