Contain various methods to do Color Detection
Color(color: number | string | Color)
Construct a color from its number representation, color string or another Color object
Parameters | |
color | The number representation of the color, the color as a string ("#FFRRGGBB" or "#RRGGBB") or another Color object |
static Color get(point: Point)
Get the color at the coordinate. Return null if the device fail to capture the screen
Parameters | |
point | The coordinate to get the color |
Return | |
Color | The color |
static Color[] get(points: Point[])
Get all the colors at the coordinates. If you need colors at multiple locations, this will be faster than getting the color one by one. Return null if the device fail to capture the screen
Parameters | |
points | The coordinates to get the color |
Return | |
Color[] | An array of colors |
static number compare(color1: Color, color2: Color)
Compare the two color and return the similarity
Parameters | |
color1 | The first color |
color2 | The second color |
Return | |
number | The similarity between the two color. Range 0 to 1. |
static number compareRGB(color1: Color, color2: Color)
Compare the two color and return the similarity. This uses the RGB colorspace for comparing
Parameters | |
color1 | The first color |
color2 | The second color |
Return | |
number | The similarity between the two color. Range 0 to 1. |
number value()
Get the number representation of the color
Return | |
number | The number representation of the color |
string valueString()
Get the string representation of the color
Return | |
string | The string representation of the color |
number red()
Get the red component of the color
Return | |
number | The red component |
number green()
Get the green component of the color
Return | |
number | The green component |
number blue()
Get the blue component of the color
Return | |
number | The blue component |
number alpha()
Get the alpha component of the color
Return | |
number | The alpha component |
© 2022 - Macrorify by KoK-CODE