8#include <framework/utilities/ColorPalette.h>
18 const char*
getHex(
const std::string& tangoName,
int tangoId)
20 using ColorTuple = std::array<const char*, 3>;
21 static std::map<std::string, ColorTuple> tango;
23 tango[
"Aluminium"] = ColorTuple({
"#eeeeec",
"#d3d7cf",
"#babdb6"});
24 tango[
"Butter"] = ColorTuple({
"#fce94f",
"#edd400",
"#c4a000"});
25 tango[
"Chameleon"] = ColorTuple({
"#8ae234",
"#73d216",
"#4e9a06"});
26 tango[
"Orange"] = ColorTuple({
"#fcaf3e",
"#f57900",
"#ce5c00"});
27 tango[
"Chocolate"] = ColorTuple({
"#e9b96e",
"#c17d11",
"#8f5902"});
28 tango[
"Sky Blue"] = ColorTuple({
"#729fcf",
"#3465a4",
"#204a87"});
29 tango[
"Plum"] = ColorTuple({
"#ad7fa8",
"#75507b",
"#5c3566"});
30 tango[
"Slate"] = ColorTuple({
"#888a85",
"#555753",
"#2e3436"});
31 tango[
"Scarlet Red"] = ColorTuple({
"#ef2929",
"#cc0000",
"#a40000"});
34 if (tangoId < 1 or tangoId > 3)
35 throw std::runtime_error(
"tangoId must be 1, 2, or 3!");
36 return tango.at(tangoName)[tangoId - 1];
41 return TColor::GetColor(
getHex(tangoName, tangoId));
Implements a colour palette, see http://sobac.com/sobac/tangocolors.htm.
const char * getHex(const std::string &tangoName, int tangoId=1)
Get six-digit hex code (#abcdef) for given name in tango colour palette.
int getTColorID(const std::string &tangoName, int tangoId=1)
Get TColor ID for given name in tango colour palette.