27 #include <KDABLibFakes>
29 using namespace KDChart;
33 static Palette makeDefaultPalette() {
52 static Palette makeSubduedPalette() {
55 p.
addBrush( QColor( 0xe0,0x7f,0x70 ) );
56 p.
addBrush( QColor( 0xe2,0xa5,0x6f ) );
57 p.
addBrush( QColor( 0xe0,0xc9,0x70 ) );
58 p.
addBrush( QColor( 0xd1,0xe0,0x70 ) );
59 p.
addBrush( QColor( 0xac,0xe0,0x70 ) );
60 p.
addBrush( QColor( 0x86,0xe0,0x70 ) );
61 p.
addBrush( QColor( 0x70,0xe0,0x7f ) );
62 p.
addBrush( QColor( 0x70,0xe0,0xa4 ) );
63 p.
addBrush( QColor( 0x70,0xe0,0xc9 ) );
64 p.
addBrush( QColor( 0x70,0xd1,0xe0 ) );
65 p.
addBrush( QColor( 0x70,0xac,0xe0 ) );
66 p.
addBrush( QColor( 0x70,0x86,0xe0 ) );
67 p.
addBrush( QColor( 0x7f,0x70,0xe0 ) );
68 p.
addBrush( QColor( 0xa4,0x70,0xe0 ) );
69 p.
addBrush( QColor( 0xc9,0x70,0xe0 ) );
70 p.
addBrush( QColor( 0xe0,0x70,0xd1 ) );
71 p.
addBrush( QColor( 0xe0,0x70,0xac ) );
72 p.
addBrush( QColor( 0xe0,0x70,0x86 ) );
77 static Palette makeRainbowPalette() {
88 for (
int i = 8 ; i < 16 ; ++i ) {
98 class Palette::Private
101 explicit Private() {}
109 static const Palette palette = makeDefaultPalette();
115 static const Palette palette = makeSubduedPalette();
121 static const Palette palette = makeRainbowPalette();
126 :
QObject( parent ), _d( new Private )
139 :
QObject(), _d( new Private( *r.
d ) )
154 return d->brushes.size() >= 1;
159 return d->brushes.size();
164 if ( position < 0 || position >=
size() ) {
165 d->brushes.append( brush );
167 d->brushes.insert( position, brush );
174 if ( !
isValid() )
return QBrush();
175 return d->brushes.at( position %
size() );
180 if ( position < 0 || position >=
size() )
return;
181 d->brushes.remove( position );