HEBI C++ API  1.0.0-rc1
color.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstdint>
4 
5 namespace hebi {
6 
8 struct Color {
9  public:
13  Color(uint8_t r, uint8_t g, uint8_t b) : r_(r), g_(g), b_(b) {}
14 
16  uint8_t getRed() const { return r_; }
18  uint8_t getGreen() const { return g_; }
20  uint8_t getBlue() const { return b_; }
21 
22  private:
23  uint8_t r_;
24  uint8_t g_;
25  uint8_t b_;
26 
27 };
28 
29 #ifndef DOXYGEN_OMIT_INTERNAL
30 typedef Color Color;
32 #endif // DOXYGEN_OMIT_INTERNAL
33 
34 } // namespace hebi
uint8_t getRed() const
Returns the red channel; value is between 0 and 255.
Definition: color.hpp:16
Definition: color.hpp:5
uint8_t getBlue() const
Returns the blue channel; value is between 0 and 255.
Definition: color.hpp:20
uint8_t getGreen() const
Returns the green channel; value is between 0 and 255.
Definition: color.hpp:18
Structure to describe an RGB color.
Definition: color.hpp:8
Color(uint8_t r, uint8_t g, uint8_t b)
Creates a color from the given red, green, and blue channel values.
Definition: color.hpp:13