From deaffd1f5336e8ddaf4d450f133354cf3d612079 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Sat, 14 Dec 2019 19:01:38 +0100 Subject: [PATCH] Qt 5.14 adjustments --- src/common/QskRgbValue.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/common/QskRgbValue.cpp b/src/common/QskRgbValue.cpp index d236c079..4aeaa63d 100644 --- a/src/common/QskRgbValue.cpp +++ b/src/common/QskRgbValue.cpp @@ -11,6 +11,11 @@ namespace { return int( from + ( to - from ) * ratio ); } + + inline qreal valueF( qreal from, qreal to, qreal ratio ) + { + return int( from + ( to - from ) * ratio ); + } } static inline QColor qskInterpolatedColor( @@ -55,6 +60,17 @@ static inline QColor qskInterpolatedColor( return QColor::fromHsl( h, s, l, a ); } +#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 ) + case QColor::ExtendedRgb: + { + const qreal r = valueF( c1.redF(), c2.redF(), ratio ); + const qreal g = valueF( c1.greenF(), c2.greenF(), ratio ); + const qreal b = valueF( c1.blueF(), c2.blueF(), ratio ); + const qreal a = valueF( c1.alphaF(), c2.alphaF(), ratio ); + + return QColor::fromRgbF( r, g, b, a ); + } +#endif case QColor::Invalid: break; }