Go to the documentation of this file.
31 template <
typename T>
const T&
41 return static_cast<uint32_t
>(r) << 16 |
42 static_cast<uint32_t
>(g) << 8 |
43 static_cast<uint32_t
>(b);
54 static_cast<uint8_t
>(round(
clamp(g, 0.0f, 1.0f) * 255)),
55 static_cast<uint8_t
>(round(
clamp(b, 0.0f, 1.0f) * 255)));
62 rgb[0] = (color >> 16) & 0xFF;
63 rgb[1] = (color >> 8) & 0xFF;
64 rgb[2] = (color >> 0) & 0xFF;
71 uint8_t r =
static_cast<uint8_t
>((rand() % 256));
72 uint8_t g =
static_cast<uint8_t
>((rand() % 256));
73 uint8_t b =
static_cast<uint8_t
>((rand() % 256));
91 float four_value =
v * 4;
92 float r =
std::min(four_value - 1.5, -four_value + 4.5);
93 float g =
std::min(four_value - 0.5, -four_value + 3.5);
94 float b =
std::min(four_value + 0.5, -four_value + 2.5);
@ AUTUMN
Varies smoothly from red, through orange, to yellow.
@ COOL
Consists of colors that are shades of cyan and magenta.
Value
Color maps that associate a color to every float from [0..1].
@ SUMMER
Consists of colors that are shades of green and yellow.
const T & clamp(const T &value, const T &low, const T &high)
uint32_t Color
RGBA color.
std::shared_ptr< Value > value()
Color generateRandomColor()
Generate a random color.
Color getColorFromRGB(uint8_t r, uint8_t g, uint8_t b)
Get a color from R, G, and B values (chars).
void getRGBFromColor(Color color, uint8_t *rgb)
Get R, G, and B values (chars) as array from a color.
@ JET
Ranges from blue to red, and passes through the colors cyan, yellow, and orange.
double v(double t, double v0, double a0, double j)
This file was automatically created with "create_c++_header.sh".
Color getColor(float value, ColorMap::Value colormap=ColorMap::JET)
Get the color for a given number in [0..1] using a given colormap.