App: Extend/change color API:

* Also set/get alpha value in setValue/asValue
* Add new static method fromValue
This commit is contained in:
wmayer
2024-11-29 07:52:55 +01:00
committed by Chris Hennes
parent 598e32cdb3
commit e34fd72956
2 changed files with 19 additions and 3 deletions

View File

@@ -196,7 +196,7 @@ public:
auto item = ui->elementList->item(i);
auto col = item->data(Qt::UserRole).value<QColor>();
std::string sub = qPrintable(item->data(Qt::UserRole + 1).value<QString>());
info.emplace(sub, App::Color(col.redF(), col.greenF(), col.blueF(), col.alphaF()));
info.emplace(sub, App::Color::fromValue<QColor>(col));
}
if (!App::GetApplication().getActiveTransaction()) {
App::GetApplication().setActiveTransaction("Set colors");