color ramp calculation fixed for gradients with many stops
This commit is contained in:
parent
776468953d
commit
9d4c423591
@ -244,7 +244,8 @@ QImage QskRgb::colorTable( int size, const QskGradientStops& stops )
|
||||
|
||||
const auto n = index2 - index1;
|
||||
|
||||
for ( int j = 0; j < n; j++ )
|
||||
values[ index1 ] = ARGB2RGBA( rgb1 );
|
||||
for ( int j = 1; j < n; j++ )
|
||||
{
|
||||
const auto rgb = QskRgb::interpolated( rgb1, rgb2, qreal( j ) / ( n - 1 ) );
|
||||
values[ index1 + j] = ARGB2RGBA( rgb );
|
||||
|
@ -26,7 +26,8 @@ namespace
|
||||
from the internet ),
|
||||
*/
|
||||
|
||||
setImage( QskRgb::colorTable( 256, stops ) );
|
||||
const int size = qBound( 256, 2 * stops.count(), 1024 );
|
||||
setImage( QskRgb::colorTable( size, stops ) );
|
||||
|
||||
const auto wrapMode = this->wrapMode( spreadMode );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user