This commit is contained in:
hyb1996
2017-05-27 14:49:25 +08:00
parent 302879333a
commit 7c88e578fe
16 changed files with 143 additions and 75 deletions

View File

@@ -11,6 +11,13 @@ module.exports = function(__runtime__, scope){
images.saveImage = __runtime__.images.saveImage.bind(__runtime__.images);
images.findColor = function(img, color, options){
if(typeof(color) == 'string'){
if(color.startsWith('#')){
color = parseInt('0x' + color.substring(1));
}else{
color = parseInt('0x' + color);
}
}
options = options || {};
var region = options.region || [];
x = region[0] || 0;