Skip to content

Commit

Permalink
fix(ProjectColors): Set default color
Browse files Browse the repository at this point in the history
according to project color model.
Fixes #58323
  • Loading branch information
troopa81 authored and nyalldawson committed Aug 20, 2024
1 parent c7120cf commit 2d7491a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/qgsprojectproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2621,7 +2621,11 @@ void QgsProjectProperties::setCurrentEllipsoid( const QString &ellipsoidAcronym

void QgsProjectProperties::mButtonAddColor_clicked()
{
QColor newColor = QgsColorDialog::getColor( QColor(), this->parentWidget(), tr( "Select Color" ), true );
const Qgis::ColorModel colorModel = mColorModel->currentData().value<Qgis::ColorModel>();
const QColor defaultColor = colorModel == Qgis::ColorModel::Cmyk ?
QColor::fromCmykF( 0., 1., 1., 0. ) : QColor::fromRgbF( 1., 0., 0. );

QColor newColor = QgsColorDialog::getColor( defaultColor, this->parentWidget(), tr( "Select Color" ), true );
if ( !newColor.isValid() )
{
return;
Expand Down

0 comments on commit 2d7491a

Please sign in to comment.