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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user