Skip to content

Commit

Permalink
fix factor premultiplication
Browse files Browse the repository at this point in the history
  • Loading branch information
louwers committed Jan 16, 2025
1 parent 014f2ba commit 04091e0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/mbgl/util/color.rs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ namespace mbgl {
std::optional<Color> Color::parse(const std::string& s) {
const auto css_color = rustutils::parse_css_color(s);
if (css_color.success) {
const float factor = css_color.a / 255;
return {{css_color.r * factor, css_color.g * factor, css_color.b * factor, css_color.a}};
return {{css_color.r * css_color.a, css_color.g * css_color.a, css_color.b * css_color.a, css_color.a}};
} else {
return {};
}
Expand Down

0 comments on commit 04091e0

Please sign in to comment.