Skip to content
Permalink
Browse files

Fix invalid color could be returned by QgsRandomColorsV2

  • Loading branch information
nyalldawson committed Aug 5, 2015
1 parent cf2f6b1 commit 3c45b2352a2a26931b6fcf3fe8100f978412d73d
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/symbology-ng/qgsvectorcolorrampv2.cpp
@@ -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 );

0 comments on commit 3c45b23

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