Carna Version 3.3.3
Loading...
Searching...
No Matches
Color.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2015 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 */
11
12#ifndef COLOR_H_6014714286
13#define COLOR_H_6014714286
14
15#include <Carna/Carna.h>
17#include <Carna/base/math.h>
18
23namespace Carna
24{
25
26namespace base
27{
28
29
30
31// ----------------------------------------------------------------------------------
32// Color
33// ----------------------------------------------------------------------------------
34
41class CARNA_LIB Color
42{
43
44public:
45
46 const static Color WHITE;
47 const static Color WHITE_NO_ALPHA;
48 const static Color BLACK;
49 const static Color BLACK_NO_ALPHA;
50 const static Color RED;
51 const static Color RED_NO_ALPHA;
52 const static Color GREEN;
53 const static Color GREEN_NO_ALPHA;
54 const static Color BLUE;
55 const static Color BLUE_NO_ALPHA;
56
62
66 Color( unsigned char r, unsigned char g, unsigned char b, unsigned char a );
67
72
73 unsigned char r;
74 unsigned char g;
75 unsigned char b;
76 unsigned char a;
77
82 operator math::Vector4f() const;
83
87 bool operator==( const Color& other ) const;
88
92 bool operator<( const Color& other ) const;
93
98
99}; // Color
100
101
102
103} // namespace Carna :: base
104
105} // namespace Carna
106
107#endif // COLOR_H_6014714286
Represents an association.
Definition Association.h:45
Represents a color. Objects from this class are copyable and assignable.
Definition Color.h:42
Color(const math::Vector4f &)
Instantiates from floating point values, clamped to interval .
static const Color GREEN_NO_ALPHA
Holds Color(0, 255, 0, 0).
Definition Color.h:53
static const Color BLUE_NO_ALPHA
Holds Color(0, 0, 255, 0).
Definition Color.h:55
static const Color RED_NO_ALPHA
Holds Color(255, 0, 0, 0).
Definition Color.h:51
Color & operator=(const Color &other)
Assigns values from other.
static const Color GREEN
Holds Color(0, 255, 0, 255).
Definition Color.h:52
unsigned char g
Holds the green component.
Definition Color.h:74
static const Color BLACK_NO_ALPHA
Holds Color(0, 0, 0, 0).
Definition Color.h:49
bool operator<(const Color &other) const
Compares to other.
Color()
Instantiates with BLACK_NO_ALPHA.
static const Color WHITE_NO_ALPHA
Holds Color(255, 255, 255, 0).
Definition Color.h:47
bool operator==(const Color &other) const
Compares to other.
unsigned char r
Holds the red component.
Definition Color.h:73
Color(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Instantiates.
unsigned char b
Holds the blue component.
Definition Color.h:75
unsigned char a
Holds the alpha component.
Definition Color.h:76
static const Color WHITE
Holds Color(255, 255, 255, 255).
Definition Color.h:46
static const Color BLUE
Holds Color(0, 0, 255, 255).
Definition Color.h:54
static const Color BLACK
Holds Color(0, 0, 0, 255).
Definition Color.h:48
static const Color RED
Holds Color(255, 0, 0, 255).
Definition Color.h:50
Defines Carna::base::math namespace and CARNA_FOR_VECTOR3UI.
Eigen::Matrix< float, 4, 1 > Vector4f
Defines vector.
Definition math.h:195