Preserve alpha value in colorizer.
This commit is contained in:
parent
a8a4cc8c1a
commit
5a9878bea9
1 changed files with 4 additions and 3 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue