qskinny/examples/boxes/Palette.h
2017-10-20 07:42:53 +02:00

69 lines
914 B
C++

#ifndef _PALETTE_H_
#define _PALETTE_H_ 1
#include <QColor>
#include <QVector>
class Palette
{
public:
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 );
protected:
QRgb* m_rgb;
};
#endif