26 return Color{{r, g, b, a}};
31 return createColor(
static_cast<unsigned char>((rand() % 5) * 50),
32 static_cast<unsigned char>((rand() % 5) * 50),
33 static_cast<unsigned char>((rand() % 5) * 50));
36Color getColor(
const std::string&
id, std::map<std::string, Color>& colors)
38 auto it = colors.find(
id);
40 if (it == end(colors))
42 WARN(
"Key '{:s}' not found in color lookup table.",
id);
Definition of the Color class.
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Color getRandomColor()
Returns a random RGB colour.
Color createColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Color getColor(const std::string &id, std::map< std::string, Color > &colors)
std::array< unsigned char, 4 > Color