Skip to content

Commit 1874c37

Browse files
committed
Fix random color ramps returning invalid QColors for value of 1.0
(cherry-picked from 1d2b4cb)
1 parent fd394b9 commit 1874c37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/symbology-ng/qgsvectorcolorrampv2.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ double QgsVectorRandomColorRampV2::value( int index ) const
295295
QColor QgsVectorRandomColorRampV2::color( double value ) const
296296
{
297297
int colorCnt = mColors.count();
298-
int colorIdx = ( int )( value * colorCnt );
298+
int colorIdx = ( int )( value * ( colorCnt - 1 ) );
299299

300300
if ( colorIdx >= 0 && colorIdx < colorCnt )
301301
return mColors.at( colorIdx );

0 commit comments

Comments
 (0)