Uwe Rathmann 6479937294 All box subcontrols are displayd with vertex lists instead of textures
now. Implementation is almost complete beside of the not yet done Qt
antialiasing mode. Not all sort of linear gradients ( see
QLinearGradients ) are implemented - needs 1-2 days more.
The aspect flags for box primitives have been substantially changed from
too atomic to more strutured units.
The skins are currently incomplete - will be fixed later.
2017-10-17 17:29:02 +02:00

55 lines
1.4 KiB
C++

#include "Palette.h"
#include <QskRgbValue.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 StandardPalette : public Palette
{
public:
StandardPalette( int index )
{
using namespace QskRgbValue;
static 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 ) ];
}
};
}
Palette Palette::palette( Color color )
{
return StandardPalette( static_cast< int >( color ) );
}