Skip to content
Permalink
Browse files

Fix calculation of random colors following 4d72d72

  • Loading branch information
nyalldawson committed Oct 13, 2014
1 parent 083ebfe commit 08d80160ea0eb3389d194a8e218b68e189217d1e
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/core/symbology-ng/qgsvectorcolorrampv2.cpp
@@ -369,7 +369,8 @@ QColor QgsRandomColorsV2::color( double value ) const
int minVal = 130;
int maxVal = 255;

int colorIndex = !isnan( value ) ? value : 1 * ( mTotalColorCount - 1 );
//if value is nan, then use last precalculated color
int colorIndex = ( !isnan( value ) ? value : 1 ) * ( mTotalColorCount - 1 );
if ( mTotalColorCount >= 1 && mPrecalculatedColors.length() > colorIndex )
{
//use precalculated hue

1 comment on commit 08d8016

@nyalldawson

This comment has been minimized.

Copy link
Collaborator Author

@nyalldawson nyalldawson commented on 08d8016 Oct 13, 2014

oops - this commit message should have read "following 083ebfe"

Please sign in to comment.
You can’t perform that action at this time.