OpenMoHAA 0.82.1
Loading...
Searching...
No Matches
ucolor.h
1/*
2===========================================================================
3Copyright (C) 2024 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23#pragma once
24
25class UColor
26{
27public:
28 float r;
29 float g;
30 float b;
31 float a;
32
33 UColor();
34 UColor(float r, float g, float b, float a = 1.0);
35 UColor(class UColorHSV hsv);
36 UColor(const UColor& color);
37
38 operator float *();
39 operator float *() const;
40
41 void ScaleColor(float scale);
42 void ScaleAlpha(float scale);
43 void set(float r, float g, float b, float a);
44};
45
46class UColorHSV
47{
48public:
49 float h;
50 float s;
51 float v;
52 float a;
53
54 UColorHSV();
55 UColorHSV(UColor rgb);
56 UColorHSV(float h, float s, float v, float a);
57
58 void set(float h, float s, float v, float a);
59};
60
61typedef enum {
62 DARK,
63 REALLYDARK,
64 LIGHT,
65 NORMAL
66} colorType_t;
67
68class UBorderColor
69{
70public:
71 UColor dark;
72 UColor reallydark;
73 UColor light;
74 UColor original;
75
76 UBorderColor();
77 UBorderColor(const UColor& dark, const UColor& reallydark, const UColor& light);
78 UBorderColor(const UColor& color);
79
80 void CreateSolidBorder(const UColor& color, colorType_t type);
81};
82
83extern const UColor UClear;
84extern const UColor UWhite;
85extern const UColor UBlack;
86extern const UColor ULightGrey;
87extern const UColor UGrey;
88extern const UColor UDarkGrey;
89extern const UColor ULightRed;
90extern const UColor URed;
91extern const UColor UGreen;
92extern const UColor ULightGreen;
93extern const UColor UBlue;
94extern const UColor UYellow;
95extern const UColor UHudColor;
Definition ucolor.h:47
Definition ucolor.h:26