Skip to content

Compare Color ​

Check whether the pixel at a specific coordinate in the latest screenshot matches the expected color, with optional channel deviation.

Interface Description ​

Interface Type ​

cmpColor

Parameters ​

ParameterTypeRequiredDescription
deviceIdstringYesTarget device ID
xnumberYesX coordinate (0 ≤ x < screen width)
ynumberYesY coordinate (0 ≤ y < screen height)
colorstringYes6-digit hex color only, e.g. "FFCC00"
thresholdnumberNoDefault 1. Similarity = round((1 - threshold) * 255) with the same value applied to all three channels

Return Value ​

Returns true if the pixel color falls within the tolerance of any segment; otherwise false.

Cooperation: try.catch@foxmail.com