Discuss Scratch
- Discussion Forums
- » Suggestions
- » Color at x: () y: () block.
- Wheatly_Scratcher
-
100+ posts
Color at x: () y: () block.
In Scratch, when you, for example, use the pen, it will just simply leave a mark on the screen and forget about it, and when you use the color effect block, it just sets the color to the number. You can use the
_____________________________________________
THE BLOCK
In Scratch, the
_________________________
If you support or do not support, please make a reason for why you do/do not support this suggestion.
Thank you for reading and Scratch on!
<touching color [#FFF000] ?>to check if there is a color that you put in the color input where the sprite is, but what if you were checking which color was there? That would require tons of
<touching color [#FFF000] ?>blocks, all with every color and every single shade of it. But what if there was a block that checked the color at the x and y coordinates you give it? What if there was a
(color at x: () y: () :: sensing)block?
_____________________________________________
THE BLOCK
In Scratch, the
(color at x: () y: () :: sensing)block would check the color at the coordinates that you give it, and would give you the number that you would use in the
set pen color to ()to make that color. One use of this could be if you were making a cloud drawing program, and you were using pen, you could use
(color at x: () y: () :: sensing)to check the color of all possible coordinates, add them all to a list, save it to cloud, and another person's program would read it, and make a pen drawing of what you made! Or, if you were using
set [color v] effect to (), and your sprite was all different colors, and you wanted to check the color change at one point of the sprite, you would input the coordinates of that part, and it will give you what color that part changed to!
_________________________
If you support or do not support, please make a reason for why you do/do not support this suggestion.
Thank you for reading and Scratch on!
Last edited by Wheatly_Scratcher (May 25, 2017 14:29:21)
- awesome5185
-
1000+ posts
Color at x: () y: () block.
That seems like a good idea! Perhaps also add a
(colour I'm touching:: sensing)block to detect the colour the Sprite is touching at the Center (not the colour of the Sprite.)
- jromagnoli
-
1000+ posts
Color at x: () y: () block.
Color at x, y block would be really useful for 100% pen games. But to check a color for a cloud draw program you can use this:
set [r v] to (0)
repeat (32)
set [g v] to (0)
repeat (32)
set [b v] to (0)
repeat (16)
if <touching color (((r) * (65536)) + (((g) * (256)) + (b)))> then
add (((r) * (65536)) + (((g) * (256)) + (b))) to [color scan v]
end
change [b v] by (16)
end
change [g v] by (8)
end
change [r v] by (8)
end
- NitroCipher
-
500+ posts
Color at x: () y: () block.
This block would be extremely useful. 100% support
The problem with the below code is it takes a really long time to process and is not entirely accurate due to how scratch processes the touching color block. (more info here https://mv-ezproxy-com.ezproxyberklee.flo.org/wiki/Touching_Color_()%3F_(block) )
The problem with the below code is it takes a really long time to process and is not entirely accurate due to how scratch processes the touching color block. (more info here https://mv-ezproxy-com.ezproxyberklee.flo.org/wiki/Touching_Color_()%3F_(block) )
Color at x, y block would be really useful for 100% pen games. But to check a color for a cloud draw program you can use this:set [r v] to (0)
repeat (32)
set [g v] to (0)
repeat (32)
set [b v] to (0)
repeat (16)
if <touching color (((r) * (65536)) + (((g) * (256)) + (b)))> then
add (((r) * (65536)) + (((g) * (256)) + (b))) to [color scan v]
end
change [b v] by (16)
end
change [g v] by (8)
end
change [r v] by (8)
end
- Wheatly_Scratcher
-
100+ posts
Color at x: () y: () block.
Thank you! However, the That seems like a good idea! Perhaps also add a(colour I'm touching:: sensing)block to detect the colour the Sprite is touching at the Center (not the colour of the Sprite.)
(colour I'm touching:: sensing)block has several problems:
- Sometimes, Scratchers make the center of the sprite not in the middle, causing confusion.
- It does not state in the block that it checks the color behind the center of the sprite, causing confusion.
- If it did not check the color behind the center, what if the sprite was on different colors at the same time? What could it report?
Last edited by Wheatly_Scratcher (April 19, 2017 15:36:16)
- mobluse
-
100+ posts
Color at x: () y: () block.
It could be a privacy problem if you show a picture from the camera and there is a quick way to scan that and store in a cloud variable.
- Wheatly_Scratcher
-
100+ posts
Color at x: () y: () block.
Yes, that could be a problem with this block. Maybe if there was a project with a video block, this block, and cloud variables, it would have a warning like this: It could be a privacy problem if you show a picture from the camera and there is a quick way to scan that and store in a cloud variable.
This project contains the “Color on X, Y,” block, video sensing, and cloud variables. Thus, this project might take a picture of and/or videotape you. If you are concerned about this, please use “See Inside” and look at the scripts and check that this project will not take a picture of and/or videotape you.
Last edited by Wheatly_Scratcher (May 14, 2017 12:33:43)
- PkmnQ
-
1000+ posts
Color at x: () y: () block.
Semi-support, it should report a hex value instead.
- stickfiregames
-
1000+ posts
Color at x: () y: () block.
It would probably just report a number, as (65536 * r) + (256 * g) + b. That number represents the same value as the corresponding hex value, but it can be used in calculations or, more importantly, dropped into a colour slot. Semi-support, it should report a hex value instead.
It would then be useful to have these as well:
([red | green | blue v] of [#3399ff] :: sensing)to convert between colours and their component parts.
(color r: () g: () b: () :: sensing)
(color [#ff9933] :: sensing)
As for the actual suggestion, I support
(color at x:() y:() :: sensing)The first one is self explanatory. The second one detects the colour at the sprite's centre, but ignores the sprite itself, so if you had a red sprite on a white background, it would return white rather than red.
(color at [sprite v] :: sensing)
Last edited by stickfiregames (May 18, 2017 13:59:03)
- dt1000
-
100+ posts
Color at x: () y: () block.
I thought you meant this at first:
(color [#1534AB] at x:() y:() :: sensing)For example,
if (color [#1534AB] at x:(0) y:(0) :: sensing) then
say [Yay, Blue!]
else
say [:( no blue.)
end
- WolfCat67-Test
-
19 posts
Color at x: () y: () block.
Support; I can see myself using it. Although I don't use colour detection often inside of my projects, I'm sure in the future I'll try my hand at making a pen-based game, and this could be really useful. Especially if I change some variables… I could even make a colour picker feature!
- braxbroscratcher
-
1000+ posts
Color at x: () y: () block.
BAD BAD BAD. STAHP GIVING OUT WAYS TO STEAL IMAGES OF PPL. Color at x, y block would be really useful for 100% pen games. But to check a color for a cloud draw program you can use this:set [r v] to (0)
repeat (32)
set [g v] to (0)
repeat (32)
set [b v] to (0)
repeat (16)
if <touching color (((r) * (65536)) + (((g) * (256)) + (b)))> then
add (((r) * (65536)) + (((g) * (256)) + (b))) to [color scan v]
end
change [b v] by (16)
end
change [g v] by (8)
end
change [r v] by (8)
end
In all seriousness, this workaround needs to be silenced as it can steal people's images and stash them in cloud where they cannot be modified by you in any way.
- stickfiregames
-
1000+ posts
Color at x: () y: () block.
You can't freeze the webcam, so someone would have to stay still for a long time to get a decent picture them. Besides, that script isn't the most efficient way to scan the screen, although it is the simplest.BAD BAD BAD. STAHP GIVING OUT WAYS TO STEAL IMAGES OF PPL. Color at x, y block would be really useful for 100% pen games. But to check a color for a cloud draw program you can use this:set [r v] to (0)
repeat (32)
set [g v] to (0)
repeat (32)
set [b v] to (0)
repeat (16)
if <touching color (((r) * (65536)) + (((g) * (256)) + (b)))> then
add (((r) * (65536)) + (((g) * (256)) + (b))) to [color scan v]
end
change [b v] by (16)
end
change [g v] by (8)
end
change [r v] by (8)
end
In all seriousness, this workaround needs to be silenced as it can steal people's images and stash them in cloud where they cannot be modified by you in any way.
- braxbroscratcher
-
1000+ posts
Color at x: () y: () block.
You can go fast using run without screen refresh and use it in many clones, thus stealing images quickly and easily.You can't freeze the webcam, so someone would have to stay still for a long time to get a decent picture them. Besides, that script isn't the most efficient way to scan the screen, although it is the simplest.BAD BAD BAD. STAHP GIVING OUT WAYS TO STEAL IMAGES OF PPL. Color at x, y block would be really useful for 100% pen games. But to check a color for a cloud draw program you can use this:set [r v] to (0)
repeat (32)
set [g v] to (0)
repeat (32)
set [b v] to (0)
repeat (16)
if <touching color (((r) * (65536)) + (((g) * (256)) + (b)))> then
add (((r) * (65536)) + (((g) * (256)) + (b))) to [color scan v]
end
change [b v] by (16)
end
change [g v] by (8)
end
change [r v] by (8)
end
In all seriousness, this workaround needs to be silenced as it can steal people's images and stash them in cloud where they cannot be modified by you in any way.
- Discussion Forums
- » Suggestions
-
» Color at x: () y: () block.