Skip to content

Commit

Permalink
Fix malformed color command #293 (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
ServiusHack authored Jun 11, 2024
1 parent bb65df8 commit 73683a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/Core/Commands/SolidColorCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/Widgets/Inspector/InspectorSolidColorWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit 73683a4

Please sign in to comment.