Skip to content
Permalink
Browse files

Fix random color ramps returning invalid QColors for value of 1.0

(cherry-picked from 1d2b4cb)
  • Loading branch information
nyalldawson committed Aug 4, 2015
1 parent fd394b9 commit 1874c371ae2deaa9eb30f9ce75bca70173f6b3e0
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/symbology-ng/qgsvectorcolorrampv2.cpp
@@ -295,7 +295,7 @@ double QgsVectorRandomColorRampV2::value( int index ) const
QColor QgsVectorRandomColorRampV2::color( double value ) const
{
int colorCnt = mColors.count();
int colorIdx = ( int )( value * colorCnt );
int colorIdx = ( int )( value * ( colorCnt - 1 ) );

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

0 comments on commit 1874c37

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