Skip to content

Commit

Permalink
fix setting color alpha to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Sep 15, 2020
1 parent edd1f61 commit 411dc6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/widgets/colorproducerwidget.cpp
Expand Up @@ -68,7 +68,9 @@ void ColorProducerWidget::on_colorButton_clicked()
dialog.setOption(QColorDialog::ShowAlphaChannel);
if (dialog.exec() == QDialog::Accepted) {
auto newColor = dialog.currentColor();
if (newColor.alpha() == 0 && newColor != color) {
auto rgb = newColor;
rgb.setAlpha(color.alpha());
if (newColor.alpha() == 0 && rgb != color) {
newColor.setAlpha(255);
}
ui->colorLabel->setText(colorToString(newColor));
Expand Down

0 comments on commit 411dc6f

Please sign in to comment.