1 /* |
1 /* |
2 * LDForge: LDraw parts authoring CAD |
2 * LDForge: LDraw parts authoring CAD |
3 * Copyright (C) 2013 Santeri Piippo |
3 * Copyright (C) 2013, 2014 Santeri Piippo |
4 * |
4 * |
5 * This program is free software: you can redistribute it and/or modify |
5 * This program is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License as published by |
6 * it under the terms of the GNU General Public License as published by |
7 * the Free Software Foundation, either version 3 of the License, or |
7 * the Free Software Foundation, either version 3 of the License, or |
8 * (at your option) any later version. |
8 * (at your option) any later version. |
18 |
18 |
19 #ifndef LDFORGE_COLORS_H |
19 #ifndef LDFORGE_COLORS_H |
20 #define LDFORGE_COLORS_H |
20 #define LDFORGE_COLORS_H |
21 |
21 |
22 #include <QColor> |
22 #include <QColor> |
23 #include "common.h" |
23 #include "main.h" |
24 |
24 |
25 #define MAX_COLORS 512 |
25 #define MAX_COLORS 512 |
26 |
26 |
27 class LDColor |
27 class LDColor |
28 { public: |
28 { |
29 str name, hexcode; |
29 public: |
|
30 QString name, hexcode; |
30 QColor faceColor, edgeColor; |
31 QColor faceColor, edgeColor; |
31 short index; |
32 int index; |
32 }; |
33 }; |
33 |
34 |
34 void initColors(); |
35 void initColors(); |
35 int luma (QColor& col); |
36 int luma (QColor& col); |
36 |
37 |
37 // Safely gets a color with the given number or null if no such color. |
38 // Safely gets a color with the given number or null if no such color. |
38 LDColor* getColor (short colnum); |
39 LDColor* getColor (int colnum); |
39 void setColor (short colnum, LDColor* col); |
40 void setColor (int colnum, LDColor* col); |
40 |
41 |
41 // Main and edge color identifiers |
42 // Main and edge color identifiers |
42 static const short maincolor = 16; |
43 static const int maincolor = 16; |
43 static const short edgecolor = 24; |
44 static const int edgecolor = 24; |
44 |
45 |
45 #endif // LDFORGE_COLORS_H |
46 #endif // LDFORGE_COLORS_H |