2019-06-20 12:02:28 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
|
|
|
* This file may be used under the terms of the 3-clause BSD License
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2017-12-07 14:56:12 +01:00
|
|
|
#ifndef PALETTE_H
|
|
|
|
#define PALETTE_H 1
|
2017-10-17 17:29:02 +02:00
|
|
|
|
|
|
|
#include <QColor>
|
|
|
|
#include <QVector>
|
|
|
|
|
|
|
|
class Palette
|
|
|
|
{
|
2018-08-03 08:15:28 +02:00
|
|
|
public:
|
2017-10-17 17:29:02 +02:00
|
|
|
enum Weight
|
|
|
|
{
|
|
|
|
W50,
|
|
|
|
W100,
|
|
|
|
W200,
|
|
|
|
W300,
|
|
|
|
W400,
|
|
|
|
W500,
|
|
|
|
W600,
|
|
|
|
W700,
|
|
|
|
W800,
|
|
|
|
W900,
|
|
|
|
|
|
|
|
NumWeights
|
|
|
|
};
|
|
|
|
|
|
|
|
enum Color
|
|
|
|
{
|
|
|
|
Red,
|
|
|
|
Pink,
|
|
|
|
Purple,
|
|
|
|
DeepPurple,
|
|
|
|
Indigo,
|
|
|
|
Blue,
|
|
|
|
LightBlue,
|
|
|
|
Cyan,
|
|
|
|
Teal,
|
|
|
|
Green,
|
|
|
|
LightGreen,
|
|
|
|
Lime,
|
|
|
|
Yellow,
|
|
|
|
Amber,
|
|
|
|
Orange,
|
|
|
|
DeepOrange,
|
|
|
|
Brown,
|
|
|
|
Grey,
|
|
|
|
BlueGrey,
|
|
|
|
|
|
|
|
NumColors
|
|
|
|
};
|
|
|
|
|
|
|
|
QRgb rgb( Weight weight ) const
|
|
|
|
{
|
|
|
|
return m_rgb[ weight ];
|
|
|
|
}
|
|
|
|
|
|
|
|
inline QColor color( Weight weight ) const
|
|
|
|
{
|
|
|
|
return QColor::fromRgba( rgb( weight ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
static Palette palette( Color );
|
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
protected:
|
2017-10-17 17:29:02 +02:00
|
|
|
QRgb* m_rgb;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|