Skip to content

Commit 73683a4

Browse files
authored
Fix malformed color command CasparCG#293 (CasparCG#314)
1 parent bb65df8 commit 73683a4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Core/Commands/SolidColorCommand.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ const QString SolidColorCommand::getPremultipliedColor() const
2828
green = (green * alpha) / 255;
2929
blue = (blue * alpha) / 255;
3030

31-
return QString("#%1%2%3%4").arg(alpha, 2, 16)
32-
.arg(red, 2, 16)
33-
.arg(green, 2, 16)
34-
.arg(blue, 2, 16);
31+
return QString("#%1%2%3%4").arg(alpha, 2, 16, QChar('0'))
32+
.arg(red, 2, 16, QChar('0'))
33+
.arg(green, 2, 16, QChar('0'))
34+
.arg(blue, 2, 16, QChar('0'));
3535
}
3636

3737
const QString& SolidColorCommand::getTransition() const

src/Widgets/Inspector/InspectorSolidColorWidget.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ void InspectorSolidColorWidget::colorDialogClicked()
123123

124124
if (dialog.exec() == QDialog::Accepted)
125125
{
126-
QString color = QString("#%1%2%3%4").arg(dialog.selectedColor().alpha(), 2, 16)
127-
.arg(dialog.selectedColor().red(), 2, 16)
128-
.arg(dialog.selectedColor().green(), 2, 16)
129-
.arg(dialog.selectedColor().blue(), 2, 16);
126+
QString color = QString("#%1%2%3%4").arg(dialog.selectedColor().alpha(), 2, 16, QChar('0'))
127+
.arg(dialog.selectedColor().red(), 2, 16, QChar('0'))
128+
.arg(dialog.selectedColor().green(), 2, 16, QChar('0'))
129+
.arg(dialog.selectedColor().blue(), 2, 16, QChar('0'));
130130

131131
this->lineEditColor->setText(color.toUpper());
132132
}

0 commit comments

Comments
 (0)