LibCarna Version 3.4.0
Loading...
Searching...
No Matches
Color.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2016 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 *
11 * Copyright (C) 2021 - 2025 Leonid Kostrykin
12 *
13 */
14
15#ifndef COLOR_H_6014714286
16#define COLOR_H_6014714286
17
18#include <LibCarna/LibCarna.hpp>
21
27namespace LibCarna
28{
29
30namespace base
31{
32
33
34
35// ----------------------------------------------------------------------------------
36// Color
37// ----------------------------------------------------------------------------------
38
44class LIBCARNA Color
45{
46
47public:
48
49 const static Color WHITE;
50 const static Color WHITE_NO_ALPHA;
51 const static Color BLACK;
52 const static Color BLACK_NO_ALPHA;
53 const static Color RED;
54 const static Color RED_NO_ALPHA;
55 const static Color GREEN;
56 const static Color GREEN_NO_ALPHA;
57 const static Color BLUE;
58 const static Color BLUE_NO_ALPHA;
59
65
69 Color( unsigned char r, unsigned char g, unsigned char b, unsigned char a );
70
75
76 unsigned char r;
77 unsigned char g;
78 unsigned char b;
79 unsigned char a;
80
85 operator math::Vector4f() const;
86
90 bool operator==( const Color& other ) const;
91
95 bool operator<( const Color& other ) const;
96
101
102}; // Color
103
104
105
106} // namespace LibCarna :: base
107
108} // namespace LibCarna
109
110#endif // COLOR_H_6014714286
Contains forward-declarations.
Represents an association.
Represents a color. Objects from this class are copyable and assignable.
Definition Color.hpp:45
Color()
Instantiates with BLACK_NO_ALPHA.
static const Color GREEN
Holds Color(0, 255, 0, 255).
Definition Color.hpp:55
static const Color BLUE_NO_ALPHA
Holds Color(0, 0, 255, 0).
Definition Color.hpp:58
Color(const math::Vector4f &)
Instantiates from floating point values, clamped to interval .
static const Color BLACK_NO_ALPHA
Holds Color(0, 0, 0, 0).
Definition Color.hpp:52
unsigned char r
Holds the red component.
Definition Color.hpp:76
Color & operator=(const Color &other)
Assigns values from other.
bool operator<(const Color &other) const
Compares to other.
static const Color RED
Holds Color(255, 0, 0, 255).
Definition Color.hpp:53
static const Color GREEN_NO_ALPHA
Holds Color(0, 255, 0, 0).
Definition Color.hpp:56
bool operator==(const Color &other) const
Compares to other.
unsigned char a
Holds the alpha component.
Definition Color.hpp:79
unsigned char b
Holds the blue component.
Definition Color.hpp:78
static const Color RED_NO_ALPHA
Holds Color(255, 0, 0, 0).
Definition Color.hpp:54
static const Color BLUE
Holds Color(0, 0, 255, 255).
Definition Color.hpp:57
static const Color WHITE
Holds Color(255, 255, 255, 255).
Definition Color.hpp:49
static const Color WHITE_NO_ALPHA
Holds Color(255, 255, 255, 0).
Definition Color.hpp:50
Color(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Instantiates.
unsigned char g
Holds the green component.
Definition Color.hpp:77
static const Color BLACK
Holds Color(0, 0, 0, 255).
Definition Color.hpp:51
Defines LibCarna::base::math namespace and LIBCARNA_FOR_VECTOR3UI.
Eigen::Matrix< float, 4, 1 > Vector4f
Defines vector.
Definition math.hpp:199
Defines LibCarna::base::noncopyable and NON_COPYABLE.