Skip to content

Commit 3c45b23

Browse files
committed
Fix invalid color could be returned by QgsRandomColorsV2
1 parent cf2f6b1 commit 3c45b23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/symbology-ng/qgsvectorcolorrampv2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ QColor QgsRandomColorsV2::color( double value ) const
397397
}
398398

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

0 commit comments

Comments
 (0)