Gui: StyleParameters - use Base::Color instead of QColor

If possible we should prefer using our own classess instead of ones
coming from frameworks. This changes Style Parameters to use Base::Color
class instead of QColor. Calculations are still done using QColor but
the data is always exposed as Base::Color.
This commit is contained in:
Kacper Donat
2025-08-10 23:01:14 +02:00
parent 3a209a7e90
commit cf55183ece
7 changed files with 93 additions and 90 deletions

View File

@@ -95,9 +95,9 @@ std::string Value::toString() const
return fmt::format("{}{}", value, unit);
}
if (std::holds_alternative<QColor>(*this)) {
auto color = std::get<QColor>(*this);
return fmt::format("#{:0>6x}", 0xFFFFFF & color.rgb()); // NOLINT(*-magic-numbers)
if (std::holds_alternative<Base::Color>(*this)) {
auto color = std::get<Base::Color>(*this);
return fmt::format("#{:0>6x}", color.getPackedRGB() >> 8); // NOLINT(*-magic-numbers)
}
return std::get<std::string>(*this);