[core] Fixed to-rgba with zero opacity

This commit is contained in:
Minh Nguyễn
2018-03-30 03:21:44 -07:00
parent f4d9fb816d
commit d066e94103
5 changed files with 27 additions and 15 deletions

View File

@@ -209,12 +209,7 @@ std::unordered_map<std::string, CompoundExpressionRegistry::Definition> initiali
);
});
define("to-rgba", [](const Color& color) -> Result<std::array<double, 4>> {
return std::array<double, 4> {{
255 * color.r / color.a,
255 * color.g / color.a,
255 * color.b / color.a,
color.a
}};
return color.toArray();
});
define("rgba", rgba);