Kage Studio 0.7.230612
A Simple Free and Open Source 2D Animation Software
Loading...
Searching...
No Matches
color.h
Go to the documentation of this file.
1/*
2 * Kage Studio - a simple free and open source vector-based 2D animation software
3 * Copyright (C) 2011~2022 Mj Mendoza IV
4 *
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
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA. Or, see <https://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef GTKMM_KAGE_DATA_COLOR_H
23 #define GTKMM_KAGE_DATA_COLOR_H
24
25 #include <string>
26 #include <sstream>
27
28 class ColorData {
29 public:
30 ColorData();
31 ColorData(unsigned int p_r, unsigned int p_g, unsigned int p_b);
32 ColorData(unsigned int p_r, unsigned int p_g, unsigned int p_b, unsigned int p_a);
33 virtual ~ColorData();
34
35 void setR(unsigned int p_r);
36 void setG(unsigned int p_g);
37 void setB(unsigned int p_b);
38 void setA(unsigned int p_a);
39 unsigned int getR() const;
40 unsigned int getG() const;
41 unsigned int getB() const;
42 unsigned int getA() const;
44 std::string toString();
45 void copy(ColorData p_color);
46 bool equalTo(ColorData p_color);
47 protected:
48 unsigned int R;
49 unsigned int G;
50 unsigned int B;
51 unsigned int A;
52 };
53#endif //GTKMM_KAGE_DATA_COLOR_H
Definition: color.h:28
unsigned int getG() const
Definition: color.cpp:98
ColorData clone()
Definition: color.cpp:49
bool equalTo(ColorData p_color)
Definition: color.cpp:54
virtual ~ColorData()
Definition: color.cpp:45
unsigned int A
Definition: color.h:51
void setG(unsigned int p_g)
Definition: color.cpp:79
unsigned int getA() const
Definition: color.cpp:106
void setB(unsigned int p_b)
Definition: color.cpp:84
void copy(ColorData p_color)
Definition: color.cpp:61
unsigned int G
Definition: color.h:49
void setR(unsigned int p_r)
Definition: color.cpp:74
std::string toString()
Definition: color.cpp:68
unsigned int R
Definition: color.h:48
unsigned int B
Definition: color.h:50
ColorData()
Definition: color.cpp:24
unsigned int getB() const
Definition: color.cpp:102
void setA(unsigned int p_a)
Definition: color.cpp:89
unsigned int getR() const
Definition: color.cpp:94