-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolor.h
More file actions
41 lines (32 loc) · 807 Bytes
/
color.h
File metadata and controls
41 lines (32 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef COLOR_H
#define COLOR_H
#include <QObject>
#include "QColor"
#include "types.h"
#include <iostream>
using namespace std;
class Color
{
public:
Color() {}
Color(const int r, const int g, const int b);
void set_rgb(rgb_t &other);
void set_rgb(int r, int g, int b);
const rgb_t get_rgb() const { return rgb; }
Color operator* (int k);
Color operator* (double num);
Color operator+ (const Color &other);
Color operator*= (int k);
Color operator+= (const Color &other);
bool operator== (const Color &other) const;
private:
rgb_t rgb;
};
class Painter_color : public QColor
{
public:
Painter_color() : QColor() {}
Painter_color(Color &color) :
QColor(color.get_rgb().r, color.get_rgb().g, color.get_rgb().b) {}
};
#endif // COLOR_H