[Core] Add possibility to set color with tuple of integers, fixes #8344
This commit is contained in:
@@ -3270,11 +3270,10 @@ void PropertyColorItem::setValue(const QVariant& value)
|
||||
if (hasExpression() || !value.canConvert<QColor>())
|
||||
return;
|
||||
auto col = value.value<QColor>();
|
||||
App::Color val; val.setValue<QColor>(col);
|
||||
QString data = QString::fromLatin1("(%1,%2,%3)")
|
||||
.arg(val.r, 0, 'f', decimals())
|
||||
.arg(val.g, 0, 'f', decimals())
|
||||
.arg(val.b, 0, 'f', decimals());
|
||||
.arg(col.red())
|
||||
.arg(col.green())
|
||||
.arg(col.blue());
|
||||
setPropertyValue(data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user