Skip to content

Commit

Permalink
Preserve alpha value in colorizer.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Sep 17, 2021
1 parent a8a4cc8 commit 5a9878b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/style/style_palette_colorizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,16 @@ std::optional<QColor> colorize(const QColor &color, const colorizer &with) {
auto hue = 0;
auto saturation = 0;
auto lightness = 0;
color.getHsv(&hue, &saturation, &lightness);
auto alpha = 0;
color.getHsv(&hue, &saturation, &lightness, &alpha);
const auto result = colorize(
colorizer::Color{ hue, saturation, lightness },
with);
if (!result) {
return std::nullopt;
}
const auto &fields = *result;
return QColor::fromHsv(fields.hue, fields.saturation, fields.value);
const auto &hsv = *result;
return QColor::fromHsv(hsv.hue, hsv.saturation, hsv.value, alpha);
}

QByteArray colorize(
Expand Down

0 comments on commit 5a9878b

Please sign in to comment.