Skip to content

Commit

Permalink
Return rgb from all colour functions
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed May 17, 2013
1 parent 2c7eff7 commit 0711ddf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/qgsexpression.cpp
Expand Up @@ -1202,7 +1202,7 @@ static QVariant fcnColorRgb( const QVariantList &values, QgsFeature *, QgsExpres
color = QColor( 0, 0, 0 );
}

return color.name();
return QString( "%1,%2,%3" ).arg( color.red() ).arg( color.green() ).arg( color.blue() );
}

static QVariant fncColorRgba( const QVariantList &values, QgsFeature *, QgsExpression *parent )
Expand Down Expand Up @@ -1231,7 +1231,7 @@ QVariant fcnRampColor( const QVariantList &values, QgsFeature *, QgsExpression *
}
double value = getDoubleValue( values.at( 1 ), parent );
QColor color = mRamp->color( value );
return color.name();
return QString( "%1,%2,%3" ).arg( color.red() ).arg( color.green() ).arg( color.blue() );
}

static QVariant fcnColorHsl( const QVariantList &values, QgsFeature *, QgsExpression *parent )
Expand All @@ -1251,7 +1251,7 @@ static QVariant fcnColorHsl( const QVariantList &values, QgsFeature *, QgsExpres
color = QColor( 0, 0, 0 );
}

return color.name();
return QString( "%1,%2,%3" ).arg( color.red() ).arg( color.green() ).arg( color.blue() );
}

static QVariant fncColorHsla( const QVariantList &values, QgsFeature *, QgsExpression *parent )
Expand Down Expand Up @@ -1291,7 +1291,7 @@ static QVariant fcnColorHsv( const QVariantList &values, QgsFeature *, QgsExpres
color = QColor( 0, 0, 0 );
}

return color.name();
return QString( "%1,%2,%3" ).arg( color.red() ).arg( color.green() ).arg( color.blue() );
}

static QVariant fncColorHsva( const QVariantList &values, QgsFeature *, QgsExpression *parent )
Expand Down Expand Up @@ -1333,7 +1333,7 @@ static QVariant fcnColorCmyk( const QVariantList &values, QgsFeature *, QgsExpre
color = QColor( 0, 0, 0 );
}

return color.name();
return QString( "%1,%2,%3" ).arg( color.red() ).arg( color.green() ).arg( color.blue() );
}

static QVariant fncColorCmyka( const QVariantList &values, QgsFeature *, QgsExpression *parent )
Expand Down

0 comments on commit 0711ddf

Please sign in to comment.