diff --git a/src/Core/Commands/SolidColorCommand.cpp b/src/Core/Commands/SolidColorCommand.cpp index ec828aff..1d1912a9 100755 --- a/src/Core/Commands/SolidColorCommand.cpp +++ b/src/Core/Commands/SolidColorCommand.cpp @@ -28,10 +28,10 @@ const QString SolidColorCommand::getPremultipliedColor() const green = (green * alpha) / 255; blue = (blue * alpha) / 255; - return QString("#%1%2%3%4").arg(alpha, 2, 16) - .arg(red, 2, 16) - .arg(green, 2, 16) - .arg(blue, 2, 16); + return QString("#%1%2%3%4").arg(alpha, 2, 16, QChar('0')) + .arg(red, 2, 16, QChar('0')) + .arg(green, 2, 16, QChar('0')) + .arg(blue, 2, 16, QChar('0')); } const QString& SolidColorCommand::getTransition() const diff --git a/src/Widgets/Inspector/InspectorSolidColorWidget.cpp b/src/Widgets/Inspector/InspectorSolidColorWidget.cpp index fc35eda7..280b45f3 100644 --- a/src/Widgets/Inspector/InspectorSolidColorWidget.cpp +++ b/src/Widgets/Inspector/InspectorSolidColorWidget.cpp @@ -123,10 +123,10 @@ void InspectorSolidColorWidget::colorDialogClicked() if (dialog.exec() == QDialog::Accepted) { - QString color = QString("#%1%2%3%4").arg(dialog.selectedColor().alpha(), 2, 16) - .arg(dialog.selectedColor().red(), 2, 16) - .arg(dialog.selectedColor().green(), 2, 16) - .arg(dialog.selectedColor().blue(), 2, 16); + QString color = QString("#%1%2%3%4").arg(dialog.selectedColor().alpha(), 2, 16, QChar('0')) + .arg(dialog.selectedColor().red(), 2, 16, QChar('0')) + .arg(dialog.selectedColor().green(), 2, 16, QChar('0')) + .arg(dialog.selectedColor().blue(), 2, 16, QChar('0')); this->lineEditColor->setText(color.toUpper()); }