Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix invalid color could be returned by QgsRandomColorsV2
(cherry-picked from 3c45b23)
  • Loading branch information
nyalldawson committed Aug 5, 2015
1 parent 5502222 commit 877b7d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsvectorcolorrampv2.cpp
Expand Up @@ -397,7 +397,7 @@ QColor QgsRandomColorsV2::color( double value ) const
}

//can't use precalculated hues, use a totally random hue
int h = 1 + ( int )( 360.0 * qrand() / ( RAND_MAX + 1.0 ) );
int h = ( int )( 360.0 * qrand() / ( RAND_MAX + 1.0 ) );
int s = ( qrand() % ( DEFAULT_RANDOM_SAT_MAX - DEFAULT_RANDOM_SAT_MIN + 1 ) ) + DEFAULT_RANDOM_SAT_MIN;
int v = ( qrand() % ( maxVal - minVal + 1 ) ) + minVal;
return QColor::fromHsv( h, s, v );
Expand Down

0 comments on commit 877b7d9

Please sign in to comment.