mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Fix invalid color could be returned by QgsRandomColorsV2
This commit is contained in:
parent
cf2f6b17fa
commit
3c45b2352a
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user