Discuss Scratch
- Discussion Forums
- » Suggestions
- » Eyedropper for code as well
- polishdziabag55603
-
Scratcher
95 posts
Eyedropper for code as well
Well, it can result in two results:
the hex (#FFF000)
numbers
Numbers
and you may know hex
The new block would look like this:
the hex (#FFF000)
numbers
Numbers
((blue) + (((green) * (256)) + ((red) * (65536))))these shades are from RGB
and you may know hex
The new block would look like this:
(eyedropped color [number v] in x: (-240) y: (179) ::looks)The result:
if <(the whole stage) = [black]> thenThey will work like the block touching color and the color scanning script, but even with no screen refresh. Just the whole time should be 0.0000000 milliseconds or even less to scan
result is (0)
else
result is something else
end
Last edited by polishdziabag55603 (July 8, 2023 23:05:48)
- polishdziabag55603
-
Scratcher
95 posts
Eyedropper for code as well
that sounds complexIt's just your thinking. You can recreate this with this script:
define Detect color from x: (x) y: (y)For this script, we need two bitmap costumes.
switch costume to (BIG v)
set size to (1) %
switch costume to (Detector v)
go to x: (x) y: (y)
set [red v] to (0)
repeat (32) {
set [green v] to (0)
repeat (32) {
set [blue v] to (0)
repeat (16) {
set [color v] to (((red) * (65536)) + (((green) * (256)) + (blue)))
if <touching color (color)> then {
stop [this script v]
} ::control
change [blue v] by (16)
} @loopArrow ::control
change [green v] by (8)
} @loopArrow ::control
change [red v] by (8)
} @loopArrow ::control
One, called “BIG” is the image filled whole canvas
Second, called “Detector” is the 2x2 image of a brush.
Why two?
It is the trick for Scratch into resizing small costumes even smallers.
Answer to the question you may ask: Why you are suggesting such thing if you can recreate it?
Answer: because I want it even faster (not less than a screen refresh, but less than a nanosecond)
Last edited by polishdziabag55603 (July 9, 2023 00:17:23)
- Discussion Forums
- » Suggestions
-
» Eyedropper for code as well

