Detect color at a single Point
Color Detection
is pretty much the same as Image Detection.
Rather than searching for an image in Region
, we check for a color at a single Point
.
Where to detect color. This is no different than a Point
in a Click
or Swipe
It's recommended to use the coordinates from the Color Picker
When doing color detection. We use a different metric to compare color. It's called delta E
.
Delta E (dE)
is a metric for understanding how the human eye perceives color difference.
Lower dE figures indicate greater accuracy, while high dE levels indicate a significant mismatch.
In most case, colors look the same with dE < 10. Identical colors will have dE = 0.
Alpha channel (transparency) is not a color property and most device doesn't capture the alpha channel, but if you need it you can enable the Include Alpha Channel option to include it in the algorithm.
// Get color at point 500, 200
var color = Color.get(Point(500, 200))
// Compare color
if (color and color.isSame("#FFRRGGBB")) {
// Same color
} else {
// Different color
}
© 2024 - Macrorify by KoK-CODE