Skip to content

Commit 1d2b4cb

Browse files
committedAug 4, 2015
Fix random color ramps returning invalid QColors for value of 1.0
1 parent 5690402 commit 1d2b4cb

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
@@ -297,7 +297,7 @@ double QgsVectorRandomColorRampV2::value( int index ) const
297297
QColor QgsVectorRandomColorRampV2::color( double value ) const
298298
{
299299
int colorCnt = mColors.count();
300-
int colorIdx = ( int )( value * colorCnt );
300+
int colorIdx = ( int )( value * ( colorCnt - 1 ) );
301301

302302
if ( colorIdx >= 0 && colorIdx < colorCnt )
303303
return mColors.at( colorIdx );

0 commit comments

Comments
 (0)
Please sign in to comment.