FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
color.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
* Copyright (C) 2005-2019 by the FIFE team *
3
* http://www.fifengine.net *
4
* This file is part of FIFE. *
5
* *
6
* FIFE is free software; you can redistribute it and/or *
7
* modify it under the terms of the GNU Lesser General Public *
8
* License as published by the Free Software Foundation; either *
9
* version 2.1 of the License, or (at your option) any later version. *
10
* *
11
* This library is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14
* Lesser General Public License for more details. *
15
* *
16
* You should have received a copy of the GNU Lesser General Public *
17
* License along with this library; if not, write to the *
18
* Free Software Foundation, Inc., *
19
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20
***************************************************************************/
21
22
23
// Standard C++ library includes
24
25
// Platform specific includes
26
#include "
util/base/fife_stdint.h
"
27
28
// 3rd party library includes
29
30
// FIFE includes
31
// These includes are split up in two parts, separated by one empty line
32
// First block: files included from the FIFE root src directory
33
// Second block: files included from the same folder
34
35
#include "
color.h
"
36
37
namespace
FIFE
{
38
Color::Color
(
uint8_t
r,
uint8_t
g,
uint8_t
b,
uint8_t
alpha)
39
:
40
m_r(r),
41
m_g(g),
42
m_b(b),
43
m_a(alpha) {
44
}
45
46
Color::~Color
() {
47
}
48
49
void
Color::set
(
uint8_t
r,
uint8_t
g,
uint8_t
b,
uint8_t
alpha) {
50
m_r
= r;
51
m_g
= g;
52
m_b
= b;
53
m_a
= alpha;
54
}
55
56
void
Color::setR
(
uint8_t
r) {
57
m_r
= r;
58
}
59
60
void
Color::setG
(
uint8_t
g) {
61
m_g
= g;
62
}
63
64
void
Color::setB
(
uint8_t
b) {
65
m_b
= b;
66
}
67
68
void
Color::setAlpha
(
uint8_t
alpha) {
69
m_a
= alpha;
70
}
71
72
uint8_t
Color::getR
()
const
{
73
return
m_r
;
74
}
75
76
uint8_t
Color::getG
()
const
{
77
return
m_g
;
78
}
79
80
uint8_t
Color::getB
()
const
{
81
return
m_b
;
82
}
83
84
uint8_t
Color::getAlpha
()
const
{
85
return
m_a
;
86
}
87
}
FIFE::Color::setG
void setG(uint8_t g)
Set green channel value.
Definition:
color.cpp:60
FIFE::Color::setB
void setB(uint8_t b)
Set blue channel value.
Definition:
color.cpp:64
FIFE::Color::getB
uint8_t getB() const
Definition:
color.cpp:80
FIFE::Color::setAlpha
void setAlpha(uint8_t alpha)
Set alpha channel value.
Definition:
color.cpp:68
FIFE::Color::~Color
~Color()
Destructor.
Definition:
color.cpp:46
FIFE::Color::getAlpha
uint8_t getAlpha() const
Definition:
color.cpp:84
FIFE::Color::set
void set(uint8_t r, uint8_t g, uint8_t b, uint8_t alpha)
Set all color channel values.
Definition:
color.cpp:49
utf8::uint8_t
unsigned char uint8_t
Definition:
core.h:38
fife_stdint.h
color.h
FIFE::Color::m_g
uint8_t m_g
Definition:
color.h:133
FIFE::Color::Color
Color(uint8_t r=0, uint8_t g=0, uint8_t b=0, uint8_t alpha=255)
Constructor.
Definition:
color.cpp:38
FIFE::Color::setR
void setR(uint8_t r)
Set red channel value.
Definition:
color.cpp:56
FIFE::Color::m_b
uint8_t m_b
Definition:
color.h:134
FIFE::Color::getG
uint8_t getG() const
Definition:
color.cpp:76
FIFE::Color::getR
uint8_t getR() const
Definition:
color.cpp:72
FIFE::Color::m_a
uint8_t m_a
Definition:
color.h:135
FIFE
Definition:
actionaudio.cpp:37
FIFE::Color::m_r
uint8_t m_r
Definition:
color.h:132
engine
core
video
color.cpp
Generated on Sun Feb 5 2023 01:00:06 for FIFE by
1.8.13