Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CGUIColor.h
Go to the documentation of this file.
1/* Copyright (C) 2025 Wildfire Games.
2 * This file is part of 0 A.D.
3 *
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef INCLUDED_GUICOLOR
19#define INCLUDED_GUICOLOR
20
21#include "graphics/Color.h"
22#include "lib/code_annotation.h"
23
24class CGUI;
25class CStr8;
26
27/**
28 * Same as the CColor class, but this one can also parse colors predefined in the GUI page (such as "yellow").
29 */
31{
32 // Take advantage of compiler warnings if unintentionally copying this
34
35 // Defines move semantics so that the structs using the class can use it.
37
39
40 CGUIColor(float r, float g, float b, float a) : CColor(r, g, b, a) {}
41
42 /**
43 * Load color depending on current GUI page.
44 */
45 bool ParseString(const CGUI& pGUI, const CStr8& value, int defaultAlpha = 255);
46
47 /**
48 * Ensure that all users check for predefined colors.
49 */
50 bool ParseString(const CStr8& value, int defaultAlpha = 255) = delete;
51};
52#endif // INCLUDED_GUICOLOR
The main object that represents a whole GUI page.
Definition: CGUI.h:80
Definition: Color.h:46
float g
Definition: Color.h:98
float a
Definition: Color.h:98
float b
Definition: Color.h:98
float r
Definition: Color.h:98
Same as the CColor class, but this one can also parse colors predefined in the GUI page (such as "yel...
Definition: CGUIColor.h:31
CGUIColor(float r, float g, float b, float a)
Definition: CGUIColor.h:40
CGUIColor()
Definition: CGUIColor.h:38
NONCOPYABLE(CGUIColor)
bool ParseString(const CGUI &pGUI, const CStr8 &value, int defaultAlpha=255)
Load color depending on current GUI page.
bool ParseString(const CStr8 &value, int defaultAlpha=255)=delete
Ensure that all users check for predefined colors.
MOVABLE(CGUIColor)