Add files via upload

This commit is contained in:
LYS
2023-06-03 09:39:17 +08:00
committed by GitHub
parent 620cfa1317
commit 61845d8d50

View File

@@ -333,11 +333,21 @@ module.exports = function (scriptRuntime, scope) {
list[i * 3 + 2] = colors.toInt(color); list[i * 3 + 2] = colors.toInt(color);
} }
let opt = options || {}; let opt = options || {};
let findAll = opt.All || false;
if (findAll) {
return Array.from(rtImages.colorFinder.findAllMultiColors(img,
colors.toInt(firstColor),
_.parseThreshold(opt),
'region' in opt ? _.buildRegion(img, opt.region) : null,
list));
} else {
return rtImages.colorFinder.findMultiColors(img, return rtImages.colorFinder.findMultiColors(img,
colors.toInt(firstColor), colors.toInt(firstColor),
_.parseThreshold(opt), _.parseThreshold(opt),
'region' in opt ? _.buildRegion(img, opt.region) : null, 'region' in opt ? _.buildRegion(img, opt.region) : null,
list); list);
}
}, },
findImage(img, template, options) { findImage(img, template, options) {
_.initIfNeeded(); _.initIfNeeded();