1 /****************************************************************************
2 **  Copyright (c) 2019, Adel Kara Slimane <adel.ks@zegrapher.com>
3 **
4 **  This file is part of ZeGrapher's source code.
5 **
6 **  ZeGrapher is free software: you may copy, redistribute and/or modify it
7 **  under the terms of the GNU General Public License as published by the
8 **  Free Software Foundation, either version 3 of the License, or (at your
9 **  option) any later version.
10 **
11 **  This file is distributed in the hope that it will be useful, but
12 **  WITHOUT ANY WARRANTY; without even the implied warranty of
13 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 **  General Public License for more details.
15 **
16 **  You should have received a copy of the GNU General Public License
17 **  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 **
19 ****************************************************************************/
20 
21 
22 
23 
24 #ifndef COLORSAVER_H
25 #define COLORSAVER_H
26 
27 #include <QtGui>
28 
29 class ColorSaver : public QObject
30 {
31     Q_OBJECT
32 
33 public:
34     ColorSaver(QColor firstANDlast = Qt::black);
35 
36     void setCurvesNum(double num);
37     QColor getColor(int index);
38 
39 public slots:
40     void setFristColor(QColor col);
41     void setLastColor(QColor col);
42 
43 signals:
44     void colorsChanged();
45 
46 protected:
47     void saveColors();
48 
49     double curvesNum;
50     QColor firstColor, lastColor;
51     QList<QColor> colorsList;
52 
53 };
54 
55 #endif // COLORSAVER_H
56