求分享~~~
builtin-2d-gray-sprite 里有个这个:
float gray = 0.2126color.r + 0.7152color.g + 0.0722*color.b;
graySprite(gray: boolean, sp: cc.Sprite) {
let material = null;
if (gray) material = cc.Material.getBuiltinMaterial('2d-gray-sprite');
else material = cc.Material.getBuiltinMaterial('2d-sprite');
material = cc.MaterialVariant.create(material, sp);
sp.setMaterial(0, material);
}
这个是置灰…有没有蒙灰的效果…

类似这种
…好像修改图片的颜色就能实现…