i need commend thats know if its red ,
there is more then 6k diffrent red colors code #ff0000
there is a way to do all the reds ? in one simple command
commend thats know if its red(all the kind of red) Topic is solved
Re: commend thats know if its red(all the kind of red)
Have a look at the PixelSearch command with Variation of 0-255
Re: commend thats know if its red(all the kind of red)
How do you come to that conclusion? For example, If red is defined as XX0000, where X =0,...,9,A,...F, then there is 256 different reds, but FF0001, looks more red than 010000, so how do you define red?UZIEL7717 wrote: there is more then 6k diffrent red colors code #ff0000
Edit: I suppose no one would define 000000 as red, so 255 reds then.
Edit 2:
Code: Select all
isRed(color)
{
; Messed up this comment...
return color > 65535
}
Last edited by Helgef on 27 Aug 2016, 07:27, edited 1 time in total.
Re: commend thats know if its red(all the kind of red)
There are way more than 255 reds. Definitely thousands of reds. Are you saying you wouldn't classify FF0101 as red? If you look at it, you wouldn't call it anything but red. Same for a whole lot of other levels of green and blue added to it as well.
Re: commend thats know if its red(all the kind of red)
I'm not saying that. Author said, there is more than 6k and typed FF0000, I asked how the author defines red. How many reds exists depends on definition and the space considered. In real life there is infinite many reds, and it's subjective. isRed is a useful function if you want to know if a color contains any red information, its not meant to answer a question like, does this color look red to the (a) human eye?
Re: commend thats know if its red(all the kind of red)
this is my code right now :Helgef wrote:I'm not saying that. Author said, there is more than 6k and typed FF0000, I asked how the author defines red. How many reds exists depends on definition and the space considered. In real life there is infinite many reds, and it's subjective. isRed is a useful function if you want to know if a color contains any red information, its not meant to answer a question like, does this color look red to the (a) human eye?
Code: Select all
F1::pause, toggle
F3::
Loop,
{
CoordMode, Pixel, Screen
x1:=960
y1:=540
color1:=0xbe7367
color2:=0xfe8a8a
color3:=0xff0000
repeat:
Loop
PixelGetColor,colorFound,x1,y1,
until (colorFound=color1 || colorFound=color2 || colorFound=color3|| )
MouseClick, left
}
return
what i need to put in color1 to make it only red ..
can you help me and chang it for me please
what i want its to send left click mouse when its see red in x1:=960
y1:=540
Re: commend thats know if its red(all the kind of red)
only red would beUZIEL7717 wrote:what i need to put in color1 to make it only red ..
can you help me and chang it for me please
- 0x0000FF if you use PixelGetColor the way you do (BGR format)
- 0xFF0000 if you use PixelGetColor with the additional , RGB parameter
Otherwise you have to specify a custom function to test, e.g.
Code: Select all
isReddish(p_rgb_color){
; split color:
_r := p_rgb_color & 255
_g := (p_rgb_color >> 8) & 255
_b := (p_rgb_color >> 16) & 255
; totally deliberate definition of reddish: red channel must be 1.5 times of the sum of green & blue
Return, _r > (_g + _b) * 1.5
}
; ...
Loop
PixelGetColor, colorFound, x1, y1, RGB
until isReddish(colorFound)
MouseClick, left
Re: commend thats know if its red(all the kind of red)
p3trus wrote:only red would beUZIEL7717 wrote:what i need to put in color1 to make it only red ..
can you help me and chang it for me please
- 0x0000FF if you use PixelGetColor the way you do (BGR format)
- 0xFF0000 if you use PixelGetColor with the additional , RGB parameter
Otherwise you have to specify a custom function to test, e.g.
Code: Select all
isReddish(p_rgb_color){ ; split color: _r := p_rgb_color & 255 _g := (p_rgb_color >> 8) & 255 _b := (p_rgb_color >> 16) & 255 ; totally deliberate definition of reddish: red channel must be 1.5 times of the sum of green & blue Return, _r > (_g + _b) * 1.5 } ; ... Loop PixelGetColor, colorFound, x1, y1, RGB until isReddish(colorFound) MouseClick, left
Code: Select all
F1::pause, toggle
F3::
Loop,
{
CoordMode, Pixel, Screen
x1:=960
y1:=540
isReddish(p_rgb_color){
; split color:
_r := p_rgb_color & 255
_g := (p_rgb_color >> 8) & 255
_b := (p_rgb_color >> 16) & 255
; totally deliberate definition of reddish: red channel must be 1.5 times of the sum of green & blue
Return, _r > (_g + _b) * 1.5
}
; ...
Loop
PixelGetColor, colorFound, x1, y1, RGB
until isReddish(colorFound)
MouseClick, left
}
return
; ...
Re: commend thats know if its red(all the kind of red)
Like this?UZIEL7717 wrote: what i need to put in color1 to make it only red ..
Code: Select all
makeRed(color)
{
; Input color: 0xRRGGBB
; Output: 0xRR0000
; R,G,B ∈[ 0,...,9,A,...,F]
return color >> 16 << 16
}
; Edit: or
extractRedComponent(color)
{
; Input color: 0xRRGGBB
; Output: RR
; R,G,B ∈[ 0,...,9,A,...,F]
return color >> 16
}
Re: commend thats know if its red(all the kind of red) Topic is solved
UZIEL7717 wrote:its still dont work for red
Code: Select all
; define the following only once:
CoordMode, Pixel, Screen
isReddish(p_rgb_color){
; split color:
_r := p_rgb_color & 255
_g := (p_rgb_color >> 8) & 255
_b := (p_rgb_color >> 16) & 255
; totally deliberate definition of reddish: red channel must be 1.5 times of the sum of green & blue
Return, _r > (_g + _b) * 1.5
}
F1::pause, toggle
F3::
; if those coords never change, define them in the very top section, but in any case outside of the following loop
x1:=960
y1:=540
Loop, ; do you want to run this endlessly? otherwise this loop is bogus
{
Loop
PixelGetColor, colorFound, x1, y1, RGB
until isReddish(colorFound)
MouseClick, left ; <<<<< #### most likely you have to adjust that to the right position - this command clicks at the *current mouse position*
}
Return
Re: commend thats know if its red(all the kind of red)
the script you give me work but not for red.p3trus wrote:UZIEL7717 wrote:its still dont work for redIf it STILL does not work - please provide more details about what you actually want to do with your script; maybe even some screenshots showing what you want to detect, which colors are occuring there, and what it's supposed to do.Code: Select all
; define the following only once: CoordMode, Pixel, Screen isReddish(p_rgb_color){ ; split color: _r := p_rgb_color & 255 _g := (p_rgb_color >> 8) & 255 _b := (p_rgb_color >> 16) & 255 ; totally deliberate definition of reddish: red channel must be 1.5 times of the sum of green & blue Return, _r > (_g + _b) * 1.5 } F1::pause, toggle F3:: ; if those coords never change, define them in the very top section, but in any case outside of the following loop x1:=960 y1:=540 Loop, ; do you want to run this endlessly? otherwise this loop is bogus { Loop PixelGetColor, colorFound, x1, y1, RGB until isReddish(colorFound) MouseClick, left ; <<<<< #### most likely you have to adjust that to the right position - this command clicks at the *current mouse position* } Return
only for blue and purple .. i need it click only red(yellow and orange also good) not purple blue
there is screenshots on colors i try :
https://s16.postimg.org/4gxg7tebp/png.png
the script you gave me click only on the colors i type "work"
Re: commend thats know if its red(all the kind of red)
hey again can you add this click colors red only here :Helgef wrote:Like this?UZIEL7717 wrote: what i need to put in color1 to make it only red ..Code: Select all
makeRed(color) { ; Input color: 0xRRGGBB ; Output: 0xRR0000 ; R,G,B ∈[ 0,...,9,A,...,F] return color >> 16 << 16 } ; Edit: or extractRedComponent(color) { ; Input color: 0xRRGGBB ; Output: RR ; R,G,B ∈[ 0,...,9,A,...,F] return color >> 16 }
Code: Select all
F1::pause, toggle
F3::
Loop,
{
CoordMode, Pixel, Screen
x1:=960
y1:=540
color1:=0xbe7367
repeat:
Loop
PixelGetColor,colorFound,x1,y1,
until (colorFound=color1 ||)
MouseClick, left
}
return
Re: commend thats know if its red(all the kind of red)
I don't mean to be neither thick nor rude here, but you have yet to make a clear definition of what you consider to be red, you said there's more than 6k reds, I don't know which 6k red you mean. I can't help you with the information I have, and I won't make any more guesses. I'm not even sure your latest question is on topic, you have marked the topic as solved.
Re: commend thats know if its red(all the kind of red)
UZIEL7717 wrote:the script you give me work but not for red.
only for blue and purple .. i need it click only red(yellow and orange also good) not purple blue
d'oh...
Sorry, made up a wrong test func, confused RGB <> BGR myself
use instead:
Code: Select all
isReddish(p_rgb_color){
; split color:
_r := (p_rgb_color >> 16) & 255
_g := (p_rgb_color >> 8) & 255
_b := p_rgb_color & 255
; totally deliberate definition of reddish: red channel must be 1.5 times of the sum of green & blue
Return, _r > (_g + _b) * 1.5
}
/edit: the Return, _r > (_g + _b) * 1.5 defines what is seen as red. You can change that to your needs. To exclude 'purplish' colors, add aor change the restriction on the _b blue channel.
eg. Return, _r > (_b * 3) - that allows only colors with the blue component being < 1/3 of the red component [ignoring the green channel completely]