File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 3030
3131static QColor _interpolate ( QColor c1, QColor c2, double value )
3232{
33+ if ( isnan ( value ) ) value = 1 ;
3334 int r = ( int )( c1.red () + value * ( c2.red () - c1.red () ) );
3435 int g = ( int )( c1.green () + value * ( c2.green () - c1.green () ) );
3536 int b = ( int )( c1.blue () + value * ( c2.blue () - c1.blue () ) );
@@ -365,11 +366,10 @@ double QgsRandomColorsV2::value( int index ) const
365366
366367QColor QgsRandomColorsV2::color ( double value ) const
367368{
368- Q_UNUSED ( value );
369369 int minVal = 130 ;
370370 int maxVal = 255 ;
371371
372- int colorIndex = value * ( mTotalColorCount - 1 );
372+ int colorIndex = ! isnan ( value ) ? value : 1 * ( mTotalColorCount - 1 );
373373 if ( mTotalColorCount >= 1 && mPrecalculatedColors .length () > colorIndex )
374374 {
375375 // use precalculated hue
You can’t perform that action at this time.
0 commit comments