diff --git a/src/common/QskRgbValue.cpp b/src/common/QskRgbValue.cpp index 4aeaa63d..5dcb8b45 100644 --- a/src/common/QskRgbValue.cpp +++ b/src/common/QskRgbValue.cpp @@ -122,3 +122,34 @@ QColor QskRgbValue::interpolated( const QColor& c1, const QColor& c2, qreal rati else return qskInterpolatedColor( c1.convertTo( c2.spec() ), c2, ratio ); } + +QRgb QskRgbValue::rgb( Qt::GlobalColor color ) +{ + using namespace QskRgbValue; + + static constexpr QRgb rgbValues[] = + { + White, // Qt::color0 + Black, // Qt::color1 + Black, // Qt::black + White, // Qt::white + Grey, // Qt::darkGray + qRgb( 160, 160, 164 ), // Qt::gray + Silver, // Qt::lightGray + Red, // Qt::red + Lime, // Qt::green + Blue, // Qt::blue + Cyan, // Qt::cyan + Magenta, // Qt::magenta + Yellow, // Qt::yellow + Maroon, // Qt::darkRed + Green, // Qt::darkGreen + Navy, // Qt::darkBlue + Teal, // Qt::darkCyan + Purple, // Qt::darkMagenta + Olive, // Qt::darkYellow + Transparent // Qt::transparent + }; + + return rgbValues[ color ]; +} diff --git a/src/common/QskRgbValue.h b/src/common/QskRgbValue.h index e6ebbe89..fd990d47 100644 --- a/src/common/QskRgbValue.h +++ b/src/common/QskRgbValue.h @@ -56,7 +56,7 @@ RGB( Aquamarine, 0xff7fffd4 ) \ RGB( Maroon, 0xff800000 ) \ RGB( Purple, 0xff800080 ) \ - RGB( Olive, 0xff808080 ) \ + RGB( Olive, 0xff808000 ) \ RGB( Grey, 0xff808080 ) \ RGB( SkyBlue, 0xff87ceeb ) \ RGB( LightSkyBlue, 0xff87cefa ) \ @@ -425,6 +425,7 @@ RGB( BlueGrey800, 0xff37474f ) \ RGB( BlueGrey900, 0xff263238 ) \ \ + RGB( Transparent, 0x00000000 ) \ RGB( AlphaMask, 0xff000000 ) \ RGB( ColorMask, 0x00ffffff ) @@ -434,6 +435,7 @@ namespace QskRgbValue QSK_RGB_VALUES #undef RGB + QSK_EXPORT QRgb rgb( Qt::GlobalColor ); QSK_EXPORT QRgb interpolated( QRgb rgb1, QRgb rgb2, qreal ratio ); QSK_EXPORT QColor interpolated( const QColor& c1, const QColor& c2, qreal ratio );