对比颜色 - CmpColorHex
函数简介
对比指定颜色是否在指定的颜色范围区间内,包含下限(>= color1) 包含上限(<= color2)。
接口名称
CmpColorHex
DLL调用
int CmpColorHex(long ola, string color, string color1, string color2);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| ola | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| color | 字符串 | 需要对比的颜色,格式 RRGGBB 或 AARRGGBB |
| color1 | 字符串 | 颜色起始范围,格式 RRGGBB 或 AARRGGBB |
| color2 | 字符串 | 颜色结束范围,格式 RRGGBB 或 AARRGGBB |
示例
C++
long instance = CreateCOLAPlugInterFace();
// 判断颜色FF0000是否在EE0000~FF5555范围内
int ret = CmpColorHex(instance, "FF0000", "EE0000", "FF5555");
if (ret == 1) {
printf("颜色在指定范围内\n");
}
Python
# 待补充
返回值
整数型:1 成功,0 失败。
