Skip to content
Permalink
Browse files

Fix invalid color could be returned by QgsRandomColorsV2

(cherry-picked from 3c45b23)
  • Loading branch information
nyalldawson committed Aug 5, 2015
1 parent a8ad5c1 commit 98f68a480139afce0b11d7c6665a041843bd1a48
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/symbology-ng/qgsvectorcolorrampv2.cpp
@@ -395,7 +395,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 );

0 comments on commit 98f68a4

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