#include <cmath>
#include <cstdlib>
Go to the source code of this file.
|  | 
| template<typename T > | 
| const T & | clamp (const T &value, const T &low, const T &high) | 
|  | 
| Color | generateRandomColor () | 
|  | Generate a random color.  More... 
 | 
|  | 
| Color | getColor (float value, ColorMap::Value colormap=ColorMap::JET) | 
|  | Get the color for a given number in [0..1] using a given colormap.  More... 
 | 
|  | 
| Color | getColorFromRGB (float r, float g, float b) | 
|  | Get a color from R, G, and B values (floats).  More... 
 | 
|  | 
| Color | getColorFromRGB (uint8_t r, uint8_t g, uint8_t b) | 
|  | Get a color from R, G, and B values (chars).  More... 
 | 
|  | 
| void | getRGBFromColor (Color color, uint8_t *rgb) | 
|  | Get R, G, and B values (chars) as array from a color.  More... 
 | 
|  | 
◆ Color
RGBA color. 
Definition at line 8 of file color.h.
 
 
◆ clamp()
      
        
          | const T& clamp | ( | const T & | value, | 
        
          |  |  | const T & | low, | 
        
          |  |  | const T & | high | 
        
          |  | ) |  |  | 
      
 
 
◆ generateRandomColor()
      
        
          | Color generateRandomColor | ( |  | ) |  | 
      
 
Generate a random color. 
Definition at line 69 of file color.h.
 
 
◆ getColor()
Get the color for a given number in [0..1] using a given colormap. 
Input values that are outside of the [0..1] region are clamped automatically.
- See also
- ColorMap 
Definition at line 84 of file color.h.
 
 
◆ getColorFromRGB() [1/2]
Get a color from R, G, and B values (floats). 
The input values are mapped from [0..1] to [0..255]. Input value that are outside of the [0..1] region are clamped automatically. 
Definition at line 51 of file color.h.
 
 
◆ getColorFromRGB() [2/2]
      
        
          | Color getColorFromRGB | ( | uint8_t | r, | 
        
          |  |  | uint8_t | g, | 
        
          |  |  | uint8_t | b | 
        
          |  | ) |  |  | 
      
 
Get a color from R, G, and B values (chars). 
Definition at line 40 of file color.h.
 
 
◆ getRGBFromColor()
      
        
          | void getRGBFromColor | ( | Color | color, | 
        
          |  |  | uint8_t * | rgb | 
        
          |  | ) |  |  | 
      
 
Get R, G, and B values (chars) as array from a color. 
Definition at line 60 of file color.h.