21 color(Float_t red, Float_t green, Float_t blue) :
r(red),
g(green),
b(blue)
27 color(Int_t hexvalue) :
r(((hexvalue >> 16) & 0xFF) / 255.0),
g(((hexvalue >> 8) & 0xFF) / 255.0),
b(((hexvalue) & 0xFF) / 255.0)
47 ColorGradient(Int_t nPoints,
const vector<color> &rgbEndpoints,
const vector<Double_t> &stops = {}, Float_t alpha = 1);
56 Int_t firstColorIndex {0};
57 Int_t nColorPoints {0};
62 ColorGradient::ColorGradient(Int_t nPoints,
const vector<color> &rgbEndpoints,
const vector<Double_t> &stops, Float_t alpha):
75 Int_t nColors = rgbEndpoints.size();
78 vector<Double_t> green;
79 vector<Double_t> blue;
80 vector<Double_t> length;
83 for(Int_t col = 0; col < nColors; col++){
84 length.push_back((Float_t)col/(nColors-1));
86 std::cout << std::endl;
88 else if (stops.size() != nColors){
89 std::cout <<
"\033[1;31mERROR:\033[0m Number of given stops does not match number of given colors!!" << std::endl;
92 else length = std::move(stops);
94 for (
const color& rgb : rgbEndpoints) {
97 green.push_back(rgb.g);
98 blue.push_back(rgb.b);
102 firstColorIndex = TColor::CreateGradientColorTable(nColors, length.data(), red.data(), green.data(), blue.data(), nPoints, alpha);
110 std::vector<Int_t> gradientColors(nColorPoints);
111 std::iota(gradientColors.begin(), gradientColors.end(), firstColorIndex);
112 return gradientColors;
120 std::vector<Color_t> gradientColors(nColorPoints);
121 std::iota(gradientColors.begin(), gradientColors.end(), firstColorIndex);
122 return gradientColors;
138 color blue {0.00, 0.00, 1.00};
139 color green {0.00, 1.00, 0.00};
140 color red {1.00, 0.00, 0.00};
141 color cyan {0.00, 1.00, 1.00};
142 color yellow {1.00, 1.00, 0.00};
143 color magenta {1.00, 0.00, 1.00};
144 color purple {0.40, 0.00, 0.60};
146 color alice_red {0.851, 0.027, 0.094};
147 color alice_blue {0.012, 0.039, 0.549};
148 color alice_grey {0.169, 0.220, 0.251};
149 color alice_orange {0.949, 0.475, 0.059};
150 color alice_rosered {0.749, 0.255, 0.255};
152 color deep_pink {0x990066};
153 color light_pink {0xC82F5C};
154 color grapefruit {0xE95F51};
155 color light_orange {0xFC9249};
156 color egg_yellow {0xFFC551};
157 color bright_yellow {0xF9F871};
159 color blurple {0x330099};
160 color ocean_blue {0x004DD2};
161 color dark_sky_blue {0x0079EF};
162 color light_sky_blue {0x00A0F1};
163 color sky_cyan {0x00C5DF};
164 color bluish_green {0x00E7C4};
166 color full {0x83B910};
167 color towards {0x10A7C1};
168 color away {0x874BDA};
169 color transverse {0xF36F19};
175 vector<color> rgbRainbow = {blue, cyan, green, yellow, red, magenta};
178 vector<color> rgbAlice = {alice_grey, alice_blue, alice_red, alice_rosered, alice_orange};
181 vector<color> purple_and_yellow = {purple, yellow};
184 vector<color> pink_to_yellow = {deep_pink, light_pink, grapefruit, light_orange, egg_yellow, bright_yellow};
187 vector<color> ocean_blues = {blurple, ocean_blue, dark_sky_blue, light_sky_blue, sky_cyan, bluish_green};
vector< Int_t > GetPalette()
Definition: Color.h:106
vector< Color_t > GetGradient()
Definition: Color.h:116
Color_t index
ROOT color index of color.
Definition: Color.h:36
Structure for saving RGB colors.
Definition: Color.h:18
color(Float_t red, Float_t green, Float_t blue)
Constructor using relative RGB values.
Definition: Color.h:21
Class for saving color gradients (palettes)
Definition: Color.h:41
color(Int_t hexvalue)
Constructor using hex integer value, see StackOverflow
Definition: Color.h:27
Int_t GetNpoints()
Definition: Color.h:126
Float_t g
green part of color
Definition: Color.h:33
Float_t r
red part of color
Definition: Color.h:32
Float_t b
blue part of color
Definition: Color.h:34