From 061cdb0a072f11c84f8f0278cdf6e26c6690b1c2 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Sat, 18 Jun 2022 11:32:48 +0200 Subject: [PATCH 1/8] minor improvements of the push button layout --- examples/buttons/TestButton.qml | 8 +-- examples/buttons/buttons.qml | 14 ++--- src/controls/QskPushButtonSkinlet.cpp | 81 ++++++++++++--------------- 3 files changed, 46 insertions(+), 57 deletions(-) diff --git a/examples/buttons/TestButton.qml b/examples/buttons/TestButton.qml index 65550e1c..33e083cb 100644 --- a/examples/buttons/TestButton.qml +++ b/examples/buttons/TestButton.qml @@ -5,15 +5,15 @@ Qsk.PushButton { sizePolicy { - // long texts, should not have an effect + // avoid the effect of long texts horizontalPolicy: Qsk.SizePolicy.Ignored verticalPolicy: Qsk.SizePolicy.Ignored } - minimumSize - { + minimumSize + { width: 80 - height: 60 + height: 60 } shape diff --git a/examples/buttons/buttons.qml b/examples/buttons/buttons.qml index e8296251..afd690d1 100644 --- a/examples/buttons/buttons.qml +++ b/examples/buttons/buttons.qml @@ -11,14 +11,14 @@ Qsk.Window height: 600 color: "Beige" - Component.onCompleted: - { - // very much standard: we should find a better way + Component.onCompleted: + { + // very much standard: we should find a better way - var hint = sizeConstraint(); - setMinimumWidth( hint.width ) - setMinimumHeight( hint.height ) - } + var hint = sizeConstraint(); + setMinimumWidth( hint.width ) + setMinimumHeight( hint.height ) + } Qsk.Shortcut { diff --git a/src/controls/QskPushButtonSkinlet.cpp b/src/controls/QskPushButtonSkinlet.cpp index 3eb73fbe..45bd1531 100644 --- a/src/controls/QskPushButtonSkinlet.cpp +++ b/src/controls/QskPushButtonSkinlet.cpp @@ -8,6 +8,7 @@ #include "QskGraphic.h" #include "QskTextOptions.h" +#include "QskFunctions.h" #include #include @@ -87,22 +88,25 @@ QRectF QskPushButtonSkinlet::textRect( using Q = QskPushButton; auto r = button->subControlContentsRect( contentsRect, Q::Panel ); + if ( r.isEmpty() || !button->hasGraphic() ) + return r; - if ( button->hasGraphic() ) + /* + For horizontal layouts Text depends on Graphic, while + for vertical Graphic depends on Text. Confusing ... + */ + if ( qskOrientation( button ) == Qt::Horizontal ) { - if ( qskOrientation( button ) == Qt::Horizontal ) - { - const auto graphicsRect = subControlRect( button, contentsRect, Q::Graphic ); - const auto spacing = button->spacingHint( Q::Panel ); + const auto graphicsRect = subControlRect( button, contentsRect, Q::Graphic ); + const auto spacing = button->spacingHint( Q::Panel ); - r.setX( r.x() + graphicsRect.width() + spacing ); - } - else - { - const qreal h = button->effectiveFontHeight( Q::Text ); - if ( h < r.height() ) - r.setTop( r.bottom() - h ); - } + r.setX( r.x() + graphicsRect.width() + spacing ); + } + else + { + const qreal h = button->effectiveFontHeight( Q::Text ); + if ( h < r.height() ) + r.setTop( r.bottom() - h ); } return r; @@ -114,18 +118,20 @@ QRectF QskPushButtonSkinlet::graphicRect( using Q = QskPushButton; auto r = button->subControlContentsRect( contentsRect, Q::Panel ); + if ( r.isEmpty() || button->text().isEmpty() ) + return r; const auto orientation = qskOrientation( button ); - if ( !button->text().isEmpty() && orientation == Qt::Vertical ) + if ( orientation == Qt::Vertical ) { const auto textRect = subControlRect( button, contentsRect, Q::Text ); - qreal h = textRect.height() + button->spacingHint( Q::Panel ); + const auto h = textRect.height() + button->spacingHint( Q::Panel ); - if ( h < r.height() ) - r.setBottom( r.bottom() - h ); - else - r.setHeight( 0 ); + if ( h > r.height() ) + return QRectF(); + + r.setBottom( r.bottom() - h ); } const auto maxSize = button->graphicSourceSize(); @@ -149,37 +155,20 @@ QRectF QskPushButtonSkinlet::graphicRect( } } - const auto sz = button->graphic().defaultSize(); + r = r.marginsRemoved( button->paddingHint( Q::Graphic ) ); - if ( !( r.isEmpty() || sz.isEmpty() ) ) + if ( !r.isEmpty() ) { - // inner rectangle according to the aspect ratio - - const double scaleFactor = - qMin( r.width() / sz.width(), r.height() / sz.height() ); - - const int w = qFloor( scaleFactor * sz.width() ); - const int h = qFloor( scaleFactor * sz.height() ); - int x, y; - - if ( orientation == Qt::Horizontal ) + auto sz = button->graphic().defaultSize(); + if ( !sz.isEmpty() ) { - x = r.left(); - y = r.top(); + sz.scale( r.size(), Qt::KeepAspectRatio ); + + const auto align = ( orientation == Qt::Horizontal ) + ? ( Qt::AlignLeft | Qt::AlignTop ) : Qt::AlignCenter; + + r = qskAlignedRectF( r, sz.width(), sz.height(), align ); } - else - { - // early aligning to avoid pointless operations, that finally will - // have no effect, when drawing to an integer based paint device - - x = qFloor( r.center().x() - 0.5 * w ); - y = qFloor( r.center().y() - 0.5 * h ); - } - - r = QRectF( x, y, w, h ); - - const auto padding = button->paddingHint( Q::Graphic ); - r = r.marginsRemoved( padding ); } return r; From 501a3ae07e472cf7feb08fe0cb6b4e67d4918120 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Fri, 24 Jun 2022 17:19:04 +0200 Subject: [PATCH 2/8] RGB converter for the HCT color system introduced --- src/common/QskHctColor.cpp | 835 +++++++++++++++++++++++++++++++++++++ src/common/QskHctColor.h | 45 ++ src/src.pro | 2 + 3 files changed, 882 insertions(+) create mode 100644 src/common/QskHctColor.cpp create mode 100644 src/common/QskHctColor.h diff --git a/src/common/QskHctColor.cpp b/src/common/QskHctColor.cpp new file mode 100644 index 00000000..61a51f55 --- /dev/null +++ b/src/common/QskHctColor.cpp @@ -0,0 +1,835 @@ +#include "QskHctColor.h" + +#include +#include + +/* + Code has been copied, rearranged and translated to C++ without trying + to understand the implemented algorithms. All credits go to the authors of + https://github.com/material-foundation/material-color-utilities. + */ + +/* + Copyright 2021 Google LLC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +namespace +{ + class XYZ + { + public: + constexpr XYZ() noexcept = default; + + constexpr XYZ( double x, double y, double z ) noexcept + : x( x ) + , y( y ) + , z( z ) + { + } + + double value( int axis ) const + { + switch( axis ) + { + case 0: + return x; + case 1: + return y; + case 2: + return z; + } + + return 0.0; + } + + double x = 0.0; + double y = 0.0; + double z = 0.0; + }; + + class ViewingConditions + { + public: + + const double backgroundYTowhitePointY = 0.18418651851244416; + + const double aw = 29.980997194447337; + const double nbb = 1.0169191804458755; + const double z = 1.909169568483652; + const double fl = 0.38848145378003529; + + const XYZ rgbD = { 1.02117770275752, 0.98630772942801237, 0.93396050828022992 }; + }; +} + +static const XYZ Y_FROM_LINRGB = { 0.2126, 0.7152, 0.0722 }; + +static double planes[] = +{ + 0.015176349177441876, + 0.045529047532325624, + 0.07588174588720938, + 0.10623444424209313, + 0.13658714259697685, + 0.16693984095186062, + 0.19729253930674434, + 0.2276452376616281, + 0.2579979360165119, + 0.28835063437139563, + 0.3188300904430532, + 0.350925934958123, + 0.3848314933096426, + 0.42057480301049466, + 0.458183274052838, + 0.4976837250274023, + 0.5391024159806381, + 0.5824650784040898, + 0.6277969426914107, + 0.6751227633498623, + 0.7244668422128921, + 0.775853049866786, + 0.829304845476233, + 0.8848452951698498, + 0.942497089126609, + 1.0022825574869039, + 1.0642236851973577, + 1.1283421258858297, + 1.1946592148522128, + 1.2631959812511864, + 1.3339731595349034, + 1.407011200216447, + 1.4823302800086415, + 1.5599503113873272, + 1.6398909516233677, + 1.7221716113234105, + 1.8068114625156377, + 1.8938294463134073, + 1.9832442801866852, + 2.075074464868551, + 2.1693382909216234, + 2.2660538449872063, + 2.36523901573795, + 2.4669114995532007, + 2.5710888059345764, + 2.6777882626779785, + 2.7870270208169257, + 2.898822059350997, + 3.0131901897720907, + 3.1301480604002863, + 3.2497121605402226, + 3.3718988244681087, + 3.4967242352587946, + 3.624204428461639, + 3.754355295633311, + 3.887192587735158, + 4.022731918402185, + 4.160988767090289, + 4.301978482107941, + 4.445716283538092, + 4.592217266055746, + 4.741496401646282, + 4.893568542229298, + 5.048448422192488, + 5.20615066083972, + 5.3666897647573375, + 5.5300801301023865, + 5.696336044816294, + 5.865471690767354, + 6.037501145825082, + 6.212438385869475, + 6.390297286737924, + 6.571091626112461, + 6.7548350853498045, + 6.941541251256611, + 7.131223617812143, + 7.323895587840543, + 7.5195704746346665, + 7.7182615035334345, + 7.919981813454504, + 8.124744458384042, + 8.332562408825165, + 8.543448553206703, + 8.757415699253682, + 8.974476575321063, + 9.194643831691977, + 9.417930041841839, + 9.644347703669503, + 9.873909240696694, + 10.106627003236781, + 10.342513269534024, + 10.58158024687427, + 10.8238400726681, + 11.069304815507364, + 11.317986476196008, + 11.569896988756009, + 11.825048221409341, + 12.083451977536606, + 12.345119996613247, + 12.610063955123938, + 12.878295467455942, + 13.149826086772048, + 13.42466730586372, + 13.702830557985108, + 13.984327217668513, + 14.269168601521828, + 14.55736596900856, + 14.848930523210871, + 15.143873411576273, + 15.44220572664832, + 15.743938506781891, + 16.04908273684337, + 16.35764934889634, + 16.66964922287304, + 16.985093187232053, + 17.30399201960269, + 17.62635644741625, + 17.95219714852476, + 18.281524751807332, + 18.614349837764564, + 18.95068293910138, + 19.290534541298456, + 19.633915083172692, + 19.98083495742689, + 20.331304511189067, + 20.685334046541502, + 21.042933821039977, + 21.404114048223256, + 21.76888489811322, + 22.137256497705877, + 22.50923893145328, + 22.884842241736916, + 23.264076429332462, + 23.6469514538663, + 24.033477234264016, + 24.42366364919083, + 24.817520537484558, + 25.21505769858089, + 25.61628489293138, + 26.021211842414342, + 26.429848230738664, + 26.842203703840827, + 27.258287870275353, + 27.678110301598522, + 28.10168053274597, + 28.529008062403893, + 28.96010235337422, + 29.39497283293396, + 29.83362889318845, + 30.276079891419332, + 30.722335150426627, + 31.172403958865512, + 31.62629557157785, + 32.08401920991837, + 32.54558406207592, + 33.010999283389665, + 33.4802739966603, + 33.953417292456834, + 34.430438229418264, + 34.911345834551085, + 35.39614910352207, + 35.88485700094671, + 36.37747846067349, + 36.87402238606382, + 37.37449765026789, + 37.87891309649659, + 38.38727753828926, + 38.89959975977785, + 39.41588851594697, + 39.93615253289054, + 40.460400508064545, + 40.98864111053629, + 41.520882981230194, + 42.05713473317016, + 42.597404951718396, + 43.141702194811224, + 43.6900349931913, + 44.24241185063697, + 44.798841244188324, + 45.35933162437017, + 45.92389141541209, + 46.49252901546552, + 47.065252796817916, + 47.64207110610409, + 48.22299226451468, + 48.808024568002054, + 49.3971762874833, + 49.9904556690408, + 50.587870934119984, + 51.189430279724725, + 51.79514187861014, + 52.40501387947288, + 53.0190544071392, + 53.637271562750364, + 54.259673423945976, + 54.88626804504493, + 55.517063457223934, + 56.15206766869424, + 56.79128866487574, + 57.43473440856916, + 58.08241284012621, + 58.734331877617365, + 59.39049941699807, + 60.05092333227251, + 60.715611475655585, + 61.38457167773311, + 62.057811747619894, + 62.7353394731159, + 63.417162620860914, + 64.10328893648692, + 64.79372614476921, + 65.48848194977529, + 66.18756403501224, + 66.89098006357258, + 67.59873767827808, + 68.31084450182222, + 69.02730813691093, + 69.74813616640164, + 70.47333615344107, + 71.20291564160104, + 71.93688215501312, + 72.67524319850172, + 73.41800625771542, + 74.16517879925733, + 74.9167682708136, + 75.67278210128072, + 76.43322770089146, + 77.1981124613393, + 77.96744375590167, + 78.74122893956174, + 79.51947534912904, + 80.30219030335869, + 81.08938110306934, + 81.88105503125999, + 82.67721935322541, + 83.4778813166706, + 84.28304815182372, + 85.09272707154808, + 85.90692527145302, + 86.72564993000343, + 87.54890820862819, + 88.3767072518277, + 89.2090541872801, + 90.04595612594655, + 90.88742016217518, + 91.73345337380438, + 92.58406282226491, + 93.43925555268066, + 94.29903859396902, + 95.16341895893969, + 96.03240364439274, + 96.9059996312159, + 97.78421388448044, + 98.6670533535366, + 99.55452497210776, +}; + +static inline int delinearized( double rgbComponent ) +{ + const double normalized = rgbComponent / 100.0; + + double v = 0.0; + + if ( normalized <= 0.0031308 ) + v = normalized * 12.92; + else + v = 1.055 * pow( normalized, 1.0 / 2.4 ) - 0.055; + + return qBound( 0, qRound( v * 255 ), 255 ); +} + +static inline double labInvf( double ft ) +{ + const double e = 216.0 / 24389.0; + const double kappa = 24389.0 / 27.0; + const double ft3 = ft * ft * ft; + + if ( ft3 > e ) + return ft3; + + return ( 116 * ft - 16 ) / kappa; +} + +static inline double sanitizeDegreesDouble( double degrees ) +{ + degrees = fmod( degrees, 360.0 ); + + if (degrees < 0) + degrees = degrees + 360.0; + + return degrees; +} + +static inline double yFromLstar( double lstar ) +{ + return 100.0 * labInvf( ( lstar + 16.0 ) / 116.0 ); +} + +static inline QRgb argbFromLstar( double lstar ) +{ + const double y = yFromLstar(lstar); + const int component = delinearized(y); + + return qRgb( component, component, component ); +} + +static inline QRgb argbFromLinrgb( const XYZ& linrgb ) +{ + const int r = delinearized( linrgb.x ); + const int g = delinearized( linrgb.y ); + const int b = delinearized( linrgb.z ); + + return qRgb( r, g, b ); +} + +static inline double sanitizeRadians( double angle ) +{ + return fmod( angle + M_PI * 8, M_PI * 2 ); +} + +static inline double trueDelinearized( double rgbComponent ) +{ + const double normalized = rgbComponent / 100.0; + double v = 0.0; + + if ( normalized <= 0.0031308 ) + v = normalized * 12.92; + else + v = 1.055 * pow( normalized, 1.0 / 2.4 ) - 0.055; + + return v * 255.0; +} + +static inline int signum( double num ) +{ + if (num == 0) + return 0; + + return ( num < 0 ) ? -1 : 1; +} + +static inline XYZ matrixMultiply( const XYZ& row, const XYZ matrix[3] ) +{ + XYZ r; + + r.x = row.x * matrix[0].x + row.y * matrix[0].y + row.z * matrix[0].z; + r.y = row.x * matrix[1].x + row.y * matrix[1].y + row.z * matrix[1].z; + r.z = row.x * matrix[2].x + row.y * matrix[2].y + row.z * matrix[2].z; + + return r; +} + +static inline double chromaticAdaptation( double component ) +{ + const double af = pow( abs( component ), 0.42); + return signum(component) * 400.0 * af / ( af + 27.13 ); +} + +static inline double hueOf( const XYZ& linrgb ) +{ + constexpr XYZ matrix[3] = + { + { 0.001200833568784504, 0.002389694492170889, 0.0002795742885861124 }, + { 0.0005891086651375999, 0.0029785502573438758, 0.0003270666104008398 }, + { 0.00010146692491640572, 0.0005364214359186694, 0.0032979401770712076 } + }; + + const XYZ scaledDiscount = matrixMultiply( linrgb, matrix ); + + const double rA = chromaticAdaptation( scaledDiscount.x ); + const double gA = chromaticAdaptation( scaledDiscount.y ); + const double bA = chromaticAdaptation( scaledDiscount.z ); + + const double a = ( 11.0 * rA + -12.0 * gA + bA ) / 11.0; + const double b = ( rA + gA - 2.0 * bA ) / 9.0; + + return atan2( b, a ); +} + +static bool areInCyclicOrder( double a, double b, double c ) +{ + const double deltaAB = sanitizeRadians( b - a ); + const double deltaAC = sanitizeRadians( c - a ); + + return deltaAB < deltaAC; +} + +static inline double intercept( double source, double mid, double target ) +{ + return ( mid - source ) / ( target - source ); +} + +static inline XYZ setCoordinate( const XYZ& source, + double coordinate, const XYZ& target, int axis ) +{ + const double t = intercept( source.value(axis), coordinate, target.value(axis) ); + + XYZ r; + + r.x = source.x + ( target.x - source.x ) * t; + r.y = source.y + ( target.y - source.y ) * t; + r.z = source.z + ( target.z - source.z ) * t; + + return r; +} + +static bool isBounded( double x ) +{ + return 0.0 <= x && x <= 100.0; +} + +static XYZ nthVertex( double y, int n ) +{ + const double kR = Y_FROM_LINRGB.x; + const double kG = Y_FROM_LINRGB.y; + const double kB = Y_FROM_LINRGB.z; + + const double coordA = ( n % 4 <= 1 ) ? 0.0 : 100.0; + const double coordB = ( n % 2 == 0 ) ? 0.0 : 100.0; + + if ( n < 4 ) + { + const double g = coordA; + const double b = coordB; + const double r = ( y - g * kG - b * kB ) / kR; + + if ( isBounded(r) ) + return XYZ( r, g, b ); + } + else if ( n < 8 ) + { + const double b = coordA; + const double r = coordB; + const double g = ( y - r * kR - b * kB ) / kG; + + if ( isBounded(g) ) + return XYZ( r, g, b ); + } + else + { + const double r = coordA; + const double g = coordB; + const double b = ( y - r * kR - g * kG ) / kB; + + if ( isBounded(b) ) + return XYZ( r, g, b ); + } + + return { -1.0, -1.0, -1.0 }; +} + +void bisectToSegment( double y, double targetHue, XYZ& left, XYZ& right ) +{ + left = { -1.0, -1.0, -1.0 }; + right = left; + + double leftHue = 0.0; + double rightHue = 0.0; + + bool initialized = false; + bool uncut = true; + + for ( int n = 0; n < 12; n++ ) + { + XYZ mid = nthVertex(y, n); + if ( mid.x < 0 ) + continue; + + const double midHue = hueOf( mid ); + if ( !initialized ) + { + left = mid; + right = mid; + leftHue = midHue; + rightHue = midHue; + initialized = true; + + continue; + } + + if ( uncut || areInCyclicOrder( leftHue, midHue, rightHue ) ) + { + uncut = false; + + if ( areInCyclicOrder( leftHue, targetHue, midHue ) ) + { + right = mid; + rightHue = midHue; + } + else + { + left = mid; + leftHue = midHue; + } + } + } +} + +static XYZ midpoint( const XYZ& a, const XYZ& b ) +{ + XYZ r; + r.x = ( a.x + b.x ) / 2; + r.y = ( a.y + b.y ) / 2; + r.z = ( a.z + b.z ) / 2; + + return r; +} + +static int planeBelow( double x ) +{ + return qFloor( x - 0.5 ); +} + +static int planeAbove( double x ) +{ + return qCeil( x - 0.5 ); +} + +static XYZ bisectToLimit( double y, double targetHue ) +{ + XYZ left, right; + bisectToSegment( y, targetHue, left, right ); + + double leftHue = hueOf(left); + + for ( int axis = 0; axis < 3; axis++ ) + { + const double l = left.value(axis); + const double r = right.value(axis); + + if ( l != r ) + { + int lPlane = -1; + int rPlane = 255; + + if ( l < r ) + { + lPlane = planeBelow( trueDelinearized( l ) ); + rPlane = planeAbove( trueDelinearized( r ) ); + } + else + { + lPlane = planeAbove( trueDelinearized( l ) ); + rPlane = planeBelow( trueDelinearized( r ) ); + } + + for ( int i = 0; i < 8; i++ ) + { + if ( abs( rPlane - lPlane ) <= 1 ) + break; + + const int mPlane = qFloor( ( lPlane + rPlane ) / 2.0 ); + const double midPlaneCoordinate = planes[mPlane]; + + const XYZ mid = setCoordinate(left, midPlaneCoordinate, right, axis); + const double midHue = hueOf( mid ); + + if ( areInCyclicOrder( leftHue, targetHue, midHue ) ) + { + right = mid; + rPlane = mPlane; + } + else + { + left = mid; + leftHue = midHue; + lPlane = mPlane; + } + } + } + } + + return midpoint( left, right ); +} + +static double inverseChromaticAdaptation( double adapted ) +{ + const double adaptedAbs = abs( adapted ); + + double base = 27.13 * adaptedAbs / ( 400.0 - adaptedAbs ); + if ( base < 0.0 ) + base = 0.0; + + return signum(adapted) * pow( base, 1.0 / 0.42 ); +} + +static QRgb findResultByJ( double hueRadians, double chroma, double y ) +{ + double j = sqrt(y) * 11.0; + + constexpr ViewingConditions vc; + + const double tInnerCoeff = 1.0 / pow( 1.64 - pow( 0.29, vc.backgroundYTowhitePointY ), 0.73 ); + const double eHue = 0.25 * ( cos( hueRadians + 2.0 ) + 3.8 ); + const double p1 = eHue * ( 50000.0 / 13.0 ) * vc.nbb; + const double hSin = sin(hueRadians); + const double hCos = cos(hueRadians); + + for ( int i = 0; i < 5; i++ ) + { + const double jNormalized = j / 100.0; + const double alpha = ( chroma == 0.0 || j == 0.0 ) ? 0.0 : chroma / sqrt(jNormalized); + const double t = pow( alpha * tInnerCoeff, 1.0 / 0.9 ); + const double ac = vc.aw * pow( jNormalized, 1.0 / 0.69 / vc.z ); + const double p2 = ac / vc.nbb; + + const double gamma = 23.0 * ( p2 + 0.305 ) * t / + ( 23.0 * p1 + 11 * t * hCos + 108.0 * t * hSin ); + const double a = gamma * hCos; + const double b = gamma * hSin; + + const double rA = ( 460.0 * p2 + 451.0 * a + 288.0 * b ) / 1403.0; + const double gA = ( 460.0 * p2 - 891.0 * a - 261.0 * b ) / 1403.0; + const double bA = ( 460.0 * p2 - 220.0 * a - 6300.0 * b ) / 1403.0; + + XYZ rgbScaled; + rgbScaled.x = inverseChromaticAdaptation( rA ); + rgbScaled.y = inverseChromaticAdaptation( gA ); + rgbScaled.z = inverseChromaticAdaptation( bA ); + + constexpr XYZ matrix[3] = + { + { 1373.2198709594231, -1100.4251190754821, -7.278681089101213, }, + { -271.815969077903, 559.6580465940733, -32.46047482791194 }, + { 1.9622899599665666, -57.173814538844006, 308.7233197812385 } + }; + + const XYZ linrgb = matrixMultiply( rgbScaled, matrix ); + + if ( linrgb.x < 0 || linrgb.y < 0 || linrgb.z < 0 ) + return 0; + + const double kR = Y_FROM_LINRGB.x; + const double kG = Y_FROM_LINRGB.y; + const double kB = Y_FROM_LINRGB.z; + + const double fnj = kR * linrgb.x + kG * linrgb.y + kB * linrgb.z; + if ( fnj <= 0 ) + return 0; + + if ( i == 4 || abs(fnj - y) < 0.002 ) + { + if ( linrgb.x > 100.01 || linrgb.y > 100.01 || linrgb.z > 100.01 ) + return 0; + + return argbFromLinrgb( linrgb ); + } + + j = j - ( fnj - y ) * j / ( 2 * fnj ); + } + + return 0; +} + +QRgb QskHctColor::rgb( double hue, double chroma, double tone ) +{ + if ( chroma < 0.0001 || tone < 0.0001 || tone > 99.9999 ) + return argbFromLstar( tone ); + + hue = sanitizeDegreesDouble( hue ); + + const double hueRadians = hue / 180.0 * M_PI; + const double y = yFromLstar( tone ); + + const QRgb rgb = findResultByJ( hueRadians, chroma, y ); + if ( rgb != 0 ) + return rgb; + + const XYZ linrgb = bisectToLimit( y, hueRadians ); + return argbFromLinrgb( linrgb ); +} + +static const XYZ SRGB_TO_XYZ[3] = +{ + { 0.41233895, 0.35762064, 0.18051042 }, + { 0.2126, 0.7152, 0.0722 }, + { 0.01932141, 0.11916382, 0.95034478 } +}; + +static double linearized( int rgbComponent ) +{ + const double normalized = rgbComponent / 255.0; + + if ( normalized <= 0.040449936 ) + return normalized / 12.92 * 100.0; + else + return pow( ( normalized + 0.055 ) / 1.055, 2.4) * 100.0; +} + +static XYZ xyzFromArgb( QRgb rgb) +{ + XYZ xyz; + + xyz.x = linearized( qRed(rgb) ); + xyz.y = linearized( qGreen(rgb) ); + xyz.z = linearized( qBlue(rgb) ); + + return matrixMultiply( xyz, SRGB_TO_XYZ ); +} + +void QskHctColor::getHueAndChroma( QRgb rgb, double& hue, double& chroma ) +{ + ViewingConditions vc; + + const XYZ xyz = xyzFromArgb( rgb ); + + const double x = xyz.x; + const double y = xyz.y; + const double z = xyz.z; + + const double rC = 0.401288 * x + 0.650173 * y - 0.051461 * z; + const double gC = -0.250268 * x + 1.204414 * y + 0.045854 * z; + const double bC = -0.002079 * x + 0.048952 * y + 0.953127 * z; + + const double rD = vc.rgbD.x * rC; + const double gD = vc.rgbD.y * gC; + const double bD = vc.rgbD.z * bC; + + const double rAF = pow( vc.fl * fabs( rD ) / 100.0, 0.42 ); + const double gAF = pow( vc.fl * fabs( gD ) / 100.0, 0.42 ); + + const double bAF = pow( vc.fl * fabs( bD ) / 100.0, 0.42); + const double rA = signum(rD) * 400.0 * rAF / ( rAF + 27.13 ); + const double gA = signum(gD) * 400.0 * gAF / ( gAF + 27.13 ); + const double bA = signum(bD) * 400.0 * bAF / ( bAF + 27.13 ); + + const double a = ( 11.0 * rA + -12.0 * gA + bA ) / 11.0; + const double b = ( rA + gA - 2.0 * bA ) / 9.0; + const double u = ( 20.0 * rA + 20.0 * gA + 21.0 * bA ) / 20.0; + + const double p2 = ( 40.0 * rA + 20.0 * gA + bA ) / 20.0; + + // hue + const double atanDegrees = atan2(b, a) * 180.0 / M_PI; + + // fmod ??? + hue = ( atanDegrees < 0 ) ? atanDegrees + 360.0 : atanDegrees >= + 360 ? atanDegrees - 360 : atanDegrees; + + { + const double ac = p2 * vc.nbb; + + const double J = 100.0 * pow( ac / vc.aw, 0.69 * vc.z ); + + const double huePrime = ( hue < 20.14 ) ? hue + 360 : hue; + const double eHue = ( 1.0 / 4.0 ) * ( cos( huePrime * M_PI / 180.0 + 2.0 ) + 3.8 ); + const double p1 = 50000.0 / 13.0 * eHue * vc.nbb; + const double t = p1 * sqrt(a * a + b * b) / ( u + 0.305 ); + + const double alpha = + pow(t, 0.9) * pow( 1.64 - pow(0.29, vc.backgroundYTowhitePointY), 0.73); + + chroma = alpha * sqrt(J / 100.0); + } +} diff --git a/src/common/QskHctColor.h b/src/common/QskHctColor.h new file mode 100644 index 00000000..80f468a9 --- /dev/null +++ b/src/common/QskHctColor.h @@ -0,0 +1,45 @@ +/****************************************************************************** + * QSkinny - Copyright (C) 2016 Uwe Rathmann + * This file may be used under the terms of the QSkinny License, Version 1.0 + *****************************************************************************/ + +#ifndef QSK_HCT_COLOR_H +#define QSK_HCT_COLOR_H + +#include "QskGlobal.h" +#include + +/* + For M(aterial)3 the new HTC color system has been created, that + is based on H(ue), (C)hroma, (T)one: + + https://material.io/blog/science-of-color-design + + This system allows to create color palettes by varying the tone + for given hue/chroma values. + + https://material-foundation.github.io/material-theme-builder/#/custom + shows how to create a tonal palette from a given RGB color. + + The methods in QskHctColor allow to do the same: + + QVector palette( const QRgb rgb ) + { + double hue, chroma; + QskHctColor::getHueAndChroma( rgb, hue, chroma ); + + QVector< QRgb > pal; + for ( int tone = 0; tone <= 100; tone += 10 ) + pal += rgbFromHct( hue, chroma, tone ); + + return pal; + } +*/ + +namespace QskHctColor +{ + QSK_EXPORT QRgb rgb( double hue, double chroma, double tone ); + QSK_EXPORT void getHueAndChroma( QRgb rgb, double& hue, double& chroma ); +} + +#endif diff --git a/src/src.pro b/src/src.pro index dbc58db8..a82d305f 100644 --- a/src/src.pro +++ b/src/src.pro @@ -27,6 +27,7 @@ HEADERS += \ common/QskGlobal.h \ common/QskGradient.h \ common/QskGradientStop.h \ + common/QskHctColor.h \ common/QskIntervalF.h \ common/QskMargins.h \ common/QskMetaFunction.h \ @@ -56,6 +57,7 @@ SOURCES += \ common/QskFunctions.cpp \ common/QskGradient.cpp \ common/QskGradientStop.cpp \ + common/QskHctColor.cpp \ common/QskIntervalF.cpp \ common/QskMargins.cpp \ common/QskMetaFunction.cpp \ From 98368d42acf252c32d2b6b63626caf750d28b68a Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Sat, 25 Jun 2022 16:10:00 +0200 Subject: [PATCH 3/8] typos fixed --- src/common/QskHctColor.h | 2 +- src/common/QskRgbValue.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/QskHctColor.h b/src/common/QskHctColor.h index 80f468a9..d8782e12 100644 --- a/src/common/QskHctColor.h +++ b/src/common/QskHctColor.h @@ -30,7 +30,7 @@ QVector< QRgb > pal; for ( int tone = 0; tone <= 100; tone += 10 ) - pal += rgbFromHct( hue, chroma, tone ); + pal += QskHctColor::rgb( hue, chroma, tone ); return pal; } diff --git a/src/common/QskRgbValue.h b/src/common/QskRgbValue.h index 17302613..b963c115 100644 --- a/src/common/QskRgbValue.h +++ b/src/common/QskRgbValue.h @@ -133,7 +133,7 @@ RGBVALUE( Red, 0xffff0000 ) \ RGBVALUE( RosyBrown, 0xffbc8f8f ) \ RGBVALUE( RoyalBlue, 0xff4169e1 ) \ - RGBVALUE( SaddleBown, 0xff8b4513 ) \ + RGBVALUE( SaddleBrown, 0xff8b4513 ) \ RGBVALUE( Salmon, 0xfffa8072 ) \ RGBVALUE( SandyBrown, 0xfff4a460 ) \ RGBVALUE( SeaGreen, 0xff2e8b57 ) \ From 6c7ba0489c2fc15810cbb89b1390990ac28fc6ee Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Sat, 25 Jun 2022 16:14:08 +0200 Subject: [PATCH 4/8] M(aterial)2 related code replaced --- examples/boxes/Box.cpp | 117 +++++--- examples/boxes/Box.h | 11 +- examples/boxes/main.cpp | 87 +++--- .../gallery/progressbar/ProgressBarPage.cpp | 29 +- examples/tabview/CustomSlider.cpp | 8 +- examples/tabview/CustomSliderSkinlet.cpp | 2 +- examples/tabview/OtherSlider.cpp | 8 +- skins/material/QskMaterialSkin.cpp | 17 +- skins/squiek/QskSquiekSkin.cpp | 2 +- src/common/QskGradient.cpp | 58 ++++ src/common/QskGradient.h | 3 + src/common/QskRgbPalette.cpp | 130 --------- src/common/QskRgbPalette.h | 89 ------ src/common/QskRgbValue.h | 273 ------------------ src/src.pro | 2 - 15 files changed, 230 insertions(+), 606 deletions(-) delete mode 100644 src/common/QskRgbPalette.cpp delete mode 100644 src/common/QskRgbPalette.h diff --git a/examples/boxes/Box.cpp b/examples/boxes/Box.cpp index a1de2035..defdc82c 100644 --- a/examples/boxes/Box.cpp +++ b/examples/boxes/Box.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include Box::Box( QQuickItem* parentItem ) : QskBox( parentItem ) @@ -22,7 +22,7 @@ Box::Box( QQuickItem* parentItem ) setGradientHint( QskBox::Panel, QskGradient() ); } -void Box::setBackground( FillType type, QskRgbPalette::Theme theme, bool inverted ) +void Box::setBackground( FillType type, QGradient::Preset preset, bool inverted ) { if ( type == Unfilled ) { @@ -30,59 +30,85 @@ void Box::setBackground( FillType type, QskRgbPalette::Theme theme, bool inverte return; } - const auto pal = QskRgbPalette::palette( theme ); + QskGradient gradient( preset ); - const QColor light = pal.color( QskRgbPalette::W300 ); - const QColor mid = pal.color( QskRgbPalette::W600 ); - - switch ( type ) + if ( type == Solid ) { - case Unfilled: - setGradient( QskGradient() ); - break; + const auto& stops = gradient.stops(); - case Solid: - setGradient( mid ); - break; + const auto color = QskGradientStop::interpolated( + stops.first(), stops.last(), 0.5 ); - default: - { - const auto orientation = - static_cast< QskGradient::Orientation >( type - 2 ); + setGradient( QskGradient( color ) ); + } + else + { + const auto orientation = + static_cast< QskGradient::Orientation >( type - 2 ); - if ( inverted ) - setGradient( orientation, mid, light ); - else - setGradient( orientation, light, mid ); - } + gradient.setOrientation( orientation ); + + if ( inverted ) + gradient.reverse(); + + setGradient( gradient ); } } -void Box::setBorder( BorderType type, QskRgbPalette::Theme theme ) +void Box::setBackground( FillType type, const QRgb base, bool inverted ) { - const auto pal = QskRgbPalette::palette( theme ); + if ( type == Unfilled ) + { + setGradient( QskGradient() ); + return; + } + double hue, chroma; + QskHctColor::getHueAndChroma( base, hue, chroma ); + + if ( type == Solid ) + { + setGradient( QskHctColor::rgb( hue, chroma, 50 ) ); + } + else + { + const auto dark = QskHctColor::rgb( hue, chroma, 40 ); + const auto light = QskHctColor::rgb( hue, chroma, 70 ); + + const auto orientation = + static_cast< QskGradient::Orientation >( type - 2 ); + + if ( inverted ) + setGradient( orientation, dark, light ); + else + setGradient( orientation, light, dark ); + } +} + +void Box::setBorder( BorderType type, const QRgb base ) +{ setBorderWidth( 5 ); - QColor dark = pal.color( QskRgbPalette::W700 ); - QColor mid = pal.color( QskRgbPalette::W500 ); - QColor light = pal.color( QskRgbPalette::W300 ); -#if 0 - dark.setAlpha( 100 ); - mid.setAlpha( 100 ); - light.setAlpha( 100 ); -#endif - - switch ( type ) + switch ( static_cast< int >( type ) ) { case NoBorder: setBorderWidth( 0 ); - break; + return; case Flat: - setBorderGradient( mid ); - break; + setBorderGradient( base ); + return; + } + double hue, chroma; + QskHctColor::getHueAndChroma( base, hue, chroma ); + + const auto dark = QskHctColor::rgb( hue, chroma, 40 ); + const auto mid = QskHctColor::rgb( hue, chroma, 65 ); + const auto light = QskHctColor::rgb( hue, chroma, 90 ); + + switch ( static_cast< int >( type ) ) + { case Raised1: setBorderGradients( light, light, dark, dark ); break; @@ -178,8 +204,19 @@ void Box::setGradient( const QskGradient& gradient ) } void Box::setGradient( - const QskGradient::Orientation orientation, QskRgbPalette::Theme theme ) + const QskGradient::Orientation orientation, const QRgb base ) { - const auto pal = QskRgbPalette::palette( theme ); - setGradient( QskGradient( orientation, pal.colorStops( true ) ) ); + double hue, chroma; + QskHctColor::getHueAndChroma( base, hue, chroma ); + + QVector< QRgb > rgb; + rgb.reserve( 10 ); + + for ( int i = 0; i < 10; i++ ) + { + const auto tone = 90 - i * 7; + rgb += QskHctColor::rgb( hue, chroma, tone ); + } + + setGradient( QskGradient( orientation, QskGradient::colorStops( rgb, true ) ) ); } diff --git a/examples/boxes/Box.h b/examples/boxes/Box.h index 4ee0bd06..de2c4205 100644 --- a/examples/boxes/Box.h +++ b/examples/boxes/Box.h @@ -5,7 +5,6 @@ #pragma once -#include #include class Box : public QskBox @@ -32,8 +31,10 @@ class Box : public QskBox Box( QQuickItem* parentItem = nullptr ); - void setBackground( FillType, QskRgbPalette::Theme, bool inverted = false ); - void setBorder( BorderType type, QskRgbPalette::Theme ); + void setBackground( FillType, QRgb, bool inverted = false ); + void setBackground( FillType, QGradient::Preset, bool inverted = false ); + + void setBorder( BorderType type, QRgb ); void setShape( const QskBoxShapeMetrics& ); void setShape( qreal radius, Qt::SizeMode ); @@ -55,6 +56,6 @@ class Box : public QskBox void setGradient( QskGradient::Orientation, const QColor&, const QColor&, const QColor& ); - void setGradient( const QskGradient& gradient ); - void setGradient( const QskGradient::Orientation, QskRgbPalette::Theme ); + void setGradient( const QskGradient& ); + void setGradient( const QskGradient::Orientation, QRgb ); }; diff --git a/examples/boxes/main.cpp b/examples/boxes/main.cpp index 95261fc2..8641e48d 100644 --- a/examples/boxes/main.cpp +++ b/examples/boxes/main.cpp @@ -21,6 +21,18 @@ #include +namespace +{ + // Some leftover definitions from M(aterial)2. TODO ... + + constexpr const QRgb Grey400 = 0xffbdbdbd; + constexpr const QRgb Grey500 = 0xff9e9e9e; + + constexpr const QRgb Lime200 = 0xffe6ee9c; + constexpr const QRgb Lime300 = 0xffdce775; + constexpr const QRgb Lime600 = 0xffc0ca33; +} + class MyRectangle : public Box { public: @@ -55,7 +67,7 @@ static void addTestRectangle( QskLinearBox* parent ) auto box = new Box( parent ); box->setMargins( 50 ); - box->setBorder( Box::Flat, QskRgbPalette::DeepOrange ); + box->setBorder( Box::Flat, QskRgb::OrangeRed ); box->setBorderWidth( 10, 20, 40, 20 ); QskBoxShapeMetrics shape( 50, Qt::RelativeSize ); @@ -63,7 +75,7 @@ static void addTestRectangle( QskLinearBox* parent ) shape.setRadius( Qt::TopRightCorner, 70 ); box->setShape( shape ); - box->setGradient( QskGradient::Diagonal, QskRgbPalette::Blue ); + box->setGradient( QskGradient::Diagonal, QskRgb::DodgerBlue ); } static void addRectangles1( QskLinearBox* parent ) @@ -72,7 +84,7 @@ static void addRectangles1( QskLinearBox* parent ) Box::Horizontal, Box::Vertical, Box::Diagonal } ) { auto* rectangle = new MyRectangle( parent ); - rectangle->setBackground( type, QskRgbPalette::Teal ); + rectangle->setBackground( type, QskRgb::Teal ); } } @@ -82,8 +94,8 @@ static void addRectangles2( QskLinearBox* parent ) Box::Horizontal, Box::Vertical, Box::Diagonal } ) { auto* rectangle = new MyRectangle( parent ); - rectangle->setBorder( Box::Flat, QskRgbPalette::Brown ); - rectangle->setBackground( type, QskRgbPalette::Yellow ); + rectangle->setBorder( Box::Flat, QskRgb::SaddleBrown ); + rectangle->setBackground( type, QGradient::SunnyMorning ); } } @@ -91,8 +103,7 @@ static void addRectangles3( QskLinearBox* parent ) { using namespace QskRgb; - const auto borderTheme = QskRgbPalette::Grey; - const auto fillTheme = QskRgbPalette::Blue; + const auto borderTheme = QskRgb::LightGray; Box* box; @@ -110,11 +121,11 @@ static void addRectangles3( QskLinearBox* parent ) box = new MyRectangle( parent ); box->setBorder( Box::Raised2, borderTheme ); - box->setBackground( Box::Vertical, fillTheme, false ); + box->setBackground( Box::Vertical, QGradient::RiverCity, true ); box = new MyRectangle( parent ); box->setBorder( Box::Sunken2, borderTheme ); - box->setBackground( Box::Vertical, fillTheme, true ); + box->setBackground( Box::Vertical, QGradient::RiverCity, false ); } static void addRectangles4( QskLinearBox* parent ) @@ -123,7 +134,7 @@ static void addRectangles4( QskLinearBox* parent ) Box::Horizontal, Box::Vertical, Box::Diagonal } ) { auto* box = new MyRoundedRectangle( parent ); - box->setBackground( type, QskRgbPalette::DeepOrange ); + box->setBackground( type, QskRgb::OrangeRed ); } } @@ -133,8 +144,8 @@ static void addRectangles5( QskLinearBox* parent ) Box::Horizontal, Box::Vertical, Box::Diagonal } ) { auto* box = new MyRoundedRectangle( parent ); - box->setBorder( Box::Flat, QskRgbPalette::Indigo ); - box->setBackground( type, QskRgbPalette::Pink ); + box->setBorder( Box::Flat, QskRgb::RoyalBlue ); + box->setBackground( type, QskRgb::DeepPink ); } } @@ -142,8 +153,7 @@ static void addRectangles6( QskLinearBox* parent ) { using namespace QskRgb; - const auto borderTheme = QskRgbPalette::Grey; - const auto fillTheme = QskRgbPalette::Lime; + const auto borderTheme = QskRgb::LightGrey; Box* box; @@ -161,11 +171,11 @@ static void addRectangles6( QskLinearBox* parent ) box = new MyRoundedRectangle( parent ); box->setBorder( Box::Raised2, borderTheme ); - box->setBackground( Box::Vertical, fillTheme, false ); + box->setGradient( QskGradient::Vertical, Lime300, Lime600 ); box = new MyRoundedRectangle( parent ); box->setBorder( Box::Sunken2, borderTheme ); - box->setBackground( Box::Vertical, fillTheme, true ); + box->setGradient( QskGradient::Vertical, Lime600, Lime300 ); } static void addRectangles7( QskLinearBox* parent ) @@ -174,7 +184,7 @@ static void addRectangles7( QskLinearBox* parent ) Box::Horizontal, Box::Vertical, Box::Diagonal } ) { auto* box = new MyEllipse( parent ); - box->setBackground( type, QskRgbPalette::BlueGrey ); + box->setBackground( type, QskRgb::SlateGrey ); } } @@ -184,8 +194,8 @@ static void addRectangles8( QskLinearBox* parent ) Box::Horizontal, Box::Vertical, Box::Diagonal } ) { auto* box = new MyEllipse( parent ); - box->setBorder( Box::Flat, QskRgbPalette::Indigo ); - box->setBackground( type, QskRgbPalette::Red ); + box->setBorder( Box::Flat, QskRgb::RoyalBlue ); + box->setBackground( type, QskRgb::FireBrick ); } } @@ -193,8 +203,7 @@ static void addRectangles9( QskLinearBox* parent ) { using namespace QskRgb; - const auto borderTheme = QskRgbPalette::Grey; - const auto fillTheme = QskRgbPalette::Lime; + const auto borderTheme = QskRgb::LightGrey; Box* box; @@ -212,11 +221,11 @@ static void addRectangles9( QskLinearBox* parent ) box = new MyEllipse( parent ); box->setBorder( Box::Raised2, borderTheme ); - box->setBackground( Box::Vertical, fillTheme, false ); + box->setGradient( QskGradient::Vertical, Lime200, Lime600 ); box = new MyEllipse( parent ); box->setBorder( Box::Sunken2, borderTheme ); - box->setBackground( Box::Vertical, fillTheme, true ); + box->setGradient( QskGradient::Vertical, Lime600, Lime200 ); } static void addRectangles10( QskLinearBox* parent ) @@ -263,14 +272,14 @@ static void addRectangles11( QskLinearBox* parent ) { auto box = new MyRectangle( parent ); - box->setBorder( Box::Flat, QskRgbPalette::Teal ); + box->setBorder( Box::Flat, QskRgb::Teal ); qreal bw[ 4 ] = { border, border, border, border }; if ( i != 0 ) bw[ i - 1 ] = 0; box->setBorderWidth( bw[ 0 ], bw[ 1 ], bw[ 2 ], bw[ 3 ] ); - box->setBackground( fillType[ i ], QskRgbPalette::Brown, i >= 3 ); + box->setBackground( fillType[ i ], QskRgb::Sienna, i >= 3 ); } } @@ -281,14 +290,14 @@ static void addRectangles12( QskLinearBox* parent ) { auto* box = new Box( parent ); box->setBorderWidth( 0 ); - box->setGradient( orientation, QskRgbPalette::Brown ); + box->setGradient( orientation, QskRgb::LightSlateGray ); } for ( auto orientation : { QskGradient::Vertical, QskGradient::Diagonal } ) { auto* box = new Box( parent ); - box->setBorder( Box::Flat, QskRgbPalette::DeepOrange ); - box->setGradient( orientation, QskRgbPalette::Blue ); + box->setBorder( Box::Flat, QskRgb::OrangeRed ); + box->setGradient( orientation, QskRgb::DodgerBlue ); } for ( auto orientation : { QskGradient::Vertical, @@ -297,15 +306,15 @@ static void addRectangles12( QskLinearBox* parent ) auto* box = new Box( parent ); box->setBorderWidth( 0 ); box->setShape( 30, 40, Qt::RelativeSize ); - box->setGradient( orientation, QskRgbPalette::Brown ); + box->setGradient( orientation, QskRgb::LightSlateGray ); } for ( auto orientation : { QskGradient::Vertical, QskGradient::Diagonal } ) { auto* box = new Box( parent ); - box->setBorder( Box::Flat, QskRgbPalette::DeepOrange ); + box->setBorder( Box::Flat, QskRgb::OrangeRed ); box->setShape( 30, 40, Qt::RelativeSize ); - box->setGradient( orientation, QskRgbPalette::Blue ); + box->setGradient( orientation, QskRgb::DodgerBlue ); } for ( auto orientation : { QskGradient::Vertical, @@ -314,15 +323,15 @@ static void addRectangles12( QskLinearBox* parent ) auto* box = new Box( parent ); box->setBorderWidth( 0 ); box->setShape( 100, 100, Qt::RelativeSize ); - box->setGradient( orientation, QskRgbPalette::Brown ); + box->setGradient( orientation, QskRgb::LightSlateGray ); } for ( auto orientation : { QskGradient::Vertical, QskGradient::Diagonal } ) { auto* box = new Box( parent ); - box->setBorder( Box::Flat, QskRgbPalette::DeepOrange ); + box->setBorder( Box::Flat, QskRgb::OrangeRed ); box->setShape( 100, 100, Qt::RelativeSize ); - box->setGradient( orientation, QskRgbPalette::Blue ); + box->setGradient( orientation, QskRgb::DodgerBlue ); } } @@ -374,7 +383,7 @@ static void addColoredBorderRectangles1( QskLinearBox* parent, bool rounded, Box box->setBorderGradients( gradient1, gradient2, gradient3, gradient4 ); if( fillType != Box::Unfilled ) - box->setBackground( fillType, QskRgbPalette::Indigo ); + box->setBackground( fillType, QskRgb::CornflowerBlue ); if( rounded ) box->setShape( 30, Qt::AbsoluteSize ); @@ -387,7 +396,7 @@ static void addColoredBorderRectangles2( QskLinearBox* parent, bool rounded, Box box->setBorderGradients( Qt::red, Qt::green, Qt::blue, Qt::yellow ); if( fillType != Box::Unfilled ) - box->setBackground( fillType, QskRgbPalette::Indigo ); + box->setBackground( fillType, QskRgb::CornflowerBlue ); if( rounded ) box->setShape( 30, Qt::AbsoluteSize ); @@ -416,7 +425,7 @@ static void addColoredBorderRectangles3( QskLinearBox* parent, bool rounded, Box box->setBorderGradients( gradient3, gradient3, gradient3, gradient3 ); if( fillType != Box::Unfilled ) - box->setBackground( fillType, QskRgbPalette::Indigo ); + box->setBackground( fillType, QskRgb::CornflowerBlue ); if( rounded ) box->setShape( 30, Qt::AbsoluteSize ); @@ -430,7 +439,7 @@ static void addColoredBorderRectangles4( QskLinearBox* parent, bool rounded, Box box->setBorderGradients( gradient, gradient, gradient, gradient ); if( fillType != Box::Unfilled ) - box->setBackground( fillType, QskRgbPalette::Indigo ); + box->setBackground( fillType, QskRgb::CornflowerBlue ); if( rounded ) box->setShape( 30, Qt::AbsoluteSize ); @@ -447,7 +456,7 @@ static void addColoredBorderRectangles5( QskLinearBox* parent, bool rounded, Box box->setBorderGradients( gradient, gradient, gradient, gradient ); if( fillType != Box::Unfilled ) - box->setBackground( fillType, QskRgbPalette::Indigo ); + box->setBackground( fillType, QskRgb::CornflowerBlue ); if( rounded ) box->setShape( { 10, 20, 20, 40 } ); diff --git a/examples/gallery/progressbar/ProgressBarPage.cpp b/examples/gallery/progressbar/ProgressBarPage.cpp index 18985ecf..5bd7a1d7 100644 --- a/examples/gallery/progressbar/ProgressBarPage.cpp +++ b/examples/gallery/progressbar/ProgressBarPage.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include namespace @@ -25,17 +25,18 @@ namespace setBoundaries( 0, 100 ); } - void setTheme( QskRgbPalette::Theme theme ) + void setTheme( const QRgb base ) { - const auto pal = QskRgbPalette::palette( theme ); + double hue, chroma; + QskHctColor::getHueAndChroma( base, hue, chroma ); QVector< QRgb > rgb; - rgb += pal.rgb( QskRgbPalette::W200 ); - rgb += pal.rgb( QskRgbPalette::W400 ); - rgb += pal.rgb( QskRgbPalette::W600 ); - rgb += pal.rgb( QskRgbPalette::W900 ); + rgb += QskHctColor::rgb( hue, chroma, 75 ); + rgb += QskHctColor::rgb( hue, chroma, 60 ); + rgb += QskHctColor::rgb( hue, chroma, 45 ); + rgb += QskHctColor::rgb( hue, chroma, 30 ); - const auto stops = QskRgbPalette::colorStops( rgb, true ); + const auto stops = QskGradient::colorStops( rgb, true ); setBarGradient( QskGradient( orientation(), stops ) ); } @@ -62,19 +63,19 @@ void ProgressBarPage::populate() { auto bar = new ProgressBar( hBox ); - bar->setTheme( QskRgbPalette::BlueGrey ); + bar->setTheme( QskRgb::LightSteelBlue ); bar->setValue( 100 ); } { auto bar = new ProgressBar( hBox ); - bar->setTheme( QskRgbPalette::Blue ); + bar->setTheme( QskRgb::DodgerBlue ); bar->setValue( 75 ); } { auto bar = new ProgressBar( hBox ); - bar->setTheme( QskRgbPalette::Blue ); + bar->setTheme( QskRgb::DodgerBlue ); bar->setOrigin( 60 ); bar->setValue( 25 ); } @@ -90,20 +91,20 @@ void ProgressBarPage::populate() { auto bar = new ProgressBar( vBox ); - bar->setTheme( QskRgbPalette::DeepOrange ); + bar->setTheme( QskRgb::OrangeRed ); bar->setValue( 100 ); } { auto bar = new ProgressBar( vBox ); - bar->setTheme( QskRgbPalette::Pink ); + bar->setTheme( QskRgb::DeepPink ); bar->setMaximum( 40 ); bar->setValue( 25 ); } { auto bar = new ProgressBar( vBox ); - bar->setTheme( QskRgbPalette::Pink ); + bar->setTheme( QskRgb::DeepPink ); bar->setOrigin( 40 ); bar->setValue( 10 ); } diff --git a/examples/tabview/CustomSlider.cpp b/examples/tabview/CustomSlider.cpp index e8da8471..c7b52ec9 100644 --- a/examples/tabview/CustomSlider.cpp +++ b/examples/tabview/CustomSlider.cpp @@ -26,17 +26,17 @@ CustomSlider::CustomSlider( QQuickItem* parentItem ) QskSkinHintTableEditor ed( &hintTable() ); ed.setBoxShape( Fill, 0 ); - ed.setGradient( Fill, Grey700 ); + ed.setGradient( Fill, QskRgb::DimGray ); ed.setColor( Scale, qRgb( 178, 178, 178 ) ); // for the ticks ed.setStrutSize( Handle, 80, 80 ); - ed.setColor( Handle, Grey800 ); + ed.setColor( Handle, QskRgb::DimGray ); - ed.setColor( Handle | Pressed, Orange600 ); + ed.setColor( Handle | Pressed, QskRgb::Orange ); const auto combinationMask = Focused | Hovered; - ed.setColor( Handle, Orange600, combinationMask ); + ed.setColor( Handle, QskRgb::Orange, combinationMask ); ed.setAnimation( Handle | QskAspect::Color, 300, combinationMask ); ed.setAnimation( Handle | QskAspect::Color, 1000 ); diff --git a/examples/tabview/CustomSliderSkinlet.cpp b/examples/tabview/CustomSliderSkinlet.cpp index 0766957d..cc5eb869 100644 --- a/examples/tabview/CustomSliderSkinlet.cpp +++ b/examples/tabview/CustomSliderSkinlet.cpp @@ -307,7 +307,7 @@ QSGNode* CustomSliderSkinlet::updateDecorationNode( labelNode = QskSkinlet::updateTextNode( slider, labelNode, QRectF( x - 0.5 * w, y, w, h ), Qt::AlignHCenter, text, qskLabelFont, - QskTextOptions(), QskTextColors( QskRgb::Grey700 ), Qsk::Normal ); + QskTextOptions(), QskTextColors( QskRgb::DimGray ), Qsk::Normal ); if ( labelNode ) { diff --git a/examples/tabview/OtherSlider.cpp b/examples/tabview/OtherSlider.cpp index bba59381..b3d15fae 100644 --- a/examples/tabview/OtherSlider.cpp +++ b/examples/tabview/OtherSlider.cpp @@ -37,8 +37,8 @@ OtherSlider::OtherSlider( QQuickItem* parentItem ) ed.setMetric( aspect | A::Size, h ); ed.setBoxShape( aspect, 4 ); ed.setBoxBorderMetrics( aspect, 1 ); - ed.setBoxBorderColors( aspect, Grey900 ); - ed.setGradient( aspect, Grey400 ); + ed.setBoxBorderColors( aspect, DimGray ); + ed.setGradient( aspect, Silver ); if ( placement == A::Horizontal ) ed.setPadding( aspect, QskMargins( paddingW, 0 ) ); @@ -84,8 +84,8 @@ OtherSlider::OtherSlider( QQuickItem* parentItem ) for ( auto state : { A::NoState, Pressed } ) { - ed.setBoxBorderColors( aspect | state, Grey600 ); - ed.setGradient( aspect | state, Blue400 ); + ed.setBoxBorderColors( aspect | state, SlateGrey ); + ed.setGradient( aspect | state, DodgerBlue ); } } } diff --git a/skins/material/QskMaterialSkin.cpp b/skins/material/QskMaterialSkin.cpp index ac13de2c..d7ae073c 100644 --- a/skins/material/QskMaterialSkin.cpp +++ b/skins/material/QskMaterialSkin.cpp @@ -61,11 +61,21 @@ static inline QColor qskShadedColor( const QColor color, qreal opacity ) namespace { +#if 1 + // temporary definitions, will be removed when moving to M(aterial)3 + constexpr const QRgb Grey100 = 0xfff5f5f5; + constexpr const QRgb Grey300 = 0xffe0e0e0; + constexpr const QRgb Grey400 = 0xffbdbdbd; + constexpr const QRgb Grey500 = 0xff9e9e9e; + constexpr const QRgb Grey600 = 0xff757575; + constexpr const QRgb Blue500 = 0xff2196f3; +#endif + class ColorPalette { public: - ColorPalette( const QColor base = QColor::fromRgba( QskRgb::Grey100 ), - const QColor& accent = QColor::fromRgba( QskRgb::Blue500 ), + ColorPalette( const QColor base = QColor::fromRgba( Grey100 ), + const QColor& accent = QColor::fromRgba( Blue500 ), const QColor& contrast = QColor::fromRgba( QskRgb::White ) ) { baseColor = base; @@ -910,8 +920,7 @@ QskMaterialSkin::QskMaterialSkin( QObject* parent ) : Inherited( parent ) , m_data( new PrivateData() ) { - m_data->palette = ColorPalette( QskRgb::Grey100, - QskRgb::Blue500, QskRgb::White ); + m_data->palette = ColorPalette( Grey100, Blue500, QskRgb::White ); // Default theme colors setupFonts( QStringLiteral( "Roboto" ) ); diff --git a/skins/squiek/QskSquiekSkin.cpp b/skins/squiek/QskSquiekSkin.cpp index 8d9a6173..b13f7e15 100644 --- a/skins/squiek/QskSquiekSkin.cpp +++ b/skins/squiek/QskSquiekSkin.cpp @@ -89,7 +89,7 @@ namespace contrasted = DarkGrey; contrastedText = White; - highlighted = BlueGrey500; + highlighted = SlateGrey; highlightedText = White; base = Black; diff --git a/src/common/QskGradient.cpp b/src/common/QskGradient.cpp index 82661437..b4294a39 100644 --- a/src/common/QskGradient.cpp +++ b/src/common/QskGradient.cpp @@ -194,6 +194,42 @@ static inline QskGradientStops qskGradientStops( const QGradientStops& qtStops ) return stops; } +static inline QskGradientStops qskColorStops( + const QRgb* rgb, int count, bool discrete ) +{ + QskGradientStops stops; + + if ( discrete ) + stops.reserve( 2 * count - 2 ); + else + stops.reserve( count ); + + stops += QskGradientStop( 0.0, rgb[0] ); + + if ( discrete ) + { + const auto step = 1.0 / count; + + for ( int i = 1; i < count; i++ ) + { + const qreal pos = i * step; + stops += QskGradientStop( pos, rgb[i - 1] ); + stops += QskGradientStop( pos, rgb[i] ); + } + } + else + { + const auto step = 1.0 / ( count - 1 ); + + for ( int i = 1; i < count - 1; i++ ) + stops += QskGradientStop( i * step, rgb[i] ); + } + + stops += QskGradientStop( 1.0, rgb[count - 1] ); + + return stops; +} + QskGradient::QskGradient( Orientation orientation ) : m_orientation( orientation ) , m_isDirty( false ) @@ -635,6 +671,28 @@ void QskGradient::updateStatusBits() const m_isDirty = false; } +QskGradientStops QskGradient::colorStops( + const QVector< QRgb >& rgb, bool discrete ) +{ + const int count = rgb.count(); + + if ( count == 0 ) + return QskGradientStops(); + + if ( count == 0 ) + { + QskGradientStops stops; + stops.reserve( 2 ); + + stops += QskGradientStop( 0.0, rgb[0] ); + stops += QskGradientStop( 1.0, rgb[0] ); + + return stops; + } + + return qskColorStops( rgb.constData(), count, discrete ); +} + #ifndef QT_NO_DEBUG_STREAM #include diff --git a/src/common/QskGradient.h b/src/common/QskGradient.h index be90ad5a..2a29926b 100644 --- a/src/common/QskGradient.h +++ b/src/common/QskGradient.h @@ -103,6 +103,9 @@ class QSK_EXPORT QskGradient Q_INVOKABLE QColor colorAt( int index ) const; Q_INVOKABLE int stopCount() const; + static QskGradientStops colorStops( + const QVector< QRgb >&, bool discrete = false ); + private: void setStopAt( int index, qreal stop ); void setColorAt( int index, const QColor& color ); diff --git a/src/common/QskRgbPalette.cpp b/src/common/QskRgbPalette.cpp deleted file mode 100644 index 79d715b6..00000000 --- a/src/common/QskRgbPalette.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/****************************************************************************** - * QSkinny - Copyright (C) 2016 Uwe Rathmann - * This file may be used under the terms of the QSkinny License, Version 1.0 - *****************************************************************************/ - -#include "QskRgbPalette.h" -#include "QskRgbValue.h" -#include "QskGradient.h" - -#define RGB( color, weight ) color ## weight - -#define RGBTABLE( c ) \ - { \ - RGB( c, 50 ), RGB( c, 100 ), RGB( c, 200 ), RGB( c, 300 ), RGB( c, 400 ), \ - RGB( c, 500 ), RGB( c, 600 ), RGB( c, 700 ), RGB( c, 800 ), RGB( c, 900 ) \ - } - -namespace -{ - class Palette : public QskRgbPalette - { - public: - Palette( int index ) - { - using namespace QskRgb; - - static constexpr QRgb table[][ Palette::NumWeights ] = - { - RGBTABLE( Red ), - RGBTABLE( Pink ), - RGBTABLE( Purple ), - RGBTABLE( DeepPurple ), - RGBTABLE( Indigo ), - RGBTABLE( Blue ), - RGBTABLE( LightBlue ), - RGBTABLE( Cyan ), - RGBTABLE( Teal ), - RGBTABLE( Green ), - RGBTABLE( LightGreen ), - RGBTABLE( Lime ), - RGBTABLE( Yellow ), - RGBTABLE( Amber ), - RGBTABLE( Orange ), - RGBTABLE( DeepOrange ), - RGBTABLE( Brown ), - RGBTABLE( Grey ), - RGBTABLE( BlueGrey ), - }; - - const int count = sizeof( table ) / sizeof( table[ 0 ] ); - m_rgb = table[ qBound( 0, index, count ) ]; - } - }; -} - -QskRgbPalette QskRgbPalette::palette( Theme theme ) -{ - return Palette( static_cast< int >( theme ) ); -} - -static QskGradientStops qskColorStops( - const QRgb* rgb, int count, bool discrete ) -{ - QskGradientStops stops; - - if ( discrete ) - stops.reserve( 2 * count - 2 ); - else - stops.reserve( count ); - - stops += QskGradientStop( 0.0, rgb[0] ); - - if ( discrete ) - { - const auto step = 1.0 / count; - - for ( int i = 1; i < count; i++ ) - { - const qreal pos = i * step; - stops += QskGradientStop( pos, rgb[i - 1] ); - stops += QskGradientStop( pos, rgb[i] ); - } - } - else - { - const auto step = 1.0 / ( count - 1 ); - - for ( int i = 1; i < count - 1; i++ ) - stops += QskGradientStop( i * step, rgb[i] ); - } - - stops += QskGradientStop( 1.0, rgb[count - 1] ); - - return stops; -} - -QskGradientStops QskRgbPalette::colorStops( bool discrete ) const -{ - return qskColorStops( m_rgb, NumWeights, discrete ); -} - -QskGradientStops QskRgbPalette::colorStops( Theme theme, bool discrete ) -{ - const auto pal = QskRgbPalette::palette( theme ); - return pal.colorStops( discrete ); -} - -QskGradientStops QskRgbPalette::colorStops( - const QVector< QRgb >& rgb, bool discrete ) -{ - const int count = rgb.count(); - - if ( count == 0 ) - return QskGradientStops(); - - if ( count == 0 ) - { - QskGradientStops stops; - stops.reserve( 2 ); - - stops += QskGradientStop( 0.0, rgb[0] ); - stops += QskGradientStop( 1.0, rgb[0] ); - - return stops; - } - - return qskColorStops( rgb.constData(), count, discrete ); -} - -#include "moc_QskRgbPalette.cpp" diff --git a/src/common/QskRgbPalette.h b/src/common/QskRgbPalette.h deleted file mode 100644 index 050dbe2b..00000000 --- a/src/common/QskRgbPalette.h +++ /dev/null @@ -1,89 +0,0 @@ -/****************************************************************************** - * QSkinny - Copyright (C) 2016 Uwe Rathmann - * This file may be used under the terms of the QSkinny License, Version 1.0 - *****************************************************************************/ - -#ifndef QSK_RGB_PALETTE_H -#define QSK_RGB_PALETTE_H - -#include "QskGlobal.h" -#include "QskGradient.h" - -#include -#include - -class QSK_EXPORT QskRgbPalette -{ - Q_GADGET - - public: - enum Weight - { - W50, - W100, - W200, - W300, - W400, - W500, - W600, - W700, - W800, - W900, - - NumWeights - }; - Q_ENUM( Weight ) - - enum Theme - { - Red, - Pink, - Purple, - DeepPurple, - Indigo, - Blue, - LightBlue, - Cyan, - Teal, - Green, - LightGreen, - Lime, - Yellow, - Amber, - Orange, - DeepOrange, - Brown, - Grey, - BlueGrey, - - NumThemes - }; - Q_ENUM( Theme ) - - static QskRgbPalette palette( Theme ); - - inline QRgb rgb( Weight weight ) const - { - if ( weight < 0 || weight >= NumWeights ) - return 0; - - return m_rgb[ weight ]; - } - - inline QColor color( Weight weight ) const - { - return QColor::fromRgba( rgb( weight ) ); - } - - QskGradientStops colorStops( bool discrete = false ) const; - - static QskGradientStops colorStops( Theme, bool discrete = false ); - - static QskGradientStops colorStops( - const QVector< QRgb >&, bool discrete = false ); - - protected: - const QRgb* m_rgb; -}; - -#endif diff --git a/src/common/QskRgbValue.h b/src/common/QskRgbValue.h index b963c115..2eb38097 100644 --- a/src/common/QskRgbValue.h +++ b/src/common/QskRgbValue.h @@ -157,279 +157,6 @@ RGBVALUE( Yellow, 0xffffff00 ) \ RGBVALUE( YellowGreen, 0xff9acd32 ) \ RGBVALUE( White, 0xffffffff ) \ - /* Material colors from https://material.google.com/style/color.html */ \ - RGBVALUE( Red50, 0xffffebee ) \ - RGBVALUE( Red100, 0xffffcdd2 ) \ - RGBVALUE( Red200, 0xffef9a9a ) \ - RGBVALUE( Red300, 0xffe57373 ) \ - RGBVALUE( Red400, 0xffef5350 ) \ - RGBVALUE( Red500, 0xfff44336 ) \ - RGBVALUE( Red600, 0xffe53935 ) \ - RGBVALUE( Red700, 0xffd32f2f ) \ - RGBVALUE( Red800, 0xffc62828 ) \ - RGBVALUE( Red900, 0xffb71c1c ) \ - RGBVALUE( RedA100, 0xffff8a80 ) \ - RGBVALUE( RedA200, 0xffff5252 ) \ - RGBVALUE( RedA400, 0xffff1744 ) \ - RGBVALUE( RedA700, 0xffd50000 ) \ - \ - RGBVALUE( Pink50, 0xfffce4ec ) \ - RGBVALUE( Pink100, 0xfff8bbd0 ) \ - RGBVALUE( Pink200, 0xfff48fb1 ) \ - RGBVALUE( Pink300, 0xfff06292 ) \ - RGBVALUE( Pink400, 0xffec407a ) \ - RGBVALUE( Pink500, 0xffe91e63 ) \ - RGBVALUE( Pink600, 0xffd81b60 ) \ - RGBVALUE( Pink700, 0xffc2185b ) \ - RGBVALUE( Pink800, 0xffad1457 ) \ - RGBVALUE( Pink900, 0xff880e4f ) \ - RGBVALUE( PinkA100, 0xffff80ab ) \ - RGBVALUE( PinkA200, 0xffff4081 ) \ - RGBVALUE( PinkA400, 0xfff50057 ) \ - RGBVALUE( PinkA700, 0xffc51162 ) \ - \ - RGBVALUE( Purple50, 0xfff3e5f5 ) \ - RGBVALUE( Purple100, 0xffe1bee7 ) \ - RGBVALUE( Purple200, 0xffce93d8 ) \ - RGBVALUE( Purple300, 0xffba68c8 ) \ - RGBVALUE( Purple400, 0xffab47bc ) \ - RGBVALUE( Purple500, 0xff9c27b0 ) \ - RGBVALUE( Purple600, 0xff8e24aa ) \ - RGBVALUE( Purple700, 0xff7b1fa2 ) \ - RGBVALUE( Purple800, 0xff6a1b9a ) \ - RGBVALUE( Purple900, 0xff4a148c ) \ - RGBVALUE( PurpleA100, 0xffea80fc ) \ - RGBVALUE( PurpleA200, 0xffe040fb ) \ - RGBVALUE( PurpleA400, 0xffd500f9 ) \ - RGBVALUE( PurpleA700, 0xffaa00ff ) \ - \ - RGBVALUE( DeepPurple50, 0xffede7f6 ) \ - RGBVALUE( DeepPurple100, 0xffd1c4e9 ) \ - RGBVALUE( DeepPurple200, 0xffb39ddb ) \ - RGBVALUE( DeepPurple300, 0xff9575cd ) \ - RGBVALUE( DeepPurple400, 0xff7e57c2 ) \ - RGBVALUE( DeepPurple500, 0xff673ab7 ) \ - RGBVALUE( DeepPurple600, 0xff5e35b1 ) \ - RGBVALUE( DeepPurple700, 0xff512da8 ) \ - RGBVALUE( DeepPurple800, 0xff4527a0 ) \ - RGBVALUE( DeepPurple900, 0xff311b92 ) \ - RGBVALUE( DeepPurpleA100, 0xffb388ff ) \ - RGBVALUE( DeepPurpleA200, 0xff7c4dff ) \ - RGBVALUE( DeepPurpleA400, 0xff651fff ) \ - RGBVALUE( DeepPurpleA700, 0xff6200ea ) \ - \ - RGBVALUE( Indigo50, 0xffe8eaf6 ) \ - RGBVALUE( Indigo100, 0xffc5cae9 ) \ - RGBVALUE( Indigo200, 0xff9fa8da ) \ - RGBVALUE( Indigo300, 0xff7986cb ) \ - RGBVALUE( Indigo400, 0xff5c6bc0 ) \ - RGBVALUE( Indigo500, 0xff3f51b5 ) \ - RGBVALUE( Indigo600, 0xff3949ab ) \ - RGBVALUE( Indigo700, 0xff303f9f ) \ - RGBVALUE( Indigo800, 0xff283593 ) \ - RGBVALUE( Indigo900, 0xff1a237e ) \ - RGBVALUE( IndigoA100, 0xff8c9eff ) \ - RGBVALUE( IndigoA200, 0xff536dfe ) \ - RGBVALUE( IndigoA400, 0xff3d5afe ) \ - RGBVALUE( IndigoA700, 0xff304ffe ) \ - \ - RGBVALUE( Blue50, 0xffe3f2fd ) \ - RGBVALUE( Blue100, 0xffbbdefb ) \ - RGBVALUE( Blue200, 0xff90caf9 ) \ - RGBVALUE( Blue300, 0xff64b5f6 ) \ - RGBVALUE( Blue400, 0xff42a5f5 ) \ - RGBVALUE( Blue500, 0xff2196f3 ) \ - RGBVALUE( Blue600, 0xff1e88e5 ) \ - RGBVALUE( Blue700, 0xff1976d2 ) \ - RGBVALUE( Blue800, 0xff1565c0 ) \ - RGBVALUE( Blue900, 0xff0d47a1 ) \ - RGBVALUE( BlueA100, 0xff82b1ff ) \ - RGBVALUE( BlueA200, 0xff448aff ) \ - RGBVALUE( BlueA400, 0xff2979ff ) \ - RGBVALUE( BlueA700, 0xff2962ff ) \ - \ - RGBVALUE( LightBlue50, 0xffe1f5fe ) \ - RGBVALUE( LightBlue100, 0xffb3e5fc ) \ - RGBVALUE( LightBlue200, 0xff81d4fa ) \ - RGBVALUE( LightBlue300, 0xff4fc3f7 ) \ - RGBVALUE( LightBlue400, 0xff29b6f6 ) \ - RGBVALUE( LightBlue500, 0xff03a9f4 ) \ - RGBVALUE( LightBlue600, 0xff039be5 ) \ - RGBVALUE( LightBlue700, 0xff0288d1 ) \ - RGBVALUE( LightBlue800, 0xff0277bd ) \ - RGBVALUE( LightBlue900, 0xff01579b ) \ - RGBVALUE( LightBlueA100, 0xff80d8ff ) \ - RGBVALUE( LightBlueA200, 0xff40c4ff ) \ - RGBVALUE( LightBlueA400, 0xff00b0ff ) \ - RGBVALUE( LightBlueA700, 0xff0091ea ) \ - \ - RGBVALUE( Cyan50, 0xffe0f7fa ) \ - RGBVALUE( Cyan100, 0xffb2ebf2 ) \ - RGBVALUE( Cyan200, 0xff80deea ) \ - RGBVALUE( Cyan300, 0xff4dd0e1 ) \ - RGBVALUE( Cyan400, 0xff26c6da ) \ - RGBVALUE( Cyan500, 0xff00bcd4 ) \ - RGBVALUE( Cyan600, 0xff00acc1 ) \ - RGBVALUE( Cyan700, 0xff0097a7 ) \ - RGBVALUE( Cyan800, 0xff00838f ) \ - RGBVALUE( Cyan900, 0xff006064 ) \ - RGBVALUE( CyanA100, 0xff84ffff ) \ - RGBVALUE( CyanA200, 0xff18ffff ) \ - RGBVALUE( CyanA400, 0xff00e5ff ) \ - RGBVALUE( CyanA700, 0xff00b8d4 ) \ - \ - RGBVALUE( Teal50, 0xffe0f2f1 ) \ - RGBVALUE( Teal100, 0xffb2dfdb ) \ - RGBVALUE( Teal200, 0xff80cbc4 ) \ - RGBVALUE( Teal300, 0xff4db6ac ) \ - RGBVALUE( Teal400, 0xff26a69a ) \ - RGBVALUE( Teal500, 0xff009688 ) \ - RGBVALUE( Teal600, 0xff00897b ) \ - RGBVALUE( Teal700, 0xff00796b ) \ - RGBVALUE( Teal800, 0xff00695c ) \ - RGBVALUE( Teal900, 0xff004d40 ) \ - RGBVALUE( TealA100, 0xffa7ffeb ) \ - RGBVALUE( TealA200, 0xff64ffda ) \ - RGBVALUE( TealA400, 0xff1de9b6 ) \ - RGBVALUE( TealA700, 0xff00bfa5 ) \ - \ - RGBVALUE( Green50, 0xffe8f5e9 ) \ - RGBVALUE( Green100, 0xffc8e6c9 ) \ - RGBVALUE( Green200, 0xffa5d6a7 ) \ - RGBVALUE( Green300, 0xff81c784 ) \ - RGBVALUE( Green400, 0xff66bb6a ) \ - RGBVALUE( Green500, 0xff4caf50 ) \ - RGBVALUE( Green600, 0xff43a047 ) \ - RGBVALUE( Green700, 0xff388e3c ) \ - RGBVALUE( Green800, 0xff2e7d32 ) \ - RGBVALUE( Green900, 0xff1b5e20 ) \ - RGBVALUE( GreenA100, 0xffb9f6ca ) \ - RGBVALUE( GreenA200, 0xff69f0ae ) \ - RGBVALUE( GreenA400, 0xff00e676 ) \ - RGBVALUE( GreenA700, 0xff00c853 ) \ - \ - RGBVALUE( LightGreen50, 0xfff1f8e9 ) \ - RGBVALUE( LightGreen100, 0xffdcedc8 ) \ - RGBVALUE( LightGreen200, 0xffc5e1a5 ) \ - RGBVALUE( LightGreen300, 0xffaed581 ) \ - RGBVALUE( LightGreen400, 0xff9ccc65 ) \ - RGBVALUE( LightGreen500, 0xff8bc34a ) \ - RGBVALUE( LightGreen600, 0xff7cb342 ) \ - RGBVALUE( LightGreen700, 0xff689f38 ) \ - RGBVALUE( LightGreen800, 0xff558b2f ) \ - RGBVALUE( LightGreen900, 0xff33691e ) \ - RGBVALUE( LightGreenA100, 0xffccff90 ) \ - RGBVALUE( LightGreenA200, 0xffb2ff59 ) \ - RGBVALUE( LightGreenA400, 0xff76ff03 ) \ - RGBVALUE( LightGreenA700, 0xff64dd17 ) \ - \ - RGBVALUE( Lime50, 0xfff9fbe7 ) \ - RGBVALUE( Lime100, 0xfff0f4c3 ) \ - RGBVALUE( Lime200, 0xffe6ee9c ) \ - RGBVALUE( Lime300, 0xffdce775 ) \ - RGBVALUE( Lime400, 0xffd4e157 ) \ - RGBVALUE( Lime500, 0xffcddc39 ) \ - RGBVALUE( Lime600, 0xffc0ca33 ) \ - RGBVALUE( Lime700, 0xffafb42b ) \ - RGBVALUE( Lime800, 0xff9e9d24 ) \ - RGBVALUE( Lime900, 0xff827717 ) \ - RGBVALUE( LimeA100, 0xfff4ff81 ) \ - RGBVALUE( LimeA200, 0xffeeff41 ) \ - RGBVALUE( LimeA400, 0xffc6ff00 ) \ - RGBVALUE( LimeA700, 0xffaeea00 ) \ - \ - RGBVALUE( Yellow50, 0xfffffde7 ) \ - RGBVALUE( Yellow100, 0xfffff9c4 ) \ - RGBVALUE( Yellow200, 0xfffff59d ) \ - RGBVALUE( Yellow300, 0xfffff176 ) \ - RGBVALUE( Yellow400, 0xffffee58 ) \ - RGBVALUE( Yellow500, 0xffffeb3b ) \ - RGBVALUE( Yellow600, 0xfffdd835 ) \ - RGBVALUE( Yellow700, 0xfffbc02d ) \ - RGBVALUE( Yellow800, 0xfff9a825 ) \ - RGBVALUE( Yellow900, 0xfff57f17 ) \ - RGBVALUE( YellowA100, 0xffffff8d ) \ - RGBVALUE( YellowA200, 0xffffff00 ) \ - RGBVALUE( YellowA400, 0xffffea00 ) \ - RGBVALUE( YellowA700, 0xffffd600 ) \ - \ - RGBVALUE( Amber50, 0xfffff8e1 ) \ - RGBVALUE( Amber100, 0xffffecb3 ) \ - RGBVALUE( Amber200, 0xffffe082 ) \ - RGBVALUE( Amber300, 0xffffd54f ) \ - RGBVALUE( Amber400, 0xffffca28 ) \ - RGBVALUE( Amber500, 0xffffc107 ) \ - RGBVALUE( Amber600, 0xffffb300 ) \ - RGBVALUE( Amber700, 0xffffa000 ) \ - RGBVALUE( Amber800, 0xffff8f00 ) \ - RGBVALUE( Amber900, 0xffff6f00 ) \ - RGBVALUE( AmberA100, 0xffffe57f ) \ - RGBVALUE( AmberA200, 0xffffd740 ) \ - RGBVALUE( AmberA400, 0xffffc400 ) \ - RGBVALUE( AmberA700, 0xffffab00 ) \ - \ - RGBVALUE( Orange50, 0xfffff3e0 ) \ - RGBVALUE( Orange100, 0xffffe0b2 ) \ - RGBVALUE( Orange200, 0xffffcc80 ) \ - RGBVALUE( Orange300, 0xffffb74d ) \ - RGBVALUE( Orange400, 0xffffa726 ) \ - RGBVALUE( Orange500, 0xffff9800 ) \ - RGBVALUE( Orange600, 0xfffb8c00 ) \ - RGBVALUE( Orange700, 0xfff57c00 ) \ - RGBVALUE( Orange800, 0xffef6c00 ) \ - RGBVALUE( Orange900, 0xffe65100 ) \ - RGBVALUE( OrangeA100, 0xffffd180 ) \ - RGBVALUE( OrangeA200, 0xffffab40 ) \ - RGBVALUE( OrangeA400, 0xffff9100 ) \ - RGBVALUE( OrangeA700, 0xffff6d00 ) \ - \ - RGBVALUE( DeepOrange50, 0xfffbe9e7 ) \ - RGBVALUE( DeepOrange100, 0xffffccbc ) \ - RGBVALUE( DeepOrange200, 0xffffab91 ) \ - RGBVALUE( DeepOrange300, 0xffff8a65 ) \ - RGBVALUE( DeepOrange400, 0xffff7043 ) \ - RGBVALUE( DeepOrange500, 0xffff5722 ) \ - RGBVALUE( DeepOrange600, 0xfff4511e ) \ - RGBVALUE( DeepOrange700, 0xffe64a19 ) \ - RGBVALUE( DeepOrange800, 0xffd84315 ) \ - RGBVALUE( DeepOrange900, 0xffbf360c ) \ - RGBVALUE( DeepOrangeA100, 0xffff9e80 ) \ - RGBVALUE( DeepOrangeA200, 0xffff6e40 ) \ - RGBVALUE( DeepOrangeA400, 0xffff3d00 ) \ - RGBVALUE( DeepOrangeA700, 0xffdd2c00 ) \ - \ - RGBVALUE( Brown50, 0xffefebe9 ) \ - RGBVALUE( Brown100, 0xffd7ccc8 ) \ - RGBVALUE( Brown200, 0xffbcaaa4 ) \ - RGBVALUE( Brown300, 0xffa1887f ) \ - RGBVALUE( Brown400, 0xff8d6e63 ) \ - RGBVALUE( Brown500, 0xff795548 ) \ - RGBVALUE( Brown600, 0xff6d4c41 ) \ - RGBVALUE( Brown700, 0xff5d4037 ) \ - RGBVALUE( Brown800, 0xff4e342e ) \ - RGBVALUE( Brown900, 0xff3e2723 ) \ - \ - RGBVALUE( Grey50, 0xfffafafa ) \ - RGBVALUE( Grey100, 0xfff5f5f5 ) \ - RGBVALUE( Grey200, 0xffeeeeee ) \ - RGBVALUE( Grey300, 0xffe0e0e0 ) \ - RGBVALUE( Grey400, 0xffbdbdbd ) \ - RGBVALUE( Grey500, 0xff9e9e9e ) \ - RGBVALUE( Grey600, 0xff757575 ) \ - RGBVALUE( Grey700, 0xff616161 ) \ - RGBVALUE( Grey800, 0xff424242 ) \ - RGBVALUE( Grey900, 0xff212121 ) \ - \ - RGBVALUE( BlueGrey50, 0xffeceff1 ) \ - RGBVALUE( BlueGrey100, 0xffcfd8dc ) \ - RGBVALUE( BlueGrey200, 0xffb0bec5 ) \ - RGBVALUE( BlueGrey300, 0xff90a4ae ) \ - RGBVALUE( BlueGrey400, 0xff78909c ) \ - RGBVALUE( BlueGrey500, 0xff607d8b ) \ - RGBVALUE( BlueGrey600, 0xff546e7a ) \ - RGBVALUE( BlueGrey700, 0xff455a64 ) \ - RGBVALUE( BlueGrey800, 0xff37474f ) \ - RGBVALUE( BlueGrey900, 0xff263238 ) \ \ RGBVALUE( Transparent, 0x00000000 ) \ RGBVALUE( AlphaMask, 0xff000000 ) \ diff --git a/src/src.pro b/src/src.pro index a82d305f..125283a3 100644 --- a/src/src.pro +++ b/src/src.pro @@ -38,7 +38,6 @@ HEADERS += \ common/QskPlacementPolicy.h \ common/QskPlatform.h \ common/QskRgbValue.h \ - common/QskRgbPalette.h \ common/QskScaleEngine.h \ common/QskScaleTickmarks.h \ common/QskShadowMetrics.h \ @@ -66,7 +65,6 @@ SOURCES += \ common/QskPlatform.cpp \ common/QskPlacementPolicy.cpp \ common/QskRgbValue.cpp \ - common/QskRgbPalette.cpp \ common/QskScaleEngine.cpp \ common/QskScaleTickmarks.cpp \ common/QskShadowMetrics.cpp \ From fbd3f791958e3b048d884627c7ca5f03dbc60d8f Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Sat, 25 Jun 2022 16:22:31 +0200 Subject: [PATCH 5/8] QskRgbValueQml removed. For QML we have the definitions in ColorConstants::Svg --- qmlexport/QskQml.cpp | 2 -- qmlexport/QskRgbValueQml.h | 28 ---------------------------- qmlexport/qmlexport.pro | 1 - 3 files changed, 31 deletions(-) delete mode 100644 qmlexport/QskRgbValueQml.h diff --git a/qmlexport/QskQml.cpp b/qmlexport/QskQml.cpp index d247ecf4..44af924a 100644 --- a/qmlexport/QskQml.cpp +++ b/qmlexport/QskQml.cpp @@ -7,7 +7,6 @@ #include "QskLayoutQml.h" #include "QskShortcutQml.h" #include "QskMainQml.h" -#include "QskRgbValueQml.h" #include #include @@ -192,7 +191,6 @@ void QskQml::registerTypes() WarningBlocker warningBlocker; #endif - QSK_REGISTER_GADGET( QskRgbValueQml, "RgbValue" ); QSK_REGISTER_GADGET( QskBoxBorderMetrics, "BorderMetrics" ); QSK_REGISTER_GADGET( QskBoxShapeMetrics, "Shape" ); QSK_REGISTER_GADGET( QskShadowMetrics, "ShadowMetrics" ); diff --git a/qmlexport/QskRgbValueQml.h b/qmlexport/QskRgbValueQml.h deleted file mode 100644 index d3570df0..00000000 --- a/qmlexport/QskRgbValueQml.h +++ /dev/null @@ -1,28 +0,0 @@ -/****************************************************************************** - * QSkinny - Copyright (C) 2016 Uwe Rathmann - * This file may be used under the terms of the QSkinny License, Version 1.0 - *****************************************************************************/ - -#ifndef QSK_RGBVALUE_QML_H -#define QSK_RGBVALUE_QML_H - -#include "QskQmlGlobal.h" -#include -#include - -class QskRgbValueQml -{ - Q_GADGET - - public: - enum Enum - { -#define RGBVALUE( name, value ) name = value, - QSK_RGB_VALUES -#undef RGBVALUE - }; - - Q_ENUM( Enum ) -}; - -#endif diff --git a/qmlexport/qmlexport.pro b/qmlexport/qmlexport.pro index b6ad885f..24857af7 100644 --- a/qmlexport/qmlexport.pro +++ b/qmlexport/qmlexport.pro @@ -10,7 +10,6 @@ HEADERS += \ QskQmlGlobal.h \ QskShortcutQml.h \ QskLayoutQml.h \ - QskRgbValueQml.h \ QskMainQml.h \ QskQml.h From e787b15d35cb09af47da13c8bd834b4d577f3979 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Sat, 25 Jun 2022 16:38:42 +0200 Subject: [PATCH 6/8] wip --- src/common/QskRgbValue.h | 312 +++++++++++++++++++-------------------- 1 file changed, 156 insertions(+), 156 deletions(-) diff --git a/src/common/QskRgbValue.h b/src/common/QskRgbValue.h index 2eb38097..45f0baf0 100644 --- a/src/common/QskRgbValue.h +++ b/src/common/QskRgbValue.h @@ -9,165 +9,165 @@ #include "QskGlobal.h" #include -#define QSK_RGB_VALUES \ - /* Web colors */ \ - RGBVALUE( AliceBlue, 0xfff0f8ff ) \ - RGBVALUE( AntiqueWhite, 0xfffaebd7 ) \ - RGBVALUE( Aqua, 0xff00ffff ) \ - RGBVALUE( Aquamarine, 0xff7fffd4 ) \ - RGBVALUE( Azure, 0xfff0ffff ) \ - RGBVALUE( Beige, 0xfff5f5dc ) \ - RGBVALUE( Bisque, 0xffffe4c4 ) \ - RGBVALUE( Black, 0xff000000 ) \ - RGBVALUE( BlanchedAlmond, 0xffffebcd ) \ - RGBVALUE( Blue, 0xff0000ff ) \ - RGBVALUE( BlueViolet, 0xff8a2be2 ) \ - RGBVALUE( Brown, 0xffa52a2a ) \ - RGBVALUE( Burlywood, 0xffdeb887 ) \ - RGBVALUE( CadetBlue, 0xff5f9ea0 ) \ - RGBVALUE( Chartreuse, 0xff7fff00 ) \ - RGBVALUE( Chocolate, 0xffd2691e ) \ - RGBVALUE( Coral, 0xffff7f50 ) \ - RGBVALUE( CornflowerBlue, 0xff6495ed ) \ - RGBVALUE( Cornsilk, 0xfffff8dc ) \ - RGBVALUE( Crimson, 0xffdc143c ) \ - RGBVALUE( Cyan, 0xff00ffff ) \ - RGBVALUE( DarkBlue, 0xff00008b ) \ - RGBVALUE( DarkCyan, 0xff008b8b ) \ - RGBVALUE( DarkGoldenrod, 0xffb8860b ) \ - RGBVALUE( DarkGray, 0xffa9a9a9 ) \ - RGBVALUE( DarkGreen, 0xff006400 ) \ - RGBVALUE( DarkGrey, 0xffa9a9a9 ) \ - RGBVALUE( DarkKhaki, 0xffbdb76b ) \ - RGBVALUE( DarkMagenta, 0xff8b008b ) \ - RGBVALUE( DarkOliveGreen, 0xff556b2f ) \ - RGBVALUE( DarkOrange, 0xffff8c00 ) \ - RGBVALUE( DarkOrchid, 0xff9932cc ) \ - RGBVALUE( DarkRed, 0xff8b0000 ) \ - RGBVALUE( DarkSalmon, 0xffe9967a ) \ - RGBVALUE( DarkSeaGreen, 0xff8fbc8f ) \ - RGBVALUE( DarkSlateBlue, 0xff483d8b ) \ - RGBVALUE( DarkSlateGray, 0xff2f4f4f ) \ - RGBVALUE( DarkSlateGrey, 0xff2f4f4f ) \ - RGBVALUE( DarkTurquoise, 0xff00ced1 ) \ - RGBVALUE( DarkViolet, 0xff9400d3 ) \ - RGBVALUE( DeepPink, 0xffff1493 ) \ - RGBVALUE( DeepSkyBlue, 0xff00bfff ) \ - RGBVALUE( DimGray, 0xff696969 ) \ - RGBVALUE( DimGrey, 0xff696969 ) \ - RGBVALUE( DodgerBlue, 0xff1e90ff ) \ - RGBVALUE( FireBrick, 0xffb22222 ) \ - RGBVALUE( FloralWhite, 0xfffffaf0 ) \ - RGBVALUE( ForestGreen, 0xff228b22 ) \ - RGBVALUE( Fuchsia, 0xffff00ff ) \ - RGBVALUE( Gainsboro, 0xffdcdcdc ) \ - RGBVALUE( GhostWhite, 0xfff8f8ff ) \ - RGBVALUE( Gold, 0xffffd700 ) \ - RGBVALUE( Goldenrod, 0xffdaa520 ) \ - RGBVALUE( Gray, 0xff808080 ) \ - RGBVALUE( Green, 0xff008000 ) \ - RGBVALUE( GreenYellow, 0xffadff2f ) \ - RGBVALUE( Grey, 0xff808080 ) \ - RGBVALUE( Honeydew, 0xfff0fff0 ) \ - RGBVALUE( HotPink, 0xffff69b4 ) \ - RGBVALUE( IndianRed, 0xffcd5c5c ) \ - RGBVALUE( Indigo, 0xff4b0082 ) \ - RGBVALUE( Ivory, 0xfffffff0 ) \ - RGBVALUE( Khaki, 0xfff0e68c ) \ - RGBVALUE( Lavender, 0xffe6e6fa ) \ - RGBVALUE( LavenderBlush, 0xfffff0f5 ) \ - RGBVALUE( LawnGreen, 0xff7cfc00 ) \ - RGBVALUE( LemonChiffon, 0xfffffacd ) \ - RGBVALUE( LightBlue, 0xffadd8e6 ) \ - RGBVALUE( LightCoral, 0xfff08080 ) \ - RGBVALUE( LightCyan, 0xffe0ffff ) \ - RGBVALUE( LightGoldenrodYellow, 0xfffafad2 ) \ - RGBVALUE( LightGray, 0xffd3d3d3 ) \ - RGBVALUE( LightGreen, 0xff90ee90 ) \ - RGBVALUE( LightGrey, 0xffd3d3d3 ) \ - RGBVALUE( LightPink, 0xffffb6c1 ) \ - RGBVALUE( LightSalmon, 0xffffa07a ) \ - RGBVALUE( LightSeaGreen, 0xff20b2aa ) \ - RGBVALUE( LightSkyBlue, 0xff87cefa ) \ - RGBVALUE( LightSlateGray, 0xff778899 ) \ - RGBVALUE( LightSlateGrey, 0xff778899 ) \ - RGBVALUE( LightSteelBlue, 0xffb0c4de ) \ - RGBVALUE( LightYellow, 0xffffffe0 ) \ - RGBVALUE( Lime, 0xff00ff00 ) \ - RGBVALUE( Limegreen, 0xff32cd32 ) \ - RGBVALUE( Linen, 0xfffaf0e6 ) \ - RGBVALUE( Magenta, 0xffff00ff ) \ - RGBVALUE( Maroon, 0xff800000 ) \ - RGBVALUE( MediumAquamarine, 0xff66cdaa ) \ - RGBVALUE( MediumBlue, 0xff0000cd ) \ - RGBVALUE( MediumOrchid, 0xffba55d3 ) \ - RGBVALUE( MediumPurple, 0xff9370db ) \ - RGBVALUE( MediumSeaGreen, 0xff3cb371 ) \ - RGBVALUE( MediumSlateBlue, 0xff7b68ee ) \ - RGBVALUE( MediumSpringGreen, 0xff00fa9a ) \ - RGBVALUE( MediumTurquoise, 0xff48d1cc ) \ - RGBVALUE( MediumVioletRed, 0xffc71585 ) \ - RGBVALUE( MidnightBlue, 0xff191970 ) \ - RGBVALUE( MintCream, 0xfff5fffa ) \ - RGBVALUE( MistyRose, 0xffffe4e1 ) \ - RGBVALUE( Moccasin, 0xffffe4b5 ) \ - RGBVALUE( NavajoWhite, 0xffffdead ) \ - RGBVALUE( Navy, 0xff000080 ) \ - RGBVALUE( OldLace, 0xfffdf5e6 ) \ - RGBVALUE( Olive, 0xff808000 ) \ - RGBVALUE( OliveDrab, 0xff6b8e23 ) \ - RGBVALUE( Orange, 0xffffa500 ) \ - RGBVALUE( OrangeRed, 0xffff4500 ) \ - RGBVALUE( Orchid, 0xffda70d6 ) \ - RGBVALUE( PaleGoldenrod, 0xffeee8aa ) \ - RGBVALUE( PaleGreen, 0xff98fb98 ) \ - RGBVALUE( PaleTurquoise, 0xffafeeee ) \ - RGBVALUE( PaleVioletRed, 0xffdb7093 ) \ - RGBVALUE( PapayaWhip, 0xffffefd5 ) \ - RGBVALUE( PeachPuff, 0xffffdab9 ) \ - RGBVALUE( Peru, 0xffcd853f ) \ - RGBVALUE( Pink, 0xffffc0cb ) \ - RGBVALUE( Plum, 0xffdda0dd ) \ - RGBVALUE( PowderBlue, 0xffb0e0e6 ) \ - RGBVALUE( Purple, 0xff800080 ) \ - RGBVALUE( Red, 0xffff0000 ) \ - RGBVALUE( RosyBrown, 0xffbc8f8f ) \ - RGBVALUE( RoyalBlue, 0xff4169e1 ) \ - RGBVALUE( SaddleBrown, 0xff8b4513 ) \ - RGBVALUE( Salmon, 0xfffa8072 ) \ - RGBVALUE( SandyBrown, 0xfff4a460 ) \ - RGBVALUE( SeaGreen, 0xff2e8b57 ) \ - RGBVALUE( Seashell, 0xfffff5ee ) \ - RGBVALUE( Sienna, 0xffa0522d ) \ - RGBVALUE( Silver, 0xffc0c0c0 ) \ - RGBVALUE( SkyBlue, 0xff87ceeb ) \ - RGBVALUE( SlateBlue, 0xff6a5acd ) \ - RGBVALUE( SlateGrey, 0xff708090 ) \ - RGBVALUE( Snow, 0xfffffafa ) \ - RGBVALUE( SpringGreen, 0xff00ff7f ) \ - RGBVALUE( SteelBlue, 0xff4682b4 ) \ - RGBVALUE( Tan, 0xffd2b48c ) \ - RGBVALUE( Teal, 0xff008080 ) \ - RGBVALUE( Thistle, 0xffd8bfd8 ) \ - RGBVALUE( Tomato, 0xffff6347 ) \ - RGBVALUE( Turquoise, 0xff40e0d0 ) \ - RGBVALUE( Violet, 0xffee82ee ) \ - RGBVALUE( Wheat, 0xfff5deb3 ) \ - RGBVALUE( WhiteSmoke, 0xfff5f5f5 ) \ - RGBVALUE( Yellow, 0xffffff00 ) \ - RGBVALUE( YellowGreen, 0xff9acd32 ) \ - RGBVALUE( White, 0xffffffff ) \ - \ - RGBVALUE( Transparent, 0x00000000 ) \ - RGBVALUE( AlphaMask, 0xff000000 ) \ - RGBVALUE( ColorMask, 0x00ffffff ) +namespace QskRgb +{ + /* Web colors */ + + constexpr Q_DECL_UNUSED const QRgb AliceBlue = 0xfff0f8ff; + constexpr Q_DECL_UNUSED const QRgb AntiqueWhite = 0xfffaebd7; + constexpr Q_DECL_UNUSED const QRgb Aqua = 0xff00ffff; + constexpr Q_DECL_UNUSED const QRgb Aquamarine = 0xff7fffd4; + constexpr Q_DECL_UNUSED const QRgb Azure = 0xfff0ffff; + constexpr Q_DECL_UNUSED const QRgb Beige = 0xfff5f5dc; + constexpr Q_DECL_UNUSED const QRgb Bisque = 0xffffe4c4; + constexpr Q_DECL_UNUSED const QRgb Black = 0xff000000; + constexpr Q_DECL_UNUSED const QRgb BlanchedAlmond = 0xffffebcd; + constexpr Q_DECL_UNUSED const QRgb Blue = 0xff0000ff; + constexpr Q_DECL_UNUSED const QRgb BlueViolet = 0xff8a2be2; + constexpr Q_DECL_UNUSED const QRgb Brown = 0xffa52a2a; + constexpr Q_DECL_UNUSED const QRgb Burlywood = 0xffdeb887; + constexpr Q_DECL_UNUSED const QRgb CadetBlue = 0xff5f9ea0; + constexpr Q_DECL_UNUSED const QRgb Chartreuse = 0xff7fff00; + constexpr Q_DECL_UNUSED const QRgb Chocolate = 0xffd2691e; + constexpr Q_DECL_UNUSED const QRgb Coral = 0xffff7f50; + constexpr Q_DECL_UNUSED const QRgb CornflowerBlue = 0xff6495ed; + constexpr Q_DECL_UNUSED const QRgb Cornsilk = 0xfffff8dc; + constexpr Q_DECL_UNUSED const QRgb Crimson = 0xffdc143c; + constexpr Q_DECL_UNUSED const QRgb Cyan = 0xff00ffff; + constexpr Q_DECL_UNUSED const QRgb DarkBlue = 0xff00008b; + constexpr Q_DECL_UNUSED const QRgb DarkCyan = 0xff008b8b; + constexpr Q_DECL_UNUSED const QRgb DarkGoldenrod = 0xffb8860b; + constexpr Q_DECL_UNUSED const QRgb DarkGray = 0xffa9a9a9; + constexpr Q_DECL_UNUSED const QRgb DarkGreen = 0xff006400; + constexpr Q_DECL_UNUSED const QRgb DarkGrey = 0xffa9a9a9; + constexpr Q_DECL_UNUSED const QRgb DarkKhaki = 0xffbdb76b; + constexpr Q_DECL_UNUSED const QRgb DarkMagenta = 0xff8b008b; + constexpr Q_DECL_UNUSED const QRgb DarkOliveGreen = 0xff556b2f; + constexpr Q_DECL_UNUSED const QRgb DarkOrange = 0xffff8c00; + constexpr Q_DECL_UNUSED const QRgb DarkOrchid = 0xff9932cc; + constexpr Q_DECL_UNUSED const QRgb DarkRed = 0xff8b0000; + constexpr Q_DECL_UNUSED const QRgb DarkSalmon = 0xffe9967a; + constexpr Q_DECL_UNUSED const QRgb DarkSeaGreen = 0xff8fbc8f; + constexpr Q_DECL_UNUSED const QRgb DarkSlateBlue = 0xff483d8b; + constexpr Q_DECL_UNUSED const QRgb DarkSlateGray = 0xff2f4f4f; + constexpr Q_DECL_UNUSED const QRgb DarkSlateGrey = 0xff2f4f4f; + constexpr Q_DECL_UNUSED const QRgb DarkTurquoise = 0xff00ced1; + constexpr Q_DECL_UNUSED const QRgb DarkViolet = 0xff9400d3; + constexpr Q_DECL_UNUSED const QRgb DeepPink = 0xffff1493; + constexpr Q_DECL_UNUSED const QRgb DeepSkyBlue = 0xff00bfff; + constexpr Q_DECL_UNUSED const QRgb DimGray = 0xff696969; + constexpr Q_DECL_UNUSED const QRgb DimGrey = 0xff696969; + constexpr Q_DECL_UNUSED const QRgb DodgerBlue = 0xff1e90ff; + constexpr Q_DECL_UNUSED const QRgb FireBrick = 0xffb22222; + constexpr Q_DECL_UNUSED const QRgb FloralWhite = 0xfffffaf0; + constexpr Q_DECL_UNUSED const QRgb ForestGreen = 0xff228b22; + constexpr Q_DECL_UNUSED const QRgb Fuchsia = 0xffff00ff; + constexpr Q_DECL_UNUSED const QRgb Gainsboro = 0xffdcdcdc; + constexpr Q_DECL_UNUSED const QRgb GhostWhite = 0xfff8f8ff; + constexpr Q_DECL_UNUSED const QRgb Gold = 0xffffd700; + constexpr Q_DECL_UNUSED const QRgb Goldenrod = 0xffdaa520; + constexpr Q_DECL_UNUSED const QRgb Gray = 0xff808080; + constexpr Q_DECL_UNUSED const QRgb Green = 0xff008000; + constexpr Q_DECL_UNUSED const QRgb GreenYellow = 0xffadff2f; + constexpr Q_DECL_UNUSED const QRgb Grey = 0xff808080; + constexpr Q_DECL_UNUSED const QRgb Honeydew = 0xfff0fff0; + constexpr Q_DECL_UNUSED const QRgb HotPink = 0xffff69b4; + constexpr Q_DECL_UNUSED const QRgb IndianRed = 0xffcd5c5c; + constexpr Q_DECL_UNUSED const QRgb Indigo = 0xff4b0082; + constexpr Q_DECL_UNUSED const QRgb Ivory = 0xfffffff0; + constexpr Q_DECL_UNUSED const QRgb Khaki = 0xfff0e68c; + constexpr Q_DECL_UNUSED const QRgb Lavender = 0xffe6e6fa; + constexpr Q_DECL_UNUSED const QRgb LavenderBlush = 0xfffff0f5; + constexpr Q_DECL_UNUSED const QRgb LawnGreen = 0xff7cfc00; + constexpr Q_DECL_UNUSED const QRgb LemonChiffon = 0xfffffacd; + constexpr Q_DECL_UNUSED const QRgb LightBlue = 0xffadd8e6; + constexpr Q_DECL_UNUSED const QRgb LightCoral = 0xfff08080; + constexpr Q_DECL_UNUSED const QRgb LightCyan = 0xffe0ffff; + constexpr Q_DECL_UNUSED const QRgb LightGoldenrodYellow = 0xfffafad2; + constexpr Q_DECL_UNUSED const QRgb LightGray = 0xffd3d3d3; + constexpr Q_DECL_UNUSED const QRgb LightGreen = 0xff90ee90; + constexpr Q_DECL_UNUSED const QRgb LightGrey = 0xffd3d3d3; + constexpr Q_DECL_UNUSED const QRgb LightPink = 0xffffb6c1; + constexpr Q_DECL_UNUSED const QRgb LightSalmon = 0xffffa07a; + constexpr Q_DECL_UNUSED const QRgb LightSeaGreen = 0xff20b2aa; + constexpr Q_DECL_UNUSED const QRgb LightSkyBlue = 0xff87cefa; + constexpr Q_DECL_UNUSED const QRgb LightSlateGray = 0xff778899; + constexpr Q_DECL_UNUSED const QRgb LightSlateGrey = 0xff778899; + constexpr Q_DECL_UNUSED const QRgb LightSteelBlue = 0xffb0c4de; + constexpr Q_DECL_UNUSED const QRgb LightYellow = 0xffffffe0; + constexpr Q_DECL_UNUSED const QRgb Lime = 0xff00ff00; + constexpr Q_DECL_UNUSED const QRgb Limegreen = 0xff32cd32; + constexpr Q_DECL_UNUSED const QRgb Linen = 0xfffaf0e6; + constexpr Q_DECL_UNUSED const QRgb Magenta = 0xffff00ff; + constexpr Q_DECL_UNUSED const QRgb Maroon = 0xff800000; + constexpr Q_DECL_UNUSED const QRgb MediumAquamarine = 0xff66cdaa; + constexpr Q_DECL_UNUSED const QRgb MediumBlue = 0xff0000cd; + constexpr Q_DECL_UNUSED const QRgb MediumOrchid = 0xffba55d3; + constexpr Q_DECL_UNUSED const QRgb MediumPurple = 0xff9370db; + constexpr Q_DECL_UNUSED const QRgb MediumSeaGreen = 0xff3cb371; + constexpr Q_DECL_UNUSED const QRgb MediumSlateBlue = 0xff7b68ee; + constexpr Q_DECL_UNUSED const QRgb MediumSpringGreen = 0xff00fa9a; + constexpr Q_DECL_UNUSED const QRgb MediumTurquoise = 0xff48d1cc; + constexpr Q_DECL_UNUSED const QRgb MediumVioletRed = 0xffc71585; + constexpr Q_DECL_UNUSED const QRgb MidnightBlue = 0xff191970; + constexpr Q_DECL_UNUSED const QRgb MintCream = 0xfff5fffa; + constexpr Q_DECL_UNUSED const QRgb MistyRose = 0xffffe4e1; + constexpr Q_DECL_UNUSED const QRgb Moccasin = 0xffffe4b5; + constexpr Q_DECL_UNUSED const QRgb NavajoWhite = 0xffffdead; + constexpr Q_DECL_UNUSED const QRgb Navy = 0xff000080; + constexpr Q_DECL_UNUSED const QRgb OldLace = 0xfffdf5e6; + constexpr Q_DECL_UNUSED const QRgb Olive = 0xff808000; + constexpr Q_DECL_UNUSED const QRgb OliveDrab = 0xff6b8e23; + constexpr Q_DECL_UNUSED const QRgb Orange = 0xffffa500; + constexpr Q_DECL_UNUSED const QRgb OrangeRed = 0xffff4500; + constexpr Q_DECL_UNUSED const QRgb Orchid = 0xffda70d6; + constexpr Q_DECL_UNUSED const QRgb PaleGoldenrod = 0xffeee8aa; + constexpr Q_DECL_UNUSED const QRgb PaleGreen = 0xff98fb98; + constexpr Q_DECL_UNUSED const QRgb PaleTurquoise = 0xffafeeee; + constexpr Q_DECL_UNUSED const QRgb PaleVioletRed = 0xffdb7093; + constexpr Q_DECL_UNUSED const QRgb PapayaWhip = 0xffffefd5; + constexpr Q_DECL_UNUSED const QRgb PeachPuff = 0xffffdab9; + constexpr Q_DECL_UNUSED const QRgb Peru = 0xffcd853f; + constexpr Q_DECL_UNUSED const QRgb Pink = 0xffffc0cb; + constexpr Q_DECL_UNUSED const QRgb Plum = 0xffdda0dd; + constexpr Q_DECL_UNUSED const QRgb PowderBlue = 0xffb0e0e6; + constexpr Q_DECL_UNUSED const QRgb Purple = 0xff800080; + constexpr Q_DECL_UNUSED const QRgb Red = 0xffff0000; + constexpr Q_DECL_UNUSED const QRgb RosyBrown = 0xffbc8f8f; + constexpr Q_DECL_UNUSED const QRgb RoyalBlue = 0xff4169e1; + constexpr Q_DECL_UNUSED const QRgb SaddleBrown = 0xff8b4513; + constexpr Q_DECL_UNUSED const QRgb Salmon = 0xfffa8072; + constexpr Q_DECL_UNUSED const QRgb SandyBrown = 0xfff4a460; + constexpr Q_DECL_UNUSED const QRgb SeaGreen = 0xff2e8b57; + constexpr Q_DECL_UNUSED const QRgb Seashell = 0xfffff5ee; + constexpr Q_DECL_UNUSED const QRgb Sienna = 0xffa0522d; + constexpr Q_DECL_UNUSED const QRgb Silver = 0xffc0c0c0; + constexpr Q_DECL_UNUSED const QRgb SkyBlue = 0xff87ceeb; + constexpr Q_DECL_UNUSED const QRgb SlateBlue = 0xff6a5acd; + constexpr Q_DECL_UNUSED const QRgb SlateGrey = 0xff708090; + constexpr Q_DECL_UNUSED const QRgb Snow = 0xfffffafa; + constexpr Q_DECL_UNUSED const QRgb SpringGreen = 0xff00ff7f; + constexpr Q_DECL_UNUSED const QRgb SteelBlue = 0xff4682b4; + constexpr Q_DECL_UNUSED const QRgb Tan = 0xffd2b48c; + constexpr Q_DECL_UNUSED const QRgb Teal = 0xff008080; + constexpr Q_DECL_UNUSED const QRgb Thistle = 0xffd8bfd8; + constexpr Q_DECL_UNUSED const QRgb Tomato = 0xffff6347; + constexpr Q_DECL_UNUSED const QRgb Turquoise = 0xff40e0d0; + constexpr Q_DECL_UNUSED const QRgb Violet = 0xffee82ee; + constexpr Q_DECL_UNUSED const QRgb Wheat = 0xfff5deb3; + constexpr Q_DECL_UNUSED const QRgb WhiteSmoke = 0xfff5f5f5; + constexpr Q_DECL_UNUSED const QRgb Yellow = 0xffffff00; + constexpr Q_DECL_UNUSED const QRgb YellowGreen = 0xff9acd32; + constexpr Q_DECL_UNUSED const QRgb White = 0xffffffff; + + // others + constexpr Q_DECL_UNUSED const QRgb Transparent = 0x00000000; + constexpr Q_DECL_UNUSED const QRgb AlphaMask = 0xff000000; + constexpr Q_DECL_UNUSED const QRgb ColorMask = 0x00ffffff; +} namespace QskRgb { -#define RGBVALUE( name, value ) static constexpr const QRgb name = value; - QSK_RGB_VALUES -#undef RGBVALUE - 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 ); From e8f52c03cc1e96908ebba18f67f4c5b7a08678fc Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Sat, 25 Jun 2022 16:52:24 +0200 Subject: [PATCH 7/8] hacks for exposing definitions to QML are not needed anymore --- src/common/QskRgbValue.h | 294 +++++++++++++++++++-------------------- 1 file changed, 147 insertions(+), 147 deletions(-) diff --git a/src/common/QskRgbValue.h b/src/common/QskRgbValue.h index 45f0baf0..8ef99e2d 100644 --- a/src/common/QskRgbValue.h +++ b/src/common/QskRgbValue.h @@ -13,157 +13,157 @@ namespace QskRgb { /* Web colors */ - constexpr Q_DECL_UNUSED const QRgb AliceBlue = 0xfff0f8ff; - constexpr Q_DECL_UNUSED const QRgb AntiqueWhite = 0xfffaebd7; - constexpr Q_DECL_UNUSED const QRgb Aqua = 0xff00ffff; - constexpr Q_DECL_UNUSED const QRgb Aquamarine = 0xff7fffd4; - constexpr Q_DECL_UNUSED const QRgb Azure = 0xfff0ffff; - constexpr Q_DECL_UNUSED const QRgb Beige = 0xfff5f5dc; - constexpr Q_DECL_UNUSED const QRgb Bisque = 0xffffe4c4; - constexpr Q_DECL_UNUSED const QRgb Black = 0xff000000; - constexpr Q_DECL_UNUSED const QRgb BlanchedAlmond = 0xffffebcd; - constexpr Q_DECL_UNUSED const QRgb Blue = 0xff0000ff; - constexpr Q_DECL_UNUSED const QRgb BlueViolet = 0xff8a2be2; - constexpr Q_DECL_UNUSED const QRgb Brown = 0xffa52a2a; - constexpr Q_DECL_UNUSED const QRgb Burlywood = 0xffdeb887; - constexpr Q_DECL_UNUSED const QRgb CadetBlue = 0xff5f9ea0; - constexpr Q_DECL_UNUSED const QRgb Chartreuse = 0xff7fff00; - constexpr Q_DECL_UNUSED const QRgb Chocolate = 0xffd2691e; - constexpr Q_DECL_UNUSED const QRgb Coral = 0xffff7f50; - constexpr Q_DECL_UNUSED const QRgb CornflowerBlue = 0xff6495ed; - constexpr Q_DECL_UNUSED const QRgb Cornsilk = 0xfffff8dc; - constexpr Q_DECL_UNUSED const QRgb Crimson = 0xffdc143c; - constexpr Q_DECL_UNUSED const QRgb Cyan = 0xff00ffff; - constexpr Q_DECL_UNUSED const QRgb DarkBlue = 0xff00008b; - constexpr Q_DECL_UNUSED const QRgb DarkCyan = 0xff008b8b; - constexpr Q_DECL_UNUSED const QRgb DarkGoldenrod = 0xffb8860b; - constexpr Q_DECL_UNUSED const QRgb DarkGray = 0xffa9a9a9; - constexpr Q_DECL_UNUSED const QRgb DarkGreen = 0xff006400; - constexpr Q_DECL_UNUSED const QRgb DarkGrey = 0xffa9a9a9; - constexpr Q_DECL_UNUSED const QRgb DarkKhaki = 0xffbdb76b; - constexpr Q_DECL_UNUSED const QRgb DarkMagenta = 0xff8b008b; - constexpr Q_DECL_UNUSED const QRgb DarkOliveGreen = 0xff556b2f; - constexpr Q_DECL_UNUSED const QRgb DarkOrange = 0xffff8c00; - constexpr Q_DECL_UNUSED const QRgb DarkOrchid = 0xff9932cc; - constexpr Q_DECL_UNUSED const QRgb DarkRed = 0xff8b0000; - constexpr Q_DECL_UNUSED const QRgb DarkSalmon = 0xffe9967a; - constexpr Q_DECL_UNUSED const QRgb DarkSeaGreen = 0xff8fbc8f; - constexpr Q_DECL_UNUSED const QRgb DarkSlateBlue = 0xff483d8b; - constexpr Q_DECL_UNUSED const QRgb DarkSlateGray = 0xff2f4f4f; - constexpr Q_DECL_UNUSED const QRgb DarkSlateGrey = 0xff2f4f4f; - constexpr Q_DECL_UNUSED const QRgb DarkTurquoise = 0xff00ced1; - constexpr Q_DECL_UNUSED const QRgb DarkViolet = 0xff9400d3; - constexpr Q_DECL_UNUSED const QRgb DeepPink = 0xffff1493; - constexpr Q_DECL_UNUSED const QRgb DeepSkyBlue = 0xff00bfff; - constexpr Q_DECL_UNUSED const QRgb DimGray = 0xff696969; - constexpr Q_DECL_UNUSED const QRgb DimGrey = 0xff696969; - constexpr Q_DECL_UNUSED const QRgb DodgerBlue = 0xff1e90ff; - constexpr Q_DECL_UNUSED const QRgb FireBrick = 0xffb22222; - constexpr Q_DECL_UNUSED const QRgb FloralWhite = 0xfffffaf0; - constexpr Q_DECL_UNUSED const QRgb ForestGreen = 0xff228b22; - constexpr Q_DECL_UNUSED const QRgb Fuchsia = 0xffff00ff; - constexpr Q_DECL_UNUSED const QRgb Gainsboro = 0xffdcdcdc; - constexpr Q_DECL_UNUSED const QRgb GhostWhite = 0xfff8f8ff; - constexpr Q_DECL_UNUSED const QRgb Gold = 0xffffd700; - constexpr Q_DECL_UNUSED const QRgb Goldenrod = 0xffdaa520; - constexpr Q_DECL_UNUSED const QRgb Gray = 0xff808080; - constexpr Q_DECL_UNUSED const QRgb Green = 0xff008000; - constexpr Q_DECL_UNUSED const QRgb GreenYellow = 0xffadff2f; - constexpr Q_DECL_UNUSED const QRgb Grey = 0xff808080; - constexpr Q_DECL_UNUSED const QRgb Honeydew = 0xfff0fff0; - constexpr Q_DECL_UNUSED const QRgb HotPink = 0xffff69b4; - constexpr Q_DECL_UNUSED const QRgb IndianRed = 0xffcd5c5c; - constexpr Q_DECL_UNUSED const QRgb Indigo = 0xff4b0082; - constexpr Q_DECL_UNUSED const QRgb Ivory = 0xfffffff0; - constexpr Q_DECL_UNUSED const QRgb Khaki = 0xfff0e68c; - constexpr Q_DECL_UNUSED const QRgb Lavender = 0xffe6e6fa; - constexpr Q_DECL_UNUSED const QRgb LavenderBlush = 0xfffff0f5; - constexpr Q_DECL_UNUSED const QRgb LawnGreen = 0xff7cfc00; - constexpr Q_DECL_UNUSED const QRgb LemonChiffon = 0xfffffacd; - constexpr Q_DECL_UNUSED const QRgb LightBlue = 0xffadd8e6; - constexpr Q_DECL_UNUSED const QRgb LightCoral = 0xfff08080; - constexpr Q_DECL_UNUSED const QRgb LightCyan = 0xffe0ffff; + constexpr Q_DECL_UNUSED const QRgb AliceBlue = 0xfff0f8ff; + constexpr Q_DECL_UNUSED const QRgb AntiqueWhite = 0xfffaebd7; + constexpr Q_DECL_UNUSED const QRgb Aqua = 0xff00ffff; + constexpr Q_DECL_UNUSED const QRgb Aquamarine = 0xff7fffd4; + constexpr Q_DECL_UNUSED const QRgb Azure = 0xfff0ffff; + constexpr Q_DECL_UNUSED const QRgb Beige = 0xfff5f5dc; + constexpr Q_DECL_UNUSED const QRgb Bisque = 0xffffe4c4; + constexpr Q_DECL_UNUSED const QRgb Black = 0xff000000; + constexpr Q_DECL_UNUSED const QRgb BlanchedAlmond = 0xffffebcd; + constexpr Q_DECL_UNUSED const QRgb Blue = 0xff0000ff; + constexpr Q_DECL_UNUSED const QRgb BlueViolet = 0xff8a2be2; + constexpr Q_DECL_UNUSED const QRgb Brown = 0xffa52a2a; + constexpr Q_DECL_UNUSED const QRgb Burlywood = 0xffdeb887; + constexpr Q_DECL_UNUSED const QRgb CadetBlue = 0xff5f9ea0; + constexpr Q_DECL_UNUSED const QRgb Chartreuse = 0xff7fff00; + constexpr Q_DECL_UNUSED const QRgb Chocolate = 0xffd2691e; + constexpr Q_DECL_UNUSED const QRgb Coral = 0xffff7f50; + constexpr Q_DECL_UNUSED const QRgb CornflowerBlue = 0xff6495ed; + constexpr Q_DECL_UNUSED const QRgb Cornsilk = 0xfffff8dc; + constexpr Q_DECL_UNUSED const QRgb Crimson = 0xffdc143c; + constexpr Q_DECL_UNUSED const QRgb Cyan = 0xff00ffff; + constexpr Q_DECL_UNUSED const QRgb DarkBlue = 0xff00008b; + constexpr Q_DECL_UNUSED const QRgb DarkCyan = 0xff008b8b; + constexpr Q_DECL_UNUSED const QRgb DarkGoldenrod = 0xffb8860b; + constexpr Q_DECL_UNUSED const QRgb DarkGray = 0xffa9a9a9; + constexpr Q_DECL_UNUSED const QRgb DarkGreen = 0xff006400; + constexpr Q_DECL_UNUSED const QRgb DarkGrey = 0xffa9a9a9; + constexpr Q_DECL_UNUSED const QRgb DarkKhaki = 0xffbdb76b; + constexpr Q_DECL_UNUSED const QRgb DarkMagenta = 0xff8b008b; + constexpr Q_DECL_UNUSED const QRgb DarkOliveGreen = 0xff556b2f; + constexpr Q_DECL_UNUSED const QRgb DarkOrange = 0xffff8c00; + constexpr Q_DECL_UNUSED const QRgb DarkOrchid = 0xff9932cc; + constexpr Q_DECL_UNUSED const QRgb DarkRed = 0xff8b0000; + constexpr Q_DECL_UNUSED const QRgb DarkSalmon = 0xffe9967a; + constexpr Q_DECL_UNUSED const QRgb DarkSeaGreen = 0xff8fbc8f; + constexpr Q_DECL_UNUSED const QRgb DarkSlateBlue = 0xff483d8b; + constexpr Q_DECL_UNUSED const QRgb DarkSlateGray = 0xff2f4f4f; + constexpr Q_DECL_UNUSED const QRgb DarkSlateGrey = 0xff2f4f4f; + constexpr Q_DECL_UNUSED const QRgb DarkTurquoise = 0xff00ced1; + constexpr Q_DECL_UNUSED const QRgb DarkViolet = 0xff9400d3; + constexpr Q_DECL_UNUSED const QRgb DeepPink = 0xffff1493; + constexpr Q_DECL_UNUSED const QRgb DeepSkyBlue = 0xff00bfff; + constexpr Q_DECL_UNUSED const QRgb DimGray = 0xff696969; + constexpr Q_DECL_UNUSED const QRgb DimGrey = 0xff696969; + constexpr Q_DECL_UNUSED const QRgb DodgerBlue = 0xff1e90ff; + constexpr Q_DECL_UNUSED const QRgb FireBrick = 0xffb22222; + constexpr Q_DECL_UNUSED const QRgb FloralWhite = 0xfffffaf0; + constexpr Q_DECL_UNUSED const QRgb ForestGreen = 0xff228b22; + constexpr Q_DECL_UNUSED const QRgb Fuchsia = 0xffff00ff; + constexpr Q_DECL_UNUSED const QRgb Gainsboro = 0xffdcdcdc; + constexpr Q_DECL_UNUSED const QRgb GhostWhite = 0xfff8f8ff; + constexpr Q_DECL_UNUSED const QRgb Gold = 0xffffd700; + constexpr Q_DECL_UNUSED const QRgb Goldenrod = 0xffdaa520; + constexpr Q_DECL_UNUSED const QRgb Gray = 0xff808080; + constexpr Q_DECL_UNUSED const QRgb Green = 0xff008000; + constexpr Q_DECL_UNUSED const QRgb GreenYellow = 0xffadff2f; + constexpr Q_DECL_UNUSED const QRgb Grey = 0xff808080; + constexpr Q_DECL_UNUSED const QRgb Honeydew = 0xfff0fff0; + constexpr Q_DECL_UNUSED const QRgb HotPink = 0xffff69b4; + constexpr Q_DECL_UNUSED const QRgb IndianRed = 0xffcd5c5c; + constexpr Q_DECL_UNUSED const QRgb Indigo = 0xff4b0082; + constexpr Q_DECL_UNUSED const QRgb Ivory = 0xfffffff0; + constexpr Q_DECL_UNUSED const QRgb Khaki = 0xfff0e68c; + constexpr Q_DECL_UNUSED const QRgb Lavender = 0xffe6e6fa; + constexpr Q_DECL_UNUSED const QRgb LavenderBlush = 0xfffff0f5; + constexpr Q_DECL_UNUSED const QRgb LawnGreen = 0xff7cfc00; + constexpr Q_DECL_UNUSED const QRgb LemonChiffon = 0xfffffacd; + constexpr Q_DECL_UNUSED const QRgb LightBlue = 0xffadd8e6; + constexpr Q_DECL_UNUSED const QRgb LightCoral = 0xfff08080; + constexpr Q_DECL_UNUSED const QRgb LightCyan = 0xffe0ffff; constexpr Q_DECL_UNUSED const QRgb LightGoldenrodYellow = 0xfffafad2; - constexpr Q_DECL_UNUSED const QRgb LightGray = 0xffd3d3d3; - constexpr Q_DECL_UNUSED const QRgb LightGreen = 0xff90ee90; - constexpr Q_DECL_UNUSED const QRgb LightGrey = 0xffd3d3d3; - constexpr Q_DECL_UNUSED const QRgb LightPink = 0xffffb6c1; - constexpr Q_DECL_UNUSED const QRgb LightSalmon = 0xffffa07a; - constexpr Q_DECL_UNUSED const QRgb LightSeaGreen = 0xff20b2aa; - constexpr Q_DECL_UNUSED const QRgb LightSkyBlue = 0xff87cefa; - constexpr Q_DECL_UNUSED const QRgb LightSlateGray = 0xff778899; - constexpr Q_DECL_UNUSED const QRgb LightSlateGrey = 0xff778899; - constexpr Q_DECL_UNUSED const QRgb LightSteelBlue = 0xffb0c4de; - constexpr Q_DECL_UNUSED const QRgb LightYellow = 0xffffffe0; - constexpr Q_DECL_UNUSED const QRgb Lime = 0xff00ff00; - constexpr Q_DECL_UNUSED const QRgb Limegreen = 0xff32cd32; - constexpr Q_DECL_UNUSED const QRgb Linen = 0xfffaf0e6; - constexpr Q_DECL_UNUSED const QRgb Magenta = 0xffff00ff; - constexpr Q_DECL_UNUSED const QRgb Maroon = 0xff800000; - constexpr Q_DECL_UNUSED const QRgb MediumAquamarine = 0xff66cdaa; - constexpr Q_DECL_UNUSED const QRgb MediumBlue = 0xff0000cd; - constexpr Q_DECL_UNUSED const QRgb MediumOrchid = 0xffba55d3; - constexpr Q_DECL_UNUSED const QRgb MediumPurple = 0xff9370db; - constexpr Q_DECL_UNUSED const QRgb MediumSeaGreen = 0xff3cb371; - constexpr Q_DECL_UNUSED const QRgb MediumSlateBlue = 0xff7b68ee; - constexpr Q_DECL_UNUSED const QRgb MediumSpringGreen = 0xff00fa9a; - constexpr Q_DECL_UNUSED const QRgb MediumTurquoise = 0xff48d1cc; - constexpr Q_DECL_UNUSED const QRgb MediumVioletRed = 0xffc71585; - constexpr Q_DECL_UNUSED const QRgb MidnightBlue = 0xff191970; - constexpr Q_DECL_UNUSED const QRgb MintCream = 0xfff5fffa; - constexpr Q_DECL_UNUSED const QRgb MistyRose = 0xffffe4e1; - constexpr Q_DECL_UNUSED const QRgb Moccasin = 0xffffe4b5; - constexpr Q_DECL_UNUSED const QRgb NavajoWhite = 0xffffdead; - constexpr Q_DECL_UNUSED const QRgb Navy = 0xff000080; - constexpr Q_DECL_UNUSED const QRgb OldLace = 0xfffdf5e6; - constexpr Q_DECL_UNUSED const QRgb Olive = 0xff808000; - constexpr Q_DECL_UNUSED const QRgb OliveDrab = 0xff6b8e23; - constexpr Q_DECL_UNUSED const QRgb Orange = 0xffffa500; - constexpr Q_DECL_UNUSED const QRgb OrangeRed = 0xffff4500; - constexpr Q_DECL_UNUSED const QRgb Orchid = 0xffda70d6; - constexpr Q_DECL_UNUSED const QRgb PaleGoldenrod = 0xffeee8aa; - constexpr Q_DECL_UNUSED const QRgb PaleGreen = 0xff98fb98; - constexpr Q_DECL_UNUSED const QRgb PaleTurquoise = 0xffafeeee; - constexpr Q_DECL_UNUSED const QRgb PaleVioletRed = 0xffdb7093; - constexpr Q_DECL_UNUSED const QRgb PapayaWhip = 0xffffefd5; - constexpr Q_DECL_UNUSED const QRgb PeachPuff = 0xffffdab9; - constexpr Q_DECL_UNUSED const QRgb Peru = 0xffcd853f; - constexpr Q_DECL_UNUSED const QRgb Pink = 0xffffc0cb; - constexpr Q_DECL_UNUSED const QRgb Plum = 0xffdda0dd; - constexpr Q_DECL_UNUSED const QRgb PowderBlue = 0xffb0e0e6; - constexpr Q_DECL_UNUSED const QRgb Purple = 0xff800080; - constexpr Q_DECL_UNUSED const QRgb Red = 0xffff0000; - constexpr Q_DECL_UNUSED const QRgb RosyBrown = 0xffbc8f8f; - constexpr Q_DECL_UNUSED const QRgb RoyalBlue = 0xff4169e1; - constexpr Q_DECL_UNUSED const QRgb SaddleBrown = 0xff8b4513; - constexpr Q_DECL_UNUSED const QRgb Salmon = 0xfffa8072; - constexpr Q_DECL_UNUSED const QRgb SandyBrown = 0xfff4a460; - constexpr Q_DECL_UNUSED const QRgb SeaGreen = 0xff2e8b57; - constexpr Q_DECL_UNUSED const QRgb Seashell = 0xfffff5ee; - constexpr Q_DECL_UNUSED const QRgb Sienna = 0xffa0522d; - constexpr Q_DECL_UNUSED const QRgb Silver = 0xffc0c0c0; - constexpr Q_DECL_UNUSED const QRgb SkyBlue = 0xff87ceeb; - constexpr Q_DECL_UNUSED const QRgb SlateBlue = 0xff6a5acd; - constexpr Q_DECL_UNUSED const QRgb SlateGrey = 0xff708090; - constexpr Q_DECL_UNUSED const QRgb Snow = 0xfffffafa; - constexpr Q_DECL_UNUSED const QRgb SpringGreen = 0xff00ff7f; - constexpr Q_DECL_UNUSED const QRgb SteelBlue = 0xff4682b4; - constexpr Q_DECL_UNUSED const QRgb Tan = 0xffd2b48c; - constexpr Q_DECL_UNUSED const QRgb Teal = 0xff008080; - constexpr Q_DECL_UNUSED const QRgb Thistle = 0xffd8bfd8; - constexpr Q_DECL_UNUSED const QRgb Tomato = 0xffff6347; - constexpr Q_DECL_UNUSED const QRgb Turquoise = 0xff40e0d0; - constexpr Q_DECL_UNUSED const QRgb Violet = 0xffee82ee; - constexpr Q_DECL_UNUSED const QRgb Wheat = 0xfff5deb3; - constexpr Q_DECL_UNUSED const QRgb WhiteSmoke = 0xfff5f5f5; - constexpr Q_DECL_UNUSED const QRgb Yellow = 0xffffff00; - constexpr Q_DECL_UNUSED const QRgb YellowGreen = 0xff9acd32; - constexpr Q_DECL_UNUSED const QRgb White = 0xffffffff; + constexpr Q_DECL_UNUSED const QRgb LightGray = 0xffd3d3d3; + constexpr Q_DECL_UNUSED const QRgb LightGreen = 0xff90ee90; + constexpr Q_DECL_UNUSED const QRgb LightGrey = 0xffd3d3d3; + constexpr Q_DECL_UNUSED const QRgb LightPink = 0xffffb6c1; + constexpr Q_DECL_UNUSED const QRgb LightSalmon = 0xffffa07a; + constexpr Q_DECL_UNUSED const QRgb LightSeaGreen = 0xff20b2aa; + constexpr Q_DECL_UNUSED const QRgb LightSkyBlue = 0xff87cefa; + constexpr Q_DECL_UNUSED const QRgb LightSlateGray = 0xff778899; + constexpr Q_DECL_UNUSED const QRgb LightSlateGrey = 0xff778899; + constexpr Q_DECL_UNUSED const QRgb LightSteelBlue = 0xffb0c4de; + constexpr Q_DECL_UNUSED const QRgb LightYellow = 0xffffffe0; + constexpr Q_DECL_UNUSED const QRgb Lime = 0xff00ff00; + constexpr Q_DECL_UNUSED const QRgb Limegreen = 0xff32cd32; + constexpr Q_DECL_UNUSED const QRgb Linen = 0xfffaf0e6; + constexpr Q_DECL_UNUSED const QRgb Magenta = 0xffff00ff; + constexpr Q_DECL_UNUSED const QRgb Maroon = 0xff800000; + constexpr Q_DECL_UNUSED const QRgb MediumAquamarine = 0xff66cdaa; + constexpr Q_DECL_UNUSED const QRgb MediumBlue = 0xff0000cd; + constexpr Q_DECL_UNUSED const QRgb MediumOrchid = 0xffba55d3; + constexpr Q_DECL_UNUSED const QRgb MediumPurple = 0xff9370db; + constexpr Q_DECL_UNUSED const QRgb MediumSeaGreen = 0xff3cb371; + constexpr Q_DECL_UNUSED const QRgb MediumSlateBlue = 0xff7b68ee; + constexpr Q_DECL_UNUSED const QRgb MediumSpringGreen = 0xff00fa9a; + constexpr Q_DECL_UNUSED const QRgb MediumTurquoise = 0xff48d1cc; + constexpr Q_DECL_UNUSED const QRgb MediumVioletRed = 0xffc71585; + constexpr Q_DECL_UNUSED const QRgb MidnightBlue = 0xff191970; + constexpr Q_DECL_UNUSED const QRgb MintCream = 0xfff5fffa; + constexpr Q_DECL_UNUSED const QRgb MistyRose = 0xffffe4e1; + constexpr Q_DECL_UNUSED const QRgb Moccasin = 0xffffe4b5; + constexpr Q_DECL_UNUSED const QRgb NavajoWhite = 0xffffdead; + constexpr Q_DECL_UNUSED const QRgb Navy = 0xff000080; + constexpr Q_DECL_UNUSED const QRgb OldLace = 0xfffdf5e6; + constexpr Q_DECL_UNUSED const QRgb Olive = 0xff808000; + constexpr Q_DECL_UNUSED const QRgb OliveDrab = 0xff6b8e23; + constexpr Q_DECL_UNUSED const QRgb Orange = 0xffffa500; + constexpr Q_DECL_UNUSED const QRgb OrangeRed = 0xffff4500; + constexpr Q_DECL_UNUSED const QRgb Orchid = 0xffda70d6; + constexpr Q_DECL_UNUSED const QRgb PaleGoldenrod = 0xffeee8aa; + constexpr Q_DECL_UNUSED const QRgb PaleGreen = 0xff98fb98; + constexpr Q_DECL_UNUSED const QRgb PaleTurquoise = 0xffafeeee; + constexpr Q_DECL_UNUSED const QRgb PaleVioletRed = 0xffdb7093; + constexpr Q_DECL_UNUSED const QRgb PapayaWhip = 0xffffefd5; + constexpr Q_DECL_UNUSED const QRgb PeachPuff = 0xffffdab9; + constexpr Q_DECL_UNUSED const QRgb Peru = 0xffcd853f; + constexpr Q_DECL_UNUSED const QRgb Pink = 0xffffc0cb; + constexpr Q_DECL_UNUSED const QRgb Plum = 0xffdda0dd; + constexpr Q_DECL_UNUSED const QRgb PowderBlue = 0xffb0e0e6; + constexpr Q_DECL_UNUSED const QRgb Purple = 0xff800080; + constexpr Q_DECL_UNUSED const QRgb Red = 0xffff0000; + constexpr Q_DECL_UNUSED const QRgb RosyBrown = 0xffbc8f8f; + constexpr Q_DECL_UNUSED const QRgb RoyalBlue = 0xff4169e1; + constexpr Q_DECL_UNUSED const QRgb SaddleBrown = 0xff8b4513; + constexpr Q_DECL_UNUSED const QRgb Salmon = 0xfffa8072; + constexpr Q_DECL_UNUSED const QRgb SandyBrown = 0xfff4a460; + constexpr Q_DECL_UNUSED const QRgb SeaGreen = 0xff2e8b57; + constexpr Q_DECL_UNUSED const QRgb Seashell = 0xfffff5ee; + constexpr Q_DECL_UNUSED const QRgb Sienna = 0xffa0522d; + constexpr Q_DECL_UNUSED const QRgb Silver = 0xffc0c0c0; + constexpr Q_DECL_UNUSED const QRgb SkyBlue = 0xff87ceeb; + constexpr Q_DECL_UNUSED const QRgb SlateBlue = 0xff6a5acd; + constexpr Q_DECL_UNUSED const QRgb SlateGrey = 0xff708090; + constexpr Q_DECL_UNUSED const QRgb Snow = 0xfffffafa; + constexpr Q_DECL_UNUSED const QRgb SpringGreen = 0xff00ff7f; + constexpr Q_DECL_UNUSED const QRgb SteelBlue = 0xff4682b4; + constexpr Q_DECL_UNUSED const QRgb Tan = 0xffd2b48c; + constexpr Q_DECL_UNUSED const QRgb Teal = 0xff008080; + constexpr Q_DECL_UNUSED const QRgb Thistle = 0xffd8bfd8; + constexpr Q_DECL_UNUSED const QRgb Tomato = 0xffff6347; + constexpr Q_DECL_UNUSED const QRgb Turquoise = 0xff40e0d0; + constexpr Q_DECL_UNUSED const QRgb Violet = 0xffee82ee; + constexpr Q_DECL_UNUSED const QRgb Wheat = 0xfff5deb3; + constexpr Q_DECL_UNUSED const QRgb WhiteSmoke = 0xfff5f5f5; + constexpr Q_DECL_UNUSED const QRgb Yellow = 0xffffff00; + constexpr Q_DECL_UNUSED const QRgb YellowGreen = 0xff9acd32; + constexpr Q_DECL_UNUSED const QRgb White = 0xffffffff; // others constexpr Q_DECL_UNUSED const QRgb Transparent = 0x00000000; - constexpr Q_DECL_UNUSED const QRgb AlphaMask = 0xff000000; - constexpr Q_DECL_UNUSED const QRgb ColorMask = 0x00ffffff; + constexpr Q_DECL_UNUSED const QRgb AlphaMask = 0xff000000; + constexpr Q_DECL_UNUSED const QRgb ColorMask = 0x00ffffff; } namespace QskRgb From d3c320bb9aea1764b53575f2328bdd52b96d3598 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Sun, 26 Jun 2022 14:33:39 +0200 Subject: [PATCH 8/8] Q_DECL_UNUSED removed, seems to cause problems on Macs --- src/common/QskRgbValue.h | 298 +++++++++++++++++++-------------------- 1 file changed, 149 insertions(+), 149 deletions(-) diff --git a/src/common/QskRgbValue.h b/src/common/QskRgbValue.h index 8ef99e2d..39687898 100644 --- a/src/common/QskRgbValue.h +++ b/src/common/QskRgbValue.h @@ -13,157 +13,157 @@ namespace QskRgb { /* Web colors */ - constexpr Q_DECL_UNUSED const QRgb AliceBlue = 0xfff0f8ff; - constexpr Q_DECL_UNUSED const QRgb AntiqueWhite = 0xfffaebd7; - constexpr Q_DECL_UNUSED const QRgb Aqua = 0xff00ffff; - constexpr Q_DECL_UNUSED const QRgb Aquamarine = 0xff7fffd4; - constexpr Q_DECL_UNUSED const QRgb Azure = 0xfff0ffff; - constexpr Q_DECL_UNUSED const QRgb Beige = 0xfff5f5dc; - constexpr Q_DECL_UNUSED const QRgb Bisque = 0xffffe4c4; - constexpr Q_DECL_UNUSED const QRgb Black = 0xff000000; - constexpr Q_DECL_UNUSED const QRgb BlanchedAlmond = 0xffffebcd; - constexpr Q_DECL_UNUSED const QRgb Blue = 0xff0000ff; - constexpr Q_DECL_UNUSED const QRgb BlueViolet = 0xff8a2be2; - constexpr Q_DECL_UNUSED const QRgb Brown = 0xffa52a2a; - constexpr Q_DECL_UNUSED const QRgb Burlywood = 0xffdeb887; - constexpr Q_DECL_UNUSED const QRgb CadetBlue = 0xff5f9ea0; - constexpr Q_DECL_UNUSED const QRgb Chartreuse = 0xff7fff00; - constexpr Q_DECL_UNUSED const QRgb Chocolate = 0xffd2691e; - constexpr Q_DECL_UNUSED const QRgb Coral = 0xffff7f50; - constexpr Q_DECL_UNUSED const QRgb CornflowerBlue = 0xff6495ed; - constexpr Q_DECL_UNUSED const QRgb Cornsilk = 0xfffff8dc; - constexpr Q_DECL_UNUSED const QRgb Crimson = 0xffdc143c; - constexpr Q_DECL_UNUSED const QRgb Cyan = 0xff00ffff; - constexpr Q_DECL_UNUSED const QRgb DarkBlue = 0xff00008b; - constexpr Q_DECL_UNUSED const QRgb DarkCyan = 0xff008b8b; - constexpr Q_DECL_UNUSED const QRgb DarkGoldenrod = 0xffb8860b; - constexpr Q_DECL_UNUSED const QRgb DarkGray = 0xffa9a9a9; - constexpr Q_DECL_UNUSED const QRgb DarkGreen = 0xff006400; - constexpr Q_DECL_UNUSED const QRgb DarkGrey = 0xffa9a9a9; - constexpr Q_DECL_UNUSED const QRgb DarkKhaki = 0xffbdb76b; - constexpr Q_DECL_UNUSED const QRgb DarkMagenta = 0xff8b008b; - constexpr Q_DECL_UNUSED const QRgb DarkOliveGreen = 0xff556b2f; - constexpr Q_DECL_UNUSED const QRgb DarkOrange = 0xffff8c00; - constexpr Q_DECL_UNUSED const QRgb DarkOrchid = 0xff9932cc; - constexpr Q_DECL_UNUSED const QRgb DarkRed = 0xff8b0000; - constexpr Q_DECL_UNUSED const QRgb DarkSalmon = 0xffe9967a; - constexpr Q_DECL_UNUSED const QRgb DarkSeaGreen = 0xff8fbc8f; - constexpr Q_DECL_UNUSED const QRgb DarkSlateBlue = 0xff483d8b; - constexpr Q_DECL_UNUSED const QRgb DarkSlateGray = 0xff2f4f4f; - constexpr Q_DECL_UNUSED const QRgb DarkSlateGrey = 0xff2f4f4f; - constexpr Q_DECL_UNUSED const QRgb DarkTurquoise = 0xff00ced1; - constexpr Q_DECL_UNUSED const QRgb DarkViolet = 0xff9400d3; - constexpr Q_DECL_UNUSED const QRgb DeepPink = 0xffff1493; - constexpr Q_DECL_UNUSED const QRgb DeepSkyBlue = 0xff00bfff; - constexpr Q_DECL_UNUSED const QRgb DimGray = 0xff696969; - constexpr Q_DECL_UNUSED const QRgb DimGrey = 0xff696969; - constexpr Q_DECL_UNUSED const QRgb DodgerBlue = 0xff1e90ff; - constexpr Q_DECL_UNUSED const QRgb FireBrick = 0xffb22222; - constexpr Q_DECL_UNUSED const QRgb FloralWhite = 0xfffffaf0; - constexpr Q_DECL_UNUSED const QRgb ForestGreen = 0xff228b22; - constexpr Q_DECL_UNUSED const QRgb Fuchsia = 0xffff00ff; - constexpr Q_DECL_UNUSED const QRgb Gainsboro = 0xffdcdcdc; - constexpr Q_DECL_UNUSED const QRgb GhostWhite = 0xfff8f8ff; - constexpr Q_DECL_UNUSED const QRgb Gold = 0xffffd700; - constexpr Q_DECL_UNUSED const QRgb Goldenrod = 0xffdaa520; - constexpr Q_DECL_UNUSED const QRgb Gray = 0xff808080; - constexpr Q_DECL_UNUSED const QRgb Green = 0xff008000; - constexpr Q_DECL_UNUSED const QRgb GreenYellow = 0xffadff2f; - constexpr Q_DECL_UNUSED const QRgb Grey = 0xff808080; - constexpr Q_DECL_UNUSED const QRgb Honeydew = 0xfff0fff0; - constexpr Q_DECL_UNUSED const QRgb HotPink = 0xffff69b4; - constexpr Q_DECL_UNUSED const QRgb IndianRed = 0xffcd5c5c; - constexpr Q_DECL_UNUSED const QRgb Indigo = 0xff4b0082; - constexpr Q_DECL_UNUSED const QRgb Ivory = 0xfffffff0; - constexpr Q_DECL_UNUSED const QRgb Khaki = 0xfff0e68c; - constexpr Q_DECL_UNUSED const QRgb Lavender = 0xffe6e6fa; - constexpr Q_DECL_UNUSED const QRgb LavenderBlush = 0xfffff0f5; - constexpr Q_DECL_UNUSED const QRgb LawnGreen = 0xff7cfc00; - constexpr Q_DECL_UNUSED const QRgb LemonChiffon = 0xfffffacd; - constexpr Q_DECL_UNUSED const QRgb LightBlue = 0xffadd8e6; - constexpr Q_DECL_UNUSED const QRgb LightCoral = 0xfff08080; - constexpr Q_DECL_UNUSED const QRgb LightCyan = 0xffe0ffff; - constexpr Q_DECL_UNUSED const QRgb LightGoldenrodYellow = 0xfffafad2; - constexpr Q_DECL_UNUSED const QRgb LightGray = 0xffd3d3d3; - constexpr Q_DECL_UNUSED const QRgb LightGreen = 0xff90ee90; - constexpr Q_DECL_UNUSED const QRgb LightGrey = 0xffd3d3d3; - constexpr Q_DECL_UNUSED const QRgb LightPink = 0xffffb6c1; - constexpr Q_DECL_UNUSED const QRgb LightSalmon = 0xffffa07a; - constexpr Q_DECL_UNUSED const QRgb LightSeaGreen = 0xff20b2aa; - constexpr Q_DECL_UNUSED const QRgb LightSkyBlue = 0xff87cefa; - constexpr Q_DECL_UNUSED const QRgb LightSlateGray = 0xff778899; - constexpr Q_DECL_UNUSED const QRgb LightSlateGrey = 0xff778899; - constexpr Q_DECL_UNUSED const QRgb LightSteelBlue = 0xffb0c4de; - constexpr Q_DECL_UNUSED const QRgb LightYellow = 0xffffffe0; - constexpr Q_DECL_UNUSED const QRgb Lime = 0xff00ff00; - constexpr Q_DECL_UNUSED const QRgb Limegreen = 0xff32cd32; - constexpr Q_DECL_UNUSED const QRgb Linen = 0xfffaf0e6; - constexpr Q_DECL_UNUSED const QRgb Magenta = 0xffff00ff; - constexpr Q_DECL_UNUSED const QRgb Maroon = 0xff800000; - constexpr Q_DECL_UNUSED const QRgb MediumAquamarine = 0xff66cdaa; - constexpr Q_DECL_UNUSED const QRgb MediumBlue = 0xff0000cd; - constexpr Q_DECL_UNUSED const QRgb MediumOrchid = 0xffba55d3; - constexpr Q_DECL_UNUSED const QRgb MediumPurple = 0xff9370db; - constexpr Q_DECL_UNUSED const QRgb MediumSeaGreen = 0xff3cb371; - constexpr Q_DECL_UNUSED const QRgb MediumSlateBlue = 0xff7b68ee; - constexpr Q_DECL_UNUSED const QRgb MediumSpringGreen = 0xff00fa9a; - constexpr Q_DECL_UNUSED const QRgb MediumTurquoise = 0xff48d1cc; - constexpr Q_DECL_UNUSED const QRgb MediumVioletRed = 0xffc71585; - constexpr Q_DECL_UNUSED const QRgb MidnightBlue = 0xff191970; - constexpr Q_DECL_UNUSED const QRgb MintCream = 0xfff5fffa; - constexpr Q_DECL_UNUSED const QRgb MistyRose = 0xffffe4e1; - constexpr Q_DECL_UNUSED const QRgb Moccasin = 0xffffe4b5; - constexpr Q_DECL_UNUSED const QRgb NavajoWhite = 0xffffdead; - constexpr Q_DECL_UNUSED const QRgb Navy = 0xff000080; - constexpr Q_DECL_UNUSED const QRgb OldLace = 0xfffdf5e6; - constexpr Q_DECL_UNUSED const QRgb Olive = 0xff808000; - constexpr Q_DECL_UNUSED const QRgb OliveDrab = 0xff6b8e23; - constexpr Q_DECL_UNUSED const QRgb Orange = 0xffffa500; - constexpr Q_DECL_UNUSED const QRgb OrangeRed = 0xffff4500; - constexpr Q_DECL_UNUSED const QRgb Orchid = 0xffda70d6; - constexpr Q_DECL_UNUSED const QRgb PaleGoldenrod = 0xffeee8aa; - constexpr Q_DECL_UNUSED const QRgb PaleGreen = 0xff98fb98; - constexpr Q_DECL_UNUSED const QRgb PaleTurquoise = 0xffafeeee; - constexpr Q_DECL_UNUSED const QRgb PaleVioletRed = 0xffdb7093; - constexpr Q_DECL_UNUSED const QRgb PapayaWhip = 0xffffefd5; - constexpr Q_DECL_UNUSED const QRgb PeachPuff = 0xffffdab9; - constexpr Q_DECL_UNUSED const QRgb Peru = 0xffcd853f; - constexpr Q_DECL_UNUSED const QRgb Pink = 0xffffc0cb; - constexpr Q_DECL_UNUSED const QRgb Plum = 0xffdda0dd; - constexpr Q_DECL_UNUSED const QRgb PowderBlue = 0xffb0e0e6; - constexpr Q_DECL_UNUSED const QRgb Purple = 0xff800080; - constexpr Q_DECL_UNUSED const QRgb Red = 0xffff0000; - constexpr Q_DECL_UNUSED const QRgb RosyBrown = 0xffbc8f8f; - constexpr Q_DECL_UNUSED const QRgb RoyalBlue = 0xff4169e1; - constexpr Q_DECL_UNUSED const QRgb SaddleBrown = 0xff8b4513; - constexpr Q_DECL_UNUSED const QRgb Salmon = 0xfffa8072; - constexpr Q_DECL_UNUSED const QRgb SandyBrown = 0xfff4a460; - constexpr Q_DECL_UNUSED const QRgb SeaGreen = 0xff2e8b57; - constexpr Q_DECL_UNUSED const QRgb Seashell = 0xfffff5ee; - constexpr Q_DECL_UNUSED const QRgb Sienna = 0xffa0522d; - constexpr Q_DECL_UNUSED const QRgb Silver = 0xffc0c0c0; - constexpr Q_DECL_UNUSED const QRgb SkyBlue = 0xff87ceeb; - constexpr Q_DECL_UNUSED const QRgb SlateBlue = 0xff6a5acd; - constexpr Q_DECL_UNUSED const QRgb SlateGrey = 0xff708090; - constexpr Q_DECL_UNUSED const QRgb Snow = 0xfffffafa; - constexpr Q_DECL_UNUSED const QRgb SpringGreen = 0xff00ff7f; - constexpr Q_DECL_UNUSED const QRgb SteelBlue = 0xff4682b4; - constexpr Q_DECL_UNUSED const QRgb Tan = 0xffd2b48c; - constexpr Q_DECL_UNUSED const QRgb Teal = 0xff008080; - constexpr Q_DECL_UNUSED const QRgb Thistle = 0xffd8bfd8; - constexpr Q_DECL_UNUSED const QRgb Tomato = 0xffff6347; - constexpr Q_DECL_UNUSED const QRgb Turquoise = 0xff40e0d0; - constexpr Q_DECL_UNUSED const QRgb Violet = 0xffee82ee; - constexpr Q_DECL_UNUSED const QRgb Wheat = 0xfff5deb3; - constexpr Q_DECL_UNUSED const QRgb WhiteSmoke = 0xfff5f5f5; - constexpr Q_DECL_UNUSED const QRgb Yellow = 0xffffff00; - constexpr Q_DECL_UNUSED const QRgb YellowGreen = 0xff9acd32; - constexpr Q_DECL_UNUSED const QRgb White = 0xffffffff; + constexpr const QRgb AliceBlue = 0xfff0f8ff; + constexpr const QRgb AntiqueWhite = 0xfffaebd7; + constexpr const QRgb Aqua = 0xff00ffff; + constexpr const QRgb Aquamarine = 0xff7fffd4; + constexpr const QRgb Azure = 0xfff0ffff; + constexpr const QRgb Beige = 0xfff5f5dc; + constexpr const QRgb Bisque = 0xffffe4c4; + constexpr const QRgb Black = 0xff000000; + constexpr const QRgb BlanchedAlmond = 0xffffebcd; + constexpr const QRgb Blue = 0xff0000ff; + constexpr const QRgb BlueViolet = 0xff8a2be2; + constexpr const QRgb Brown = 0xffa52a2a; + constexpr const QRgb Burlywood = 0xffdeb887; + constexpr const QRgb CadetBlue = 0xff5f9ea0; + constexpr const QRgb Chartreuse = 0xff7fff00; + constexpr const QRgb Chocolate = 0xffd2691e; + constexpr const QRgb Coral = 0xffff7f50; + constexpr const QRgb CornflowerBlue = 0xff6495ed; + constexpr const QRgb Cornsilk = 0xfffff8dc; + constexpr const QRgb Crimson = 0xffdc143c; + constexpr const QRgb Cyan = 0xff00ffff; + constexpr const QRgb DarkBlue = 0xff00008b; + constexpr const QRgb DarkCyan = 0xff008b8b; + constexpr const QRgb DarkGoldenrod = 0xffb8860b; + constexpr const QRgb DarkGray = 0xffa9a9a9; + constexpr const QRgb DarkGreen = 0xff006400; + constexpr const QRgb DarkGrey = 0xffa9a9a9; + constexpr const QRgb DarkKhaki = 0xffbdb76b; + constexpr const QRgb DarkMagenta = 0xff8b008b; + constexpr const QRgb DarkOliveGreen = 0xff556b2f; + constexpr const QRgb DarkOrange = 0xffff8c00; + constexpr const QRgb DarkOrchid = 0xff9932cc; + constexpr const QRgb DarkRed = 0xff8b0000; + constexpr const QRgb DarkSalmon = 0xffe9967a; + constexpr const QRgb DarkSeaGreen = 0xff8fbc8f; + constexpr const QRgb DarkSlateBlue = 0xff483d8b; + constexpr const QRgb DarkSlateGray = 0xff2f4f4f; + constexpr const QRgb DarkSlateGrey = 0xff2f4f4f; + constexpr const QRgb DarkTurquoise = 0xff00ced1; + constexpr const QRgb DarkViolet = 0xff9400d3; + constexpr const QRgb DeepPink = 0xffff1493; + constexpr const QRgb DeepSkyBlue = 0xff00bfff; + constexpr const QRgb DimGray = 0xff696969; + constexpr const QRgb DimGrey = 0xff696969; + constexpr const QRgb DodgerBlue = 0xff1e90ff; + constexpr const QRgb FireBrick = 0xffb22222; + constexpr const QRgb FloralWhite = 0xfffffaf0; + constexpr const QRgb ForestGreen = 0xff228b22; + constexpr const QRgb Fuchsia = 0xffff00ff; + constexpr const QRgb Gainsboro = 0xffdcdcdc; + constexpr const QRgb GhostWhite = 0xfff8f8ff; + constexpr const QRgb Gold = 0xffffd700; + constexpr const QRgb Goldenrod = 0xffdaa520; + constexpr const QRgb Gray = 0xff808080; + constexpr const QRgb Green = 0xff008000; + constexpr const QRgb GreenYellow = 0xffadff2f; + constexpr const QRgb Grey = 0xff808080; + constexpr const QRgb Honeydew = 0xfff0fff0; + constexpr const QRgb HotPink = 0xffff69b4; + constexpr const QRgb IndianRed = 0xffcd5c5c; + constexpr const QRgb Indigo = 0xff4b0082; + constexpr const QRgb Ivory = 0xfffffff0; + constexpr const QRgb Khaki = 0xfff0e68c; + constexpr const QRgb Lavender = 0xffe6e6fa; + constexpr const QRgb LavenderBlush = 0xfffff0f5; + constexpr const QRgb LawnGreen = 0xff7cfc00; + constexpr const QRgb LemonChiffon = 0xfffffacd; + constexpr const QRgb LightBlue = 0xffadd8e6; + constexpr const QRgb LightCoral = 0xfff08080; + constexpr const QRgb LightCyan = 0xffe0ffff; + constexpr const QRgb LightGoldenrodYellow = 0xfffafad2; + constexpr const QRgb LightGray = 0xffd3d3d3; + constexpr const QRgb LightGreen = 0xff90ee90; + constexpr const QRgb LightGrey = 0xffd3d3d3; + constexpr const QRgb LightPink = 0xffffb6c1; + constexpr const QRgb LightSalmon = 0xffffa07a; + constexpr const QRgb LightSeaGreen = 0xff20b2aa; + constexpr const QRgb LightSkyBlue = 0xff87cefa; + constexpr const QRgb LightSlateGray = 0xff778899; + constexpr const QRgb LightSlateGrey = 0xff778899; + constexpr const QRgb LightSteelBlue = 0xffb0c4de; + constexpr const QRgb LightYellow = 0xffffffe0; + constexpr const QRgb Lime = 0xff00ff00; + constexpr const QRgb Limegreen = 0xff32cd32; + constexpr const QRgb Linen = 0xfffaf0e6; + constexpr const QRgb Magenta = 0xffff00ff; + constexpr const QRgb Maroon = 0xff800000; + constexpr const QRgb MediumAquamarine = 0xff66cdaa; + constexpr const QRgb MediumBlue = 0xff0000cd; + constexpr const QRgb MediumOrchid = 0xffba55d3; + constexpr const QRgb MediumPurple = 0xff9370db; + constexpr const QRgb MediumSeaGreen = 0xff3cb371; + constexpr const QRgb MediumSlateBlue = 0xff7b68ee; + constexpr const QRgb MediumSpringGreen = 0xff00fa9a; + constexpr const QRgb MediumTurquoise = 0xff48d1cc; + constexpr const QRgb MediumVioletRed = 0xffc71585; + constexpr const QRgb MidnightBlue = 0xff191970; + constexpr const QRgb MintCream = 0xfff5fffa; + constexpr const QRgb MistyRose = 0xffffe4e1; + constexpr const QRgb Moccasin = 0xffffe4b5; + constexpr const QRgb NavajoWhite = 0xffffdead; + constexpr const QRgb Navy = 0xff000080; + constexpr const QRgb OldLace = 0xfffdf5e6; + constexpr const QRgb Olive = 0xff808000; + constexpr const QRgb OliveDrab = 0xff6b8e23; + constexpr const QRgb Orange = 0xffffa500; + constexpr const QRgb OrangeRed = 0xffff4500; + constexpr const QRgb Orchid = 0xffda70d6; + constexpr const QRgb PaleGoldenrod = 0xffeee8aa; + constexpr const QRgb PaleGreen = 0xff98fb98; + constexpr const QRgb PaleTurquoise = 0xffafeeee; + constexpr const QRgb PaleVioletRed = 0xffdb7093; + constexpr const QRgb PapayaWhip = 0xffffefd5; + constexpr const QRgb PeachPuff = 0xffffdab9; + constexpr const QRgb Peru = 0xffcd853f; + constexpr const QRgb Pink = 0xffffc0cb; + constexpr const QRgb Plum = 0xffdda0dd; + constexpr const QRgb PowderBlue = 0xffb0e0e6; + constexpr const QRgb Purple = 0xff800080; + constexpr const QRgb Red = 0xffff0000; + constexpr const QRgb RosyBrown = 0xffbc8f8f; + constexpr const QRgb RoyalBlue = 0xff4169e1; + constexpr const QRgb SaddleBrown = 0xff8b4513; + constexpr const QRgb Salmon = 0xfffa8072; + constexpr const QRgb SandyBrown = 0xfff4a460; + constexpr const QRgb SeaGreen = 0xff2e8b57; + constexpr const QRgb Seashell = 0xfffff5ee; + constexpr const QRgb Sienna = 0xffa0522d; + constexpr const QRgb Silver = 0xffc0c0c0; + constexpr const QRgb SkyBlue = 0xff87ceeb; + constexpr const QRgb SlateBlue = 0xff6a5acd; + constexpr const QRgb SlateGrey = 0xff708090; + constexpr const QRgb Snow = 0xfffffafa; + constexpr const QRgb SpringGreen = 0xff00ff7f; + constexpr const QRgb SteelBlue = 0xff4682b4; + constexpr const QRgb Tan = 0xffd2b48c; + constexpr const QRgb Teal = 0xff008080; + constexpr const QRgb Thistle = 0xffd8bfd8; + constexpr const QRgb Tomato = 0xffff6347; + constexpr const QRgb Turquoise = 0xff40e0d0; + constexpr const QRgb Violet = 0xffee82ee; + constexpr const QRgb Wheat = 0xfff5deb3; + constexpr const QRgb WhiteSmoke = 0xfff5f5f5; + constexpr const QRgb Yellow = 0xffffff00; + constexpr const QRgb YellowGreen = 0xff9acd32; + constexpr const QRgb White = 0xffffffff; // others - constexpr Q_DECL_UNUSED const QRgb Transparent = 0x00000000; - constexpr Q_DECL_UNUSED const QRgb AlphaMask = 0xff000000; - constexpr Q_DECL_UNUSED const QRgb ColorMask = 0x00ffffff; + constexpr const QRgb Transparent = 0x00000000; + constexpr const QRgb AlphaMask = 0xff000000; + constexpr const QRgb ColorMask = 0x00ffffff; } namespace QskRgb