31 static Bool_t& TColor__GrayScaleMode() {
32 static Bool_t grayScaleMode;
35 static TArrayI& TColor__Palette() {
36 static TArrayI globalPalette(0);
39 static TArrayD& TColor__PalettesList() {
40 static TArrayD globalPalettesList(0);
41 return globalPalettesList;
50#define fgGrayscaleMode TColor__GrayScaleMode()
51#define fgPalette TColor__Palette()
52#define fgPalettesList TColor__PalettesList()
1082 Warning(
"TColor",
"color %d already defined", color);
1100 snprintf(aname,32,
"Color%d", color);
1141 gROOT->GetListOfColors()->Remove(
this);
1142 if (
gROOT->GetListOfColors()->IsEmpty()) {
1153 color.TColor::Copy(*
this);
1159 color.TColor::Copy(*
this);
1172 if (initDone)
return;
1175 if (
gROOT->GetListOfColors()->First() ==
nullptr) {
1179 new TColor(2,1,0,0,
"red");
1180 new TColor(3,0,1,0,
"green");
1181 new TColor(4,0,0,1,
"blue");
1182 new TColor(5,1,1,0,
"yellow");
1183 new TColor(6,1,0,1,
"magenta");
1184 new TColor(7,0,1,1,
"cyan");
1185 new TColor(10,0.999,0.999,0.999,
"white");
1186 new TColor(11,0.754,0.715,0.676,
"editcol");
1192 if (c110) c110->
SetRGB(0.999,0.999,.999);
1195 new TColor(20,0.8,0.78,0.67);
1196 new TColor(31,0.54,0.66,0.63);
1197 new TColor(41,0.83,0.81,0.53);
1198 new TColor(30,0.52,0.76,0.64);
1199 new TColor(32,0.51,0.62,0.55);
1200 new TColor(24,0.70,0.65,0.59);
1201 new TColor(21,0.8,0.78,0.67);
1202 new TColor(47,0.67,0.56,0.58);
1203 new TColor(35,0.46,0.54,0.57);
1204 new TColor(33,0.68,0.74,0.78);
1205 new TColor(39,0.5,0.5,0.61);
1206 new TColor(37,0.43,0.48,0.52);
1207 new TColor(38,0.49,0.6,0.82);
1208 new TColor(36,0.41,0.51,0.59);
1209 new TColor(49,0.58,0.41,0.44);
1210 new TColor(43,0.74,0.62,0.51);
1211 new TColor(22,0.76,0.75,0.66);
1212 new TColor(45,0.75,0.51,0.47);
1213 new TColor(44,0.78,0.6,0.49);
1214 new TColor(26,0.68,0.6,0.55);
1215 new TColor(28,0.53,0.4,0.34);
1216 new TColor(25,0.72,0.64,0.61);
1217 new TColor(27,0.61,0.56,0.51);
1218 new TColor(23,0.73,0.71,0.64);
1219 new TColor(42,0.87,0.73,0.53);
1220 new TColor(46,0.81,0.37,0.38);
1221 new TColor(48,0.65,0.47,0.48);
1222 new TColor(34,0.48,0.56,0.6);
1223 new TColor(40,0.67,0.65,0.75);
1224 new TColor(29,0.69,0.81,0.78);
1227 new TColor(8, 0.35,0.83,0.33);
1228 new TColor(9, 0.35,0.33,0.85);
1229 new TColor(12,.3,.3,.3,
"grey12");
1230 new TColor(13,.4,.4,.4,
"grey13");
1231 new TColor(14,.5,.5,.5,
"grey14");
1232 new TColor(15,.6,.6,.6,
"grey15");
1233 new TColor(16,.7,.7,.7,
"grey16");
1234 new TColor(17,.8,.8,.8,
"grey17");
1235 new TColor(18,.9,.9,.9,
"grey18");
1236 new TColor(19,.95,.95,.95,
"grey19");
1237 new TColor(50, 0.83,0.35,0.33);
1240 new TColor(
kGrape, 111./255., 45./255., 168./255.,
"kGrape");
1241 new TColor(
kBrown, 165./255., 42./255., 42./255.,
"kBrown");
1242 new TColor(
kAsh, 178./255., 190./255., 181./255.,
"kAsh");
1244 new TColor(
kP6Blue, 87./255., 144./255., 252./255.,
"kP6Blue");
1246 new TColor(
kP6Red, 228./255., 37./255., 54./255.,
"kP6Red");
1247 new TColor(
kP6Grape, 150./255., 74./255., 139./255.,
"kP6Grape");
1248 new TColor(
kP6Gray, 156./255., 156./255., 161./255.,
"kP6Gray");
1251 new TColor(
kP8Blue, 24./255., 69./255., 251./255.,
"kP8Blue");
1253 new TColor(
kP8Red, 201./255., 31./255., 22./255.,
"kP8Red");
1254 new TColor(
kP8Pink, 200./255., 73./255., 169./255.,
"kP8Pink");
1255 new TColor(
kP8Green, 173./255., 173./255., 125./255.,
"kP8Green");
1256 new TColor(
kP8Cyan, 134./255., 200./255., 221./255.,
"kP8Cyan");
1257 new TColor(
kP8Azure, 87./255., 141./255., 255./255.,
"kP8Azure");
1258 new TColor(
kP8Gray, 101./255., 99./255., 100./255.,
"kP8Gray");
1260 new TColor(
kP10Blue, 63./255., 144./255., 218./255.,
"kP10Blue");
1262 new TColor(
kP10Red, 189./255., 31./255., 1./255.,
"kP10Red");
1263 new TColor(
kP10Gray, 148./255., 164./255., 162./255.,
"kP10Gray");
1268 new TColor(
kP10Ash, 113./255., 117./255., 129./255.,
"kP10Ash");
1269 new TColor(
kP10Cyan, 146./255., 218./255., 221./255.,
"kP10Cyan");
1282 Int_t maxPretty = 50;
1286 for (i=0 ; i<maxPretty-1 ; i++) {
1287 hue = maxHue-(i+1)*((maxHue-minHue)/maxPretty);
1294 for (i = 1; i < 8; i++) {
1297 if (i == 1) {
r = 0.6;
g = 0.6;
b = 0.6; }
1298 if (
r == 1)
r = 0.9;
else if (
r == 0)
r = 0.1;
1299 if (
g == 1)
g = 0.9;
else if (
g == 0)
g = 0.1;
1300 if (
b == 1)
b = 0.9;
else if (
b == 0)
b = 0.1;
1337 tempbuf.
Form(
"#%02x%02x%02x%02x",
a,
r,
g,
b);
1339 tempbuf.
Form(
"#%02x%02x%02x",
r,
g,
b);
1386 color =
new TColor(colorn,rgb[3*
n]/255.,rgb[3*
n+1]/255.,rgb[3*
n+2]/255.);
1388 else if (
n<10) colorname.
Form(
"%s-%d",
name,10-
n);
1405 color =
new TColor(colorn,rgb[3*
n]/255.,rgb[3*
n+1]/255.,rgb[3*
n+2]/255.);
1407 else if (
n<9) colorname.
Form(
"%s-%d",
name,9-
n);
1419 UChar_t magenta[46]= {255,204,255
1420 ,255,153,255, 204,153,204
1421 ,255,102,255, 204,102,204, 153,102,153
1422 ,255, 51,255, 204, 51,204, 153, 51,153, 102, 51,102
1423 ,255, 0,255, 204, 0,204, 153, 0,153, 102, 0,102, 51, 0, 51};
1425 UChar_t red[46] = {255,204,204
1426 ,255,153,153, 204,153,153
1427 ,255,102,102, 204,102,102, 153,102,102
1428 ,255, 51, 51, 204, 51, 51, 153, 51, 51, 102, 51, 51
1429 ,255, 0, 0, 204, 0, 0, 153, 0, 0, 102, 0, 0, 51, 0, 0};
1431 UChar_t yellow[46] = {255,255,204
1432 ,255,255,153, 204,204,153
1433 ,255,255,102, 204,204,102, 153,153,102
1434 ,255,255, 51, 204,204, 51, 153,153, 51, 102,102, 51
1435 ,255,255, 0, 204,204, 0, 153,153, 0, 102,102, 0, 51, 51, 0};
1437 UChar_t green[46] = {204,255,204
1438 ,153,255,153, 153,204,153
1439 ,102,255,102, 102,204,102, 102,153,102
1440 , 51,255, 51, 51,204, 51, 51,153, 51, 51,102, 51
1441 , 0,255, 0, 0,204, 0, 0,153, 0, 0,102, 0, 0, 51, 0};
1443 UChar_t cyan[46] = {204,255,255
1444 ,153,255,255, 153,204,204
1445 ,102,255,255, 102,204,204, 102,153,153
1446 , 51,255,255, 51,204,204, 51,153,153, 51,102,102
1447 , 0,255,255, 0,204,204, 0,153,153, 0,102,102, 0, 51, 51};
1449 UChar_t blue[46] = {204,204,255
1450 ,153,153,255, 153,153,204
1451 ,102,102,255, 102,102,204, 102,102,153
1452 , 51, 51,255, 51, 51,204, 51, 51,153, 51, 51,102
1453 , 0, 0,255, 0, 0,204, 0, 0,153, 0, 0,102, 0, 0, 51};
1455 UChar_t pink[60] = {255, 51,153, 204, 0,102, 102, 0, 51, 153, 0, 51, 204, 51,102
1456 ,255,102,153, 255, 0,102, 255, 51,102, 204, 0, 51, 255, 0, 51
1457 ,255,153,204, 204,102,153, 153, 51,102, 153, 0,102, 204, 51,153
1458 ,255,102,204, 255, 0,153, 204, 0,153, 255, 51,204, 255, 0,153};
1460 UChar_t orange[60]={255,204,153, 204,153,102, 153,102, 51, 153,102, 0, 204,153, 51
1461 ,255,204,102, 255,153, 0, 255,204, 51, 204,153, 0, 255,204, 0
1462 ,255,153, 51, 204,102, 0, 102, 51, 0, 153, 51, 0, 204,102, 51
1463 ,255,153,102, 255,102, 0, 255,102, 51, 204, 51, 0, 255, 51, 0};
1465 UChar_t spring[60]={153,255, 51, 102,204, 0, 51,102, 0, 51,153, 0, 102,204, 51
1466 ,153,255,102, 102,255, 0, 102,255, 51, 51,204, 0, 51,255, 0
1467 ,204,255,153, 153,204,102, 102,153, 51, 102,153, 0, 153,204, 51
1468 ,204,255,102, 153,255, 0, 204,255, 51, 153,204, 0, 204,255, 0};
1470 UChar_t teal[60] = {153,255,204, 102,204,153, 51,153,102, 0,153,102, 51,204,153
1471 ,102,255,204, 0,255,102, 51,255,204, 0,204,153, 0,255,204
1472 , 51,255,153, 0,204,102, 0,102, 51, 0,153, 51, 51,204,102
1473 ,102,255,153, 0,255,153, 51,255,102, 0,204, 51, 0,255, 51};
1475 UChar_t azure[60] ={153,204,255, 102,153,204, 51,102,153, 0, 51,153, 51,102,204
1476 ,102,153,255, 0,102,255, 51,102,255, 0, 51,204, 0, 51,255
1477 , 51,153,255, 0,102,204, 0, 51,102, 0,102,153, 51,153,204
1478 ,102,204,255, 0,153,255, 51,204,255, 0,153,204, 0,204,255};
1480 UChar_t violet[60]={204,153,255, 153,102,204, 102, 51,153, 102, 0,153, 153, 51,204
1481 ,204,102,255, 153, 0,255, 204, 51,255, 153, 0,204, 204, 0,255
1482 ,153, 51,255, 102, 0,204, 51, 0,102, 51, 0,153, 102, 51,204
1483 ,153,102,255, 102, 0,255, 102, 51,255, 51, 0,204, 51, 0,255};
1508 if (ncolors == 0)
return 0;
1509 Int_t icol = i%ncolors;
1510 if (icol < 0) icol = 0;
1540 if (set_always_on > 0)
1542 else if (set_always_on < 0)
1583 if (hue > 0) { rh = hue;
if (rh > 360) rh = 360; }
1584 if (light > 0) { rl = light;
if (rl > 1) rl = 1; }
1585 if (satur > 0) { rs = satur;
if (rs > 1) rs = 1; }
1588 rm2 = rl*(1.0f + rs);
1590 rm2 = rl + rs - rl*rs;
1591 rm1 = 2.0f*rl - rm2;
1593 if (!rs) {
r = rl;
g = rl;
b = rl;
return; }
1605 if (hue > 360) hue = hue - 360.0f;
1606 if (hue < 0) hue = hue + 360.0f;
1607 if (hue < 60 )
return rn1 + (rn2-rn1)*hue/60.0f;
1608 if (hue < 180)
return rn2;
1609 if (hue < 240)
return rn1 + (rn2-rn1)*(240.0f-hue)/60.0f;
1619 Float_t hh, ll, ss, rr, gg, bb;
1627 r = (
Int_t) (rr * 255.0f);
1628 g = (
Int_t) (gg * 255.0f);
1629 b = (
Int_t) (bb * 255.0f);
1656 i = (
Int_t)floor(hue);
1660 t =
value*(1-satur*(1-
f));
1701 printf(
"Color:%d Red=%f Green=%f Blue=%f Alpha=%f Name=%s\n",
1721 if (rr > 0) {
r = rr;
if (
r > 1)
r = 1; }
1722 if (gg > 0) {
g = gg;
if (
g > 1)
g = 1; }
1723 if (bb > 0) {
b = bb;
if (
b > 1)
b = 1; }
1726 if (
g < minval) minval =
g;
1727 if (
b < minval) minval =
b;
1728 if (
g > maxval) maxval =
g;
1729 if (
b > maxval) maxval =
b;
1732 Float_t mdiff = maxval - minval;
1733 Float_t msum = maxval + minval;
1734 light = 0.5f * msum;
1735 if (maxval != minval) {
1736 rnorm = (maxval -
r)/mdiff;
1737 gnorm = (maxval -
g)/mdiff;
1738 bnorm = (maxval -
b)/mdiff;
1747 satur = mdiff/(2.0f - msum);
1750 hue = 60.0f * (6.0f + bnorm - gnorm);
1751 else if (
g == maxval)
1752 hue = 60.0f * (2.0f + rnorm - bnorm);
1754 hue = 60.0f * (4.0f + gnorm - rnorm);
1793 }
else if (
g == max) {
1794 hue = 2.0f+(
b-
r)/delta;
1796 hue = 4.0f+(
r-
g)/delta;
1800 if (hue < 0.0f) hue += 360.0f;
1809 Float_t rr, gg, bb, hue, light, satur;
1817 h = (
Int_t) (hue/360.0f * 255.0f);
1818 l = (
Int_t) (light * 255.0f);
1819 s = (
Int_t) (satur * 255.0f);
1858 if (
fRed < 0)
return;
1865 if (nplanes == 0) nplanes = 16;
1874 Float_t dr, dg, db, lr, lg, lb;
1884 if (nplanes > 8) colord->
SetRGB(dr, dg, db);
1885 else colord->
SetRGB(0.3f,0.3f,0.3f);
1894 if (nplanes > 8) colorb->
SetRGB(lr, lg, lb);
1895 else colorb->
SetRGB(0.8f,0.8f,0.8f);
1923 if (hexcolor && *hexcolor ==
'#') {
1925 if (sscanf(hexcolor+1,
"%02x%02x%02x", &
r, &
g, &
b) == 3)
1928 ::Error(
"TColor::GetColor(const char*)",
"incorrect color string");
2032 return color->GetNumber();
2046 thres = 1.0f/255.0f;
2048 if ((nplanes > 0) && (nplanes <= 16)) thres = 1.0f/31.0f;
2052 while (
auto color =
static_cast<TColor *
>(next())) {
2053 if (
TMath::Abs(color->GetRed() - rr) > thres)
continue;
2054 if (
TMath::Abs(color->GetGreen() - gg) > thres)
continue;
2055 if (
TMath::Abs(color->GetBlue() - bb) > thres)
continue;
2056 if (
TMath::Abs(color->GetAlpha() -
a) > thres)
continue;
2058 return color->GetNumber();
2066 return color->GetNumber();
2077 if (
auto color =
static_cast<TColor *
>(
colors->FindObject(colorname))) {
2078 return color->GetNumber();
2090 if (
n < 0)
return -1;
2099 if (!color)
return -1;
2102 if (strlen(color->
GetName()) == 0)
2108 TColor *colorb =
nullptr;
2123 colors->AddAtAndExpand(colorb,nb);
2133 if (
n < 0)
return -1;
2142 if (!color)
return -1;
2145 if (strlen(color->
GetName()) == 0)
2151 TColor *colord =
nullptr;
2166 colors->AddAtAndExpand(colord,nd);
2177 if (
n < 0)
return -1;
2184 for (
Int_t i = 0; i < ncolors; i++) {
2198 ::Error(
"TColor::GetColorTransparent",
"color with index %d not defined",
n);
2214 ::Error(
"TColor::GetLinearGradient",
"number of specified colors %d not enough to create gradients", (
int)
colors.size());
2218 std::vector<Double_t> raw_colors(
colors.size()*4);
2219 std::vector<Double_t> raw_positions(
colors.size());
2220 for (
unsigned indx = 0; indx <
colors.size(); indx++) {
2223 ::Error(
"TColor::GetLinearGradient",
"Not able to get %d color", (
int)
colors.size());
2226 raw_colors[indx*4] = color->
GetRed();
2227 raw_colors[indx*4+1] = color->
GetGreen();
2228 raw_colors[indx*4+2] = color->
GetBlue();
2229 raw_colors[indx*4+3] = color->
GetAlpha();
2231 raw_positions[indx] = indx < positions.size() ? positions[indx] : indx / (
colors.size() - 1.);
2234 Double_t _cos = std::cos(
angle / 180. * 3.1415), _sin = std::sin(
angle / 180. * 3.1415);
2235 Double_t x0 = (_cos >= 0. ? 0. : 1.), y0 = (_sin >= 0. ? 0. : 1.);
2243 TIter iter(root_colors);
2245 while (
auto col =
static_cast<TColor *
>(iter())) {
2251 if (grad->GetNumberOfSteps() !=
colors.size())
2255 for (
unsigned n = 0;
n < raw_colors.size(); ++
n)
2256 if (
TMath::Abs(raw_colors[
n] - grad->GetColors()[
n]) > 1
e-3)
2259 for (
unsigned n = 0;
n < raw_positions.size(); ++
n)
2260 if (
TMath::Abs(raw_positions[
n] - grad->GetColorPositions()[
n]) > 1
e-2)
2263 if (
TMath::Abs(grad->GetStart().fX - start.fX) > 1
e-2 ||
2264 TMath::Abs(grad->GetStart().fY - start.fY) > 1
e-2 ||
2270 return col->GetNumber();
2275 grad->SetStartEnd(start, end);
2277 return grad->GetNumber();
2291 ::Error(
"TColor::GetRadialGradient",
"number of specified colors %d not enough to create gradients", (
int)
colors.size());
2295 std::vector<Double_t> raw_colors(
colors.size()*4);
2296 std::vector<Double_t> raw_positions(
colors.size());
2297 for (
unsigned indx = 0; indx <
colors.size(); indx++) {
2300 ::Error(
"TColor::GetRadialGradient",
"Not able to get %d color", (
int)
colors.size());
2303 raw_colors[indx*4] = color->
GetRed();
2304 raw_colors[indx*4+1] = color->
GetGreen();
2305 raw_colors[indx*4+2] = color->
GetBlue();
2306 raw_colors[indx*4+3] = color->
GetAlpha();
2308 raw_positions[indx] = indx < positions.size() ? positions[indx] : indx / (
colors.size() - 1.);
2315 TIter iter(root_colors);
2317 while (
auto col =
static_cast<TColor *
>(iter())) {
2323 if (grad->GetNumberOfSteps() !=
colors.size())
2330 for (
unsigned n = 0;
n < raw_colors.size(); ++
n)
2331 if (
TMath::Abs(raw_colors[
n] - grad->GetColors()[
n]) > 1
e-3)
2334 for (
unsigned n = 0;
n < raw_positions.size(); ++
n)
2335 if (
TMath::Abs(raw_positions[
n] - grad->GetColorPositions()[
n]) > 1
e-2)
2338 if (
TMath::Abs(grad->GetStart().fX - start.fX) > 1
e-2 ||
2339 TMath::Abs(grad->GetStart().fY - start.fY) > 1
e-2 ||
2344 return col->GetNumber();
2349 grad->SetRadialGradient(start, radius);
2351 return grad->GetNumber();
2386 if (!color)
return i;
2401 if (nb==0 || last>=ncolors) last = ncolors;
2405 printf(
" +------+-------+-------+-------+-------+--------------------+--------------------+\n");
2406 printf(
" | Idx | Red | Green | Blue | Alpha | Color Name | Color Title |\n");
2407 printf(
" +------+-------+-------+-------+-------+--------------------+--------------------+\n");
2409 for (
Int_t i = ci; i<last; i++) {
2412 printf(
" | %4d | %5.3f | %5.3f | %5.3f | %5.3f | %18s | %18s |\n", i,
2420 }
else if (showEmpty) {
2421 printf(
" | %4d | ? | ? | ? | ? | ? | ? |\n",i);
2424 printf(
" +------+-------+-------+-------+-------+--------------------+--------------------+\n");
2425 printf(
" | Number of possible colors = %4d |\n",ncolors);
2426 printf(
" | Number of defined colors between %4d and %4d = %4d |\n",ci,last,nc);
2427 printf(
" | Number of free indeces between %4d and %4d = %4d |\n",ci,last,last-ci-nc);
2428 printf(
" +--------------------------------------------------------------------------------+\n\n");
2445 ::Warning(
"TColor::Number2Pixel",
"color with index %d not defined", ci);
2481 if (
r > 255)
r = 255;
2482 if (
g > 255)
g = 255;
2483 if (
b > 255)
b = 255;
2519 r = color.
fRed / 257;
2536 tempbuf.
Form(
"#%02x%02x%02x",
r,
g,
b);
2559 out <<
" Int_t ci; // for color index setting" << std::endl;
2560 out <<
" TColor *color; // for color definition with alpha" << std::endl;
2569 out<<
" ci = "<<ci<<
";"<<std::endl;
2570 out<<
" color = new TColor(ci, "<<
r<<
", "<<
g<<
", "<<
b<<
", "
2571 <<
"\" \", "<<
a<<
");"<<std::endl;
2577 out<<
" ci = TColor::GetColor("<<quote<<
cname.Data()<<quote<<
");"<<std::endl;
2604 while ((color = (
TColor*) iColor()))
2627 std::ifstream
f(fileName.
Data());
2629 ::Error(
"TColor::CreateColorPalette(const TString)",
"%s does not exist or cannot be opened", fileName.
Data());
2635 std::vector<Float_t> reds, greens, blues;
2636 while (
f >>
r >>
g >>
b) {
2638 if (r < 0. || r > 1.) {
2639 ::Error(
"TColor::CreateColorPalette(const TString)",
"Red value %f outside [0,1] on line %d of %s ",
r,
2640 nLines, fileName.
Data());
2644 if (g < 0. || g > 1.) {
2645 ::Error(
"TColor::CreateColorPalette(const TString)",
"Green value %f outside [0,1] on line %d of %s ",
g,
2646 nLines, fileName.
Data());
2650 if (b < 0. || b > 1.) {
2651 ::Error(
"TColor::CreateColorPalette(const TString)",
"Blue value %f outside [0,1] on line %d of %s ",
b,
2652 nLines, fileName.
Data());
2656 reds.emplace_back(
r);
2657 greens.emplace_back(
g);
2658 blues.emplace_back(
b);
2662 ::Error(
"TColor::CreateColorPalette(const TString)",
"Found insufficient color lines (%d) on %s", nLines,
2670 for (
Int_t i = 0; i < nLines; ++i) {
2671 new TColor(reds.at(i), greens.at(i), blues.at(i), alpha);
2743 if(Number < 2 || NColors < 1){
2750 for (
c = 0;
c < Number;
c++) {
2751 if (Red[
c] < 0 || Red[
c] > 1.0 ||
2752 Green[
c] < 0 || Green[
c] > 1.0 ||
2753 Blue[
c] < 0 || Blue[
c] > 1.0 ||
2754 Stops[
c] < 0 || Stops[
c] > 1.0) {
2759 if (Stops[
c-1] > Stops[
c]) {
2769 for (
g = 1;
g < Number;
g++) {
2771 nColorsGradient = (
Int_t) (floor(NColors*Stops[
g]) - floor(NColors*Stops[
g-1]));
2772 for (
c = 0;
c < nColorsGradient;
c++) {
2774 Float_t(Green[
g-1] +
c * (Green[
g] - Green[
g-1])/ nColorsGradient),
2775 Float_t(Blue[
g-1] +
c * (Blue[
g] - Blue[
g-1]) / nColorsGradient),
2926 static Int_t paletteType = 0;
2928 Int_t palette[50] = {19,18,17,16,15,14,13,12,11,20,
2929 21,22,23,24,25,26,27,28,29,30, 8,
2930 31,32,33,34,35,36,37,38,39,40, 9,
2931 41,42,43,44,45,47,48,49,46,50, 2,
2932 7, 6, 5, 4, 3, 2,1};
2938 for (i=0;i<ncolors;i++)
fgPalette.fArray[i] = palette[i];
2944 if (ncolors == 1 &&
colors ==
nullptr) {
2947 for (i=0;i<ncolors-1;i++)
fgPalette.fArray[i] = 51+i;
2954 if (
colors ==
nullptr && ncolors>50) {
2963 if (paletteType == ncolors && same_alpha)
return;
2965 for (i=0;i<255;i++)
fgPalette.fArray[i] = Idx+i;
2966 paletteType = ncolors;
2969 if (alphas>0 && !same_alpha) {
2971 for (i=0;i<255;i++) {
2981 Double_t stops[9] = { 0.0000, 0.1250, 0.2500, 0.3750, 0.5000, 0.6250, 0.7500, 0.8750, 1.0000};
2987 Double_t red[9] = { 0./255., 9./255., 13./255., 17./255., 24./255., 32./255., 27./255., 25./255., 29./255.};
2988 Double_t green[9] = { 0./255., 0./255., 0./255., 2./255., 37./255., 74./255., 113./255., 160./255., 221./255.};
2989 Double_t blue[9] = { 28./255., 42./255., 59./255., 78./255., 98./255., 129./255., 154./255., 184./255., 221./255.};
2997 Double_t red[9] = { 0./255., 32./255., 64./255., 96./255., 128./255., 160./255., 192./255., 224./255., 255./255.};
2998 Double_t green[9] = { 0./255., 32./255., 64./255., 96./255., 128./255., 160./255., 192./255., 224./255., 255./255.};
2999 Double_t blue[9] = { 0./255., 32./255., 64./255., 96./255., 128./255., 160./255., 192./255., 224./255., 255./255.};
3007 Double_t red[9] = { 0./255., 45./255., 99./255., 156./255., 212./255., 230./255., 237./255., 234./255., 242./255.};
3008 Double_t green[9] = { 0./255., 0./255., 0./255., 45./255., 101./255., 168./255., 238./255., 238./255., 243./255.};
3009 Double_t blue[9] = { 0./255., 1./255., 1./255., 3./255., 9./255., 8./255., 11./255., 95./255., 230./255.};
3017 Double_t red[9] = { 0./255., 22./255., 44./255., 68./255., 93./255., 124./255., 160./255., 192./255., 237./255.};
3018 Double_t green[9] = { 0./255., 16./255., 41./255., 67./255., 93./255., 125./255., 162./255., 194./255., 241./255.};
3019 Double_t blue[9] = { 97./255., 100./255., 99./255., 99./255., 93./255., 68./255., 44./255., 26./255., 74./255.};
3027 Double_t red[9] = { 0./255., 5./255., 15./255., 35./255., 102./255., 196./255., 208./255., 199./255., 110./255.};
3028 Double_t green[9] = { 0./255., 48./255., 124./255., 192./255., 206./255., 226./255., 97./255., 16./255., 0./255.};
3029 Double_t blue[9] = { 99./255., 142./255., 198./255., 201./255., 90./255., 22./255., 13./255., 8./255., 2./255.};
3037 Double_t red[9] = { 242./255., 234./255., 237./255., 230./255., 212./255., 156./255., 99./255., 45./255., 0./255.};
3038 Double_t green[9] = { 243./255., 238./255., 238./255., 168./255., 101./255., 45./255., 0./255., 0./255., 0./255.};
3039 Double_t blue[9] = { 230./255., 95./255., 11./255., 8./255., 9./255., 3./255., 1./255., 1./255., 0./255.};
3047 Double_t red[9] = { 0.2082, 0.0592, 0.0780, 0.0232, 0.1802, 0.5301, 0.8186, 0.9956, 0.9764};
3048 Double_t green[9] = { 0.1664, 0.3599, 0.5041, 0.6419, 0.7178, 0.7492, 0.7328, 0.7862, 0.9832};
3049 Double_t blue[9] = { 0.5293, 0.8684, 0.8385, 0.7914, 0.6425, 0.4662, 0.3499, 0.1968, 0.0539};
3057 Double_t red[9] = { 0.0000, 0.0956, 0.0098, 0.2124, 0.6905, 0.9242, 0.7914, 0.7596, 1.0000};
3058 Double_t green[9] = { 0.0000, 0.1147, 0.3616, 0.5041, 0.4577, 0.4691, 0.6905, 0.9237, 1.0000};
3059 Double_t blue[9] = { 0.0000, 0.2669, 0.3121, 0.1318, 0.2236, 0.6741, 0.9882, 0.9593, 1.0000};
3067 Double_t red[9] = {13./255., 23./255., 25./255., 63./255., 76./255., 104./255., 137./255., 161./255., 206./255.};
3068 Double_t green[9] = {95./255., 67./255., 37./255., 21./255., 0./255., 12./255., 35./255., 52./255., 79./255.};
3069 Double_t blue[9] = { 4./255., 3./255., 2./255., 6./255., 11./255., 22./255., 49./255., 98./255., 208./255.};
3077 Double_t red[9] = {0./255., 61./255., 89./255., 122./255., 143./255., 160./255., 185./255., 204./255., 231./255.};
3078 Double_t green[9] = {0./255., 0./255., 0./255., 0./255., 14./255., 37./255., 72./255., 132./255., 235./255.};
3079 Double_t blue[9] = {0./255., 140./255., 224./255., 144./255., 4./255., 5./255., 6./255., 9./255., 13./255.};
3087 Double_t red[9] = { 14./255., 7./255., 2./255., 0./255., 5./255., 11./255., 55./255., 131./255., 229./255.};
3088 Double_t green[9] = {105./255., 56./255., 26./255., 1./255., 42./255., 74./255., 131./255., 171./255., 229./255.};
3089 Double_t blue[9] = { 2./255., 21./255., 35./255., 60./255., 92./255., 113./255., 160./255., 185./255., 229./255.};
3097 Double_t red[9] = { 0./255., 0./255., 0./255., 70./255., 148./255., 231./255., 235./255., 237./255., 244./255.};
3098 Double_t green[9] = { 0./255., 0./255., 0./255., 0./255., 0./255., 69./255., 67./255., 216./255., 244./255.};
3099 Double_t blue[9] = { 0./255., 102./255., 228./255., 231./255., 177./255., 124./255., 137./255., 20./255., 244./255.};
3107 Double_t red[9] = { 50./255., 56./255., 63./255., 68./255., 93./255., 121./255., 165./255., 192./255., 241./255.};
3108 Double_t green[9] = { 66./255., 81./255., 91./255., 96./255., 111./255., 128./255., 155./255., 189./255., 241./255.};
3109 Double_t blue[9] = { 97./255., 91./255., 75./255., 65./255., 77./255., 103./255., 143./255., 167./255., 217./255.};
3117 Double_t red[9] = { 145./255., 166./255., 167./255., 156./255., 131./255., 114./255., 101./255., 112./255., 132./255.};
3118 Double_t green[9] = { 158./255., 178./255., 179./255., 181./255., 163./255., 154./255., 144./255., 152./255., 159./255.};
3119 Double_t blue[9] = { 190./255., 199./255., 201./255., 192./255., 176./255., 169./255., 160./255., 166./255., 190./255.};
3127 Double_t red[9] = { 93./255., 91./255., 99./255., 108./255., 130./255., 125./255., 132./255., 155./255., 174./255.};
3128 Double_t green[9] = { 126./255., 124./255., 128./255., 129./255., 131./255., 121./255., 119./255., 153./255., 173./255.};
3129 Double_t blue[9] = { 103./255., 94./255., 87./255., 85./255., 80./255., 85./255., 107./255., 120./255., 146./255.};
3137 Double_t red[9] = { 24./255., 40./255., 69./255., 90./255., 104./255., 114./255., 120./255., 132./255., 103./255.};
3138 Double_t green[9] = { 29./255., 52./255., 94./255., 127./255., 150./255., 162./255., 159./255., 151./255., 101./255.};
3139 Double_t blue[9] = { 29./255., 52./255., 96./255., 132./255., 162./255., 181./255., 184./255., 186./255., 131./255.};
3147 Double_t red[9] = { 46./255., 38./255., 61./255., 92./255., 113./255., 121./255., 132./255., 150./255., 191./255.};
3148 Double_t green[9] = { 46./255., 36./255., 40./255., 69./255., 110./255., 135./255., 131./255., 92./255., 34./255.};
3149 Double_t blue[9] = { 46./255., 80./255., 74./255., 70./255., 81./255., 105./255., 165./255., 211./255., 225./255.};
3157 Double_t red[9] = { 0./255., 4./255., 12./255., 30./255., 52./255., 101./255., 142./255., 190./255., 237./255.};
3158 Double_t green[9] = { 0./255., 40./255., 86./255., 121./255., 140./255., 172./255., 187./255., 213./255., 240./255.};
3159 Double_t blue[9] = { 0./255., 9./255., 14./255., 18./255., 21./255., 23./255., 27./255., 35./255., 101./255.};
3167 Double_t red[9] = { 198./255., 206./255., 206./255., 211./255., 198./255., 181./255., 161./255., 171./255., 244./255.};
3168 Double_t green[9] = { 103./255., 133./255., 150./255., 172./255., 178./255., 174./255., 163./255., 175./255., 244./255.};
3169 Double_t blue[9] = { 49./255., 54./255., 55./255., 66./255., 91./255., 130./255., 184./255., 224./255., 244./255.};
3177 Double_t red[9] = { 243./255., 243./255., 240./255., 240./255., 241./255., 239./255., 186./255., 151./255., 129./255.};
3178 Double_t green[9] = { 0./255., 46./255., 99./255., 149./255., 194./255., 220./255., 183./255., 166./255., 147./255.};
3179 Double_t blue[9] = { 6./255., 8./255., 36./255., 91./255., 169./255., 235./255., 246./255., 240./255., 233./255.};
3187 Double_t red[9] = { 22./255., 19./255., 19./255., 25./255., 35./255., 53./255., 88./255., 139./255., 210./255.};
3188 Double_t green[9] = { 0./255., 32./255., 69./255., 108./255., 135./255., 159./255., 183./255., 198./255., 215./255.};
3189 Double_t blue[9] = { 77./255., 96./255., 110./255., 116./255., 110./255., 100./255., 90./255., 78./255., 70./255.};
3197 Double_t red[9] = { 68./255., 116./255., 165./255., 182./255., 189./255., 180./255., 145./255., 111./255., 71./255.};
3198 Double_t green[9] = { 37./255., 82./255., 135./255., 178./255., 204./255., 225./255., 221./255., 202./255., 147./255.};
3199 Double_t blue[9] = { 16./255., 55./255., 105./255., 147./255., 196./255., 226./255., 232./255., 224./255., 178./255.};
3207 Double_t red[9] = { 61./255., 99./255., 136./255., 181./255., 213./255., 225./255., 198./255., 136./255., 24./255.};
3208 Double_t green[9] = { 149./255., 140./255., 96./255., 83./255., 132./255., 178./255., 190./255., 135./255., 22./255.};
3209 Double_t blue[9] = { 214./255., 203./255., 168./255., 135./255., 110./255., 100./255., 111./255., 113./255., 22./255.};
3217 Double_t red[9] = { 76./255., 120./255., 156./255., 183./255., 197./255., 180./255., 162./255., 154./255., 140./255.};
3218 Double_t green[9] = { 34./255., 35./255., 42./255., 69./255., 102./255., 137./255., 164./255., 188./255., 197./255.};
3219 Double_t blue[9] = { 64./255., 69./255., 78./255., 105./255., 142./255., 177./255., 205./255., 217./255., 198./255.};
3227 Double_t red[9] = { 37./255., 102./255., 157./255., 188./255., 196./255., 214./255., 223./255., 235./255., 251./255.};
3228 Double_t green[9] = { 37./255., 29./255., 25./255., 37./255., 67./255., 91./255., 132./255., 185./255., 251./255.};
3229 Double_t blue[9] = { 37./255., 32./255., 33./255., 45./255., 66./255., 98./255., 137./255., 187./255., 251./255.};
3237 Double_t red[9] = { 79./255., 100./255., 119./255., 137./255., 153./255., 172./255., 192./255., 205./255., 250./255.};
3238 Double_t green[9] = { 63./255., 79./255., 93./255., 103./255., 115./255., 135./255., 167./255., 196./255., 250./255.};
3239 Double_t blue[9] = { 51./255., 59./255., 66./255., 61./255., 62./255., 70./255., 110./255., 160./255., 250./255.};
3247 Double_t red[9] = { 43./255., 44./255., 50./255., 66./255., 125./255., 172./255., 178./255., 155./255., 157./255.};
3248 Double_t green[9] = { 63./255., 63./255., 85./255., 101./255., 138./255., 163./255., 122./255., 51./255., 39./255.};
3249 Double_t blue[9] = { 121./255., 101./255., 58./255., 44./255., 47./255., 55./255., 57./255., 44./255., 43./255.};
3257 Double_t red[9] = { 0./255., 41./255., 62./255., 79./255., 90./255., 87./255., 99./255., 140./255., 228./255.};
3258 Double_t green[9] = { 0./255., 57./255., 81./255., 93./255., 85./255., 70./255., 71./255., 125./255., 228./255.};
3259 Double_t blue[9] = { 95./255., 91./255., 91./255., 82./255., 60./255., 43./255., 44./255., 112./255., 228./255.};
3267 Double_t red[9] = { 49./255., 59./255., 72./255., 88./255., 114./255., 141./255., 176./255., 205./255., 222./255.};
3268 Double_t green[9] = { 78./255., 72./255., 66./255., 57./255., 59./255., 75./255., 106./255., 142./255., 173./255.};
3269 Double_t blue[9] = { 78./255., 55./255., 46./255., 40./255., 39./255., 39./255., 40./255., 41./255., 47./255.};
3277 Double_t red[9] = { 243./255., 222./255., 201./255., 185./255., 165./255., 158./255., 166./255., 187./255., 219./255.};
3278 Double_t green[9] = { 94./255., 108./255., 132./255., 135./255., 125./255., 96./255., 68./255., 51./255., 61./255.};
3279 Double_t blue[9] = { 7./255., 9./255., 12./255., 19./255., 45./255., 89./255., 118./255., 146./255., 118./255.};
3287 Double_t red[9] = { 19./255., 44./255., 74./255., 105./255., 137./255., 166./255., 194./255., 206./255., 220./255.};
3288 Double_t green[9] = { 19./255., 28./255., 40./255., 55./255., 82./255., 110./255., 159./255., 181./255., 220./255.};
3289 Double_t blue[9] = { 19./255., 42./255., 68./255., 96./255., 129./255., 157./255., 188./255., 203./255., 220./255.};
3297 Double_t red[9] = { 33./255., 44./255., 70./255., 99./255., 140./255., 165./255., 199./255., 211./255., 216./255.};
3298 Double_t green[9] = { 38./255., 50./255., 76./255., 105./255., 140./255., 165./255., 191./255., 189./255., 167./255.};
3299 Double_t blue[9] = { 55./255., 67./255., 97./255., 124./255., 140./255., 166./255., 163./255., 129./255., 52./255.};
3307 Double_t red[9] = { 0./255., 33./255., 73./255., 124./255., 136./255., 152./255., 159./255., 171./255., 223./255.};
3308 Double_t green[9] = { 0./255., 43./255., 92./255., 124./255., 134./255., 126./255., 121./255., 144./255., 223./255.};
3309 Double_t blue[9] = { 0./255., 43./255., 68./255., 76./255., 73./255., 64./255., 72./255., 114./255., 223./255.};
3317 Double_t red[9] = { 5./255., 18./255., 45./255., 124./255., 193./255., 223./255., 205./255., 128./255., 49./255.};
3318 Double_t green[9] = { 48./255., 134./255., 207./255., 230./255., 193./255., 113./255., 28./255., 0./255., 7./255.};
3319 Double_t blue[9] = { 6./255., 15./255., 41./255., 121./255., 193./255., 226./255., 208./255., 130./255., 49./255.};
3327 Double_t red[9] = { 180./255., 106./255., 104./255., 135./255., 164./255., 188./255., 189./255., 165./255., 144./255.};
3328 Double_t green[9] = { 72./255., 126./255., 154./255., 184./255., 198./255., 207./255., 205./255., 190./255., 179./255.};
3329 Double_t blue[9] = { 41./255., 120./255., 158./255., 188./255., 194./255., 181./255., 145./255., 100./255., 62./255.};
3337 Double_t red[9] = { 57./255., 72./255., 94./255., 117./255., 136./255., 154./255., 174./255., 192./255., 215./255.};
3338 Double_t green[9] = { 0./255., 33./255., 68./255., 109./255., 140./255., 171./255., 192./255., 196./255., 209./255.};
3339 Double_t blue[9] = { 116./255., 137./255., 173./255., 201./255., 200./255., 201./255., 203./255., 190./255., 187./255.};
3347 Double_t red[9] = { 31./255., 71./255., 123./255., 160./255., 210./255., 222./255., 214./255., 199./255., 183./255.};
3348 Double_t green[9] = { 40./255., 117./255., 171./255., 211./255., 231./255., 220./255., 190./255., 132./255., 65./255.};
3349 Double_t blue[9] = { 234./255., 214./255., 228./255., 222./255., 210./255., 160./255., 105./255., 60./255., 34./255.};
3357 Double_t red[9] = { 123./255., 108./255., 109./255., 126./255., 154./255., 172./255., 188./255., 196./255., 218./255.};
3358 Double_t green[9] = { 184./255., 138./255., 130./255., 133./255., 154./255., 175./255., 188./255., 196./255., 218./255.};
3359 Double_t blue[9] = { 208./255., 130./255., 109./255., 99./255., 110./255., 122./255., 150./255., 171./255., 218./255.};
3367 Double_t red[9] = { 105./255., 106./255., 122./255., 143./255., 159./255., 172./255., 176./255., 181./255., 207./255.};
3368 Double_t green[9] = { 252./255., 197./255., 194./255., 187./255., 174./255., 162./255., 153./255., 136./255., 125./255.};
3369 Double_t blue[9] = { 146./255., 133./255., 144./255., 155./255., 163./255., 167./255., 166./255., 162./255., 174./255.};
3377 Double_t red[9] = { 171./255., 141./255., 145./255., 152./255., 154./255., 159./255., 163./255., 158./255., 177./255.};
3378 Double_t green[9] = { 236./255., 143./255., 100./255., 63./255., 53./255., 55./255., 44./255., 31./255., 6./255.};
3379 Double_t blue[9] = { 59./255., 48./255., 46./255., 44./255., 42./255., 54./255., 82./255., 112./255., 179./255.};
3387 Double_t red[9] = { 180./255., 190./255., 209./255., 223./255., 204./255., 228./255., 205./255., 152./255., 91./255.};
3388 Double_t green[9] = { 93./255., 125./255., 147./255., 172./255., 181./255., 224./255., 233./255., 198./255., 158./255.};
3389 Double_t blue[9] = { 236./255., 218./255., 160./255., 133./255., 114./255., 132./255., 162./255., 220./255., 218./255.};
3397 Double_t red[9] = { 225./255., 183./255., 162./255., 135./255., 115./255., 111./255., 119./255., 145./255., 211./255.};
3398 Double_t green[9] = { 205./255., 177./255., 166./255., 135./255., 124./255., 117./255., 117./255., 132./255., 172./255.};
3399 Double_t blue[9] = { 186./255., 165./255., 155./255., 135./255., 126./255., 130./255., 150./255., 178./255., 226./255.};
3407 Double_t red[9] = { 39./255., 43./255., 59./255., 63./255., 80./255., 116./255., 153./255., 177./255., 223./255.};
3408 Double_t green[9] = { 39./255., 43./255., 59./255., 74./255., 91./255., 114./255., 139./255., 165./255., 223./255.};
3409 Double_t blue[9] = { 39./255., 50./255., 59./255., 70./255., 85./255., 115./255., 151./255., 176./255., 223./255.};
3417 Double_t red[9] = { 0./255., 38./255., 60./255., 76./255., 84./255., 89./255., 101./255., 128./255., 204./255.};
3418 Double_t green[9] = { 0./255., 10./255., 15./255., 23./255., 35./255., 57./255., 83./255., 123./255., 199./255.};
3419 Double_t blue[9] = { 0./255., 11./255., 22./255., 40./255., 63./255., 86./255., 97./255., 94./255., 85./255.};
3427 Double_t red[9] = { 94./255., 112./255., 141./255., 165./255., 167./255., 140./255., 91./255., 49./255., 27./255.};
3428 Double_t green[9] = { 27./255., 46./255., 88./255., 135./255., 166./255., 161./255., 135./255., 97./255., 58./255.};
3429 Double_t blue[9] = { 42./255., 52./255., 81./255., 106./255., 139./255., 158./255., 155./255., 137./255., 116./255.};
3437 Double_t red[9] = { 30./255., 49./255., 79./255., 117./255., 135./255., 151./255., 146./255., 138./255., 147./255.};
3438 Double_t green[9] = { 63./255., 60./255., 72./255., 90./255., 94./255., 94./255., 68./255., 46./255., 16./255.};
3439 Double_t blue[9] = { 18./255., 28./255., 41./255., 56./255., 62./255., 63./255., 50./255., 36./255., 21./255.};
3447 Double_t red[9] = { 0./255., 30./255., 63./255., 101./255., 143./255., 152./255., 169./255., 187./255., 230./255.};
3448 Double_t green[9] = { 0./255., 14./255., 28./255., 42./255., 58./255., 61./255., 67./255., 74./255., 91./255.};
3449 Double_t blue[9] = { 39./255., 26./255., 21./255., 18./255., 15./255., 14./255., 14./255., 13./255., 13./255.};
3457 Double_t red[9] = { 149./255., 140./255., 164./255., 179./255., 182./255., 181./255., 131./255., 87./255., 61./255.};
3458 Double_t green[9] = { 62./255., 70./255., 107./255., 136./255., 144./255., 138./255., 117./255., 87./255., 74./255.};
3459 Double_t blue[9] = { 40./255., 38./255., 45./255., 49./255., 49./255., 49./255., 38./255., 32./255., 34./255.};
3467 Double_t red[9] = { 99./255., 112./255., 148./255., 165./255., 179./255., 182./255., 183./255., 183./255., 208./255.};
3468 Double_t green[9] = { 39./255., 40./255., 57./255., 79./255., 104./255., 127./255., 148./255., 161./255., 198./255.};
3469 Double_t blue[9] = { 15./255., 16./255., 18./255., 33./255., 51./255., 79./255., 103./255., 129./255., 177./255.};
3477 Double_t red[9] = { 99./255., 116./255., 154./255., 174./255., 200./255., 196./255., 201./255., 201./255., 230./255.};
3478 Double_t green[9] = { 0./255., 0./255., 8./255., 32./255., 58./255., 83./255., 119./255., 136./255., 173./255.};
3479 Double_t blue[9] = { 5./255., 6./255., 7./255., 9./255., 9./255., 14./255., 17./255., 19./255., 24./255.};
3487 Double_t red[9] = { 82./255., 106./255., 126./255., 141./255., 155./255., 163./255., 142./255., 107./255., 66./255.};
3488 Double_t green[9] = { 62./255., 44./255., 69./255., 107./255., 135./255., 152./255., 149./255., 132./255., 119./255.};
3489 Double_t blue[9] = { 39./255., 25./255., 31./255., 60./255., 73./255., 68./255., 49./255., 72./255., 188./255.};
3497 Double_t red[9] = { 18./255., 29./255., 44./255., 72./255., 116./255., 158./255., 184./255., 208./255., 221./255.};
3498 Double_t green[9] = { 27./255., 46./255., 71./255., 105./255., 146./255., 177./255., 189./255., 190./255., 183./255.};
3499 Double_t blue[9] = { 39./255., 55./255., 80./255., 108./255., 130./255., 133./255., 124./255., 100./255., 76./255.};
3507 Double_t red[9] = { 0./255., 48./255., 119./255., 173./255., 212./255., 224./255., 228./255., 228./255., 245./255.};
3508 Double_t green[9] = { 0./255., 13./255., 30./255., 47./255., 79./255., 127./255., 167./255., 205./255., 245./255.};
3509 Double_t blue[9] = { 0./255., 68./255., 75./255., 43./255., 16./255., 22./255., 55./255., 128./255., 245./255.};
3517 Double_t red[9] = { 34./255., 70./255., 129./255., 187./255., 225./255., 226./255., 216./255., 193./255., 179./255.};
3518 Double_t green[9] = { 48./255., 91./255., 147./255., 194./255., 226./255., 229./255., 196./255., 110./255., 12./255.};
3519 Double_t blue[9] = { 234./255., 212./255., 216./255., 224./255., 206./255., 110./255., 53./255., 40./255., 29./255.};
3527 Double_t red[9] = { 30./255., 55./255., 103./255., 147./255., 174./255., 203./255., 188./255., 151./255., 105./255.};
3528 Double_t green[9] = { 0./255., 65./255., 138./255., 182./255., 187./255., 175./255., 121./255., 53./255., 9./255.};
3529 Double_t blue[9] = { 191./255., 202./255., 212./255., 208./255., 171./255., 140./255., 97./255., 57./255., 30./255.};
3537 Double_t red[9] = { 112./255., 97./255., 113./255., 125./255., 138./255., 159./255., 178./255., 188./255., 225./255.};
3538 Double_t green[9] = { 16./255., 17./255., 24./255., 37./255., 56./255., 81./255., 110./255., 136./255., 189./255.};
3539 Double_t blue[9] = { 38./255., 35./255., 46./255., 59./255., 78./255., 103./255., 130./255., 152./255., 201./255.};
3547 Double_t red[9] = { 18./255., 72./255., 5./255., 23./255., 29./255., 201./255., 200./255., 98./255., 29./255.};
3548 Double_t green[9] = { 0./255., 0./255., 43./255., 167./255., 211./255., 117./255., 0./255., 0./255., 0./255.};
3549 Double_t blue[9] = { 51./255., 203./255., 177./255., 26./255., 10./255., 9./255., 8./255., 3./255., 0./255.};
3557 Double_t red[9] = { 19./255., 42./255., 64./255., 88./255., 118./255., 147./255., 175./255., 187./255., 205./255.};
3558 Double_t green[9] = { 19./255., 55./255., 89./255., 125./255., 154./255., 169./255., 161./255., 129./255., 70./255.};
3559 Double_t blue[9] = { 19./255., 32./255., 47./255., 70./255., 100./255., 128./255., 145./255., 130./255., 75./255.};
3567 Double_t red[9] = { 33./255., 31./255., 42./255., 68./255., 86./255., 111./255., 141./255., 172./255., 227./255.};
3568 Double_t green[9] = { 255./255., 175./255., 145./255., 106./255., 88./255., 55./255., 15./255., 0./255., 0./255.};
3569 Double_t blue[9] = { 255./255., 205./255., 202./255., 203./255., 208./255., 205./255., 203./255., 206./255., 231./255.};
3577 Double_t red[9] = { 0./255., 25./255., 50./255., 79./255., 110./255., 145./255., 181./255., 201./255., 254./255.};
3578 Double_t green[9] = { 0./255., 16./255., 30./255., 46./255., 63./255., 82./255., 101./255., 124./255., 179./255.};
3579 Double_t blue[9] = { 0./255., 12./255., 21./255., 29./255., 39./255., 49./255., 61./255., 74./255., 103./255.};
3587 Double_t red[9] = { 0./255., 13./255., 30./255., 44./255., 72./255., 120./255., 156./255., 200./255., 247./255.};
3588 Double_t green[9] = { 0./255., 36./255., 84./255., 117./255., 141./255., 153./255., 151./255., 158./255., 247./255.};
3589 Double_t blue[9] = { 0./255., 94./255., 100./255., 82./255., 56./255., 66./255., 76./255., 131./255., 247./255.};
3597 Double_t red[9] = { 26./255., 51./255., 43./255., 33./255., 28./255., 35./255., 74./255., 144./255., 246./255.};
3598 Double_t green[9] = { 9./255., 24./255., 55./255., 87./255., 118./255., 150./255., 180./255., 200./255., 222./255.};
3599 Double_t blue[9] = { 30./255., 96./255., 112./255., 114./255., 112./255., 101./255., 72./255., 35./255., 0./255.};
3607 Double_t red[9] = { 0./255., 5./255., 65./255., 97./255., 124./255., 156./255., 189./255., 224./255., 255./255.};
3608 Double_t green[9] = { 32./255., 54./255., 77./255., 100./255., 123./255., 148./255., 175./255., 203./255., 234./255.};
3609 Double_t blue[9] = { 77./255., 110./255., 107./255., 111./255., 120./255., 119./255., 111./255., 94./255., 70./255.};
3615 ::Error(
"SetPalette",
"Unknown palette number %d", ncolors);
3618 paletteType = ncolors;
3621 if (alpha > 0.)
fgPalettesList.fArray[paletteType-51] += alpha/10.0f;
R__EXTERN TApplication * gApplication
static Int_t gDefinedColors
Number of defined colors.
static Float_t gColorThreshold
Color threshold used by GetColor.
static Int_t gLastDefinedColors
Previous number of defined colors.
static Int_t gHighestColorIndex
Highest color index defined.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pixel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char cname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint angle
void InitializeGraphics(Bool_t only_web=kFALSE)
Initialize the graphics environment.
static void NeedGraphicsLibs()
Static method.
Array of doubles (64 bits per element).
Array of integers (32 bits per element).
The color creation and management class.
void Print(Option_t *option="") const override
Dump this color with its attributes.
static Int_t GetFirstFreeColorIndex()
Static function: Returns the first free color greater in the list of colors.
Float_t fSaturation
Saturation.
static void SetPalette(Int_t ncolors, Int_t *colors, Float_t alpha=1.)
Static function.
static Int_t GetLinearGradient(Double_t angle, const std::vector< Int_t > &colors, const std::vector< Double_t > &positions={})
Static function: Returns the linear gradient color number corresponding to specified parameters.
static void HLS2RGB(Float_t h, Float_t l, Float_t s, Float_t &r, Float_t &g, Float_t &b)
Static method to compute RGB from HLS.
virtual void SetRGB(Float_t r, Float_t g, Float_t b)
Initialize this color and its "dark" and "bright" associated colors.
static void RGBtoHLS(Float_t r, Float_t g, Float_t b, Float_t &h, Float_t &l, Float_t &s)
static Float_t HLStoRGB1(Float_t rn1, Float_t rn2, Float_t huei)
Static method. Auxiliary to HLS2RGB().
static Int_t GetRadialGradient(Double_t r, const std::vector< Int_t > &colors, const std::vector< Double_t > &positions={})
Static function: Returns the radial gradient color number corresponding to specified parameters.
static Int_t GetColorPalette(Int_t i)
Static function returning the color number i in current palette.
static const TArrayI & GetPalette()
Static function returning the current active palette.
void ls(Option_t *option="") const override
List this color with its attributes.
static Bool_t SaveColor(std::ostream &out, Int_t ci)
Save a color with index > 228 as a C++ statement(s) on output stream out.
static ULong_t RGB2Pixel(Int_t r, Int_t g, Int_t b)
Convert r,g,b to graphics system dependent pixel value.
static ULong_t Number2Pixel(Int_t ci)
Static method that given a color index number, returns the corresponding pixel value.
static void RGB2HSV(Float_t r, Float_t g, Float_t b, Float_t &h, Float_t &s, Float_t &v)
Static method to compute HSV from RGB.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
static void InitializeColors()
Initialize colors used by the TCanvas based graphics (via TColor objects).
static void HSV2RGB(Float_t h, Float_t s, Float_t v, Float_t &r, Float_t &g, Float_t &b)
Static method to compute RGB from HSV:
Float_t fAlpha
Alpha (transparency)
void Copy(TObject &color) const override
Copy this color to obj.
static void InvertPalette()
Invert the current color palette.
static void CreateColorWheel()
Static function steering the creation of all colors in the color wheel.
static Int_t GetColorByName(const char *colorname)
Static method returning color index for a color specified by name.
void SetName(const char *name) override
Set the color name and change also the name of the "dark" and "bright" associated colors if they exis...
static Int_t GetColorBright(Int_t color)
Static function: Returns the bright color number corresponding to n If the TColor object does not exi...
static Bool_t IsGrayscale()
Return whether all colors return grayscale values.
static void Pixel2RGB(ULong_t pixel, Int_t &r, Int_t &g, Int_t &b)
Convert machine dependent pixel value (obtained via RGB2Pixel or via Number2Pixel() or via TColor::Ge...
const char * AsHexString() const
Return color as hexadecimal string.
static Int_t GetColorDark(Int_t color)
Static function: Returns the dark color number corresponding to n If the TColor object does not exist...
static Int_t CreateGradientColorTable(UInt_t Number, Double_t *Stops, Double_t *Red, Double_t *Green, Double_t *Blue, UInt_t NColors, Float_t alpha=1., Bool_t setPalette=kTRUE)
Static function creating a color table with several connected linear gradients.
static const char * PixelAsHexString(ULong_t pixel)
Convert machine dependent pixel value (obtained via RGB2Pixel or via Number2Pixel() or via TColor::Ge...
void Allocate()
Make this color known to the graphics system.
ULong_t GetPixel() const
Return pixel value corresponding to this color.
static Int_t CreateColorTableFromFile(TString fileName, Float_t alpha=1.)
Static function creating a color palette based on an input text file.
static void SetColorThreshold(Float_t t)
This method specifies the color threshold used by GetColor to retrieve a color.
static Bool_t DefinedColors(Int_t set_always_on=0)
Static method returning kTRUE if some new colors have been defined after initialisation or since the ...
Float_t fGreen
Fraction of Green.
static void CreateColorsCircle(Int_t offset, const char *name, UChar_t *rgb)
Create the "circle" colors in the color wheel.
TColor & operator=(const TColor &color)
static Int_t GetNumberOfColors()
Static function returning number of colors in the color palette.
static Int_t GetFreeColorIndex()
Static function: Returns the free color index greater than the highest defined color index.
Float_t GetSaturation() const
static void HLStoRGB(Float_t h, Float_t l, Float_t s, Float_t &r, Float_t &g, Float_t &b)
static void ListColors(Int_t ci1=0, Int_t ci2=0, Bool_t showEmpty=kFALSE)
List nb colors from the color index ci.
TColor()
Default constructor.
Int_t fNumber
Color number identifier.
static void CreateColorsRectangle(Int_t offset, const char *name, UChar_t *rgb)
Create the "rectangular" colors in the color wheel.
Float_t fBlue
Fraction of Blue.
static void CreateColorsGray()
Create the Gray scale colors in the Color Wheel.
virtual void SetAlpha(Float_t a)
virtual ~TColor()
Color destructor.
Float_t fRed
Fraction of Red.
static void RGB2HLS(Float_t r, Float_t g, Float_t b, Float_t &h, Float_t &l, Float_t &s)
Static method to compute HLS from RGB.
static Int_t GetColorTransparent(Int_t color, Float_t a)
Static function: Returns the transparent color number corresponding to n.
static void SetGrayscale(Bool_t set=kTRUE)
Set whether all colors should return grayscale values.
The TNamed class is the base class for all named ROOT classes.
void Copy(TObject &named) const override
Copy this to obj.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
Int_t GetLast() const override
Return index of last object in array.
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
ULong_t fPixel
color pixel value (index in color table)
UShort_t fRed
red component (0..65535)
UShort_t fGreen
green component (0..65535)
UShort_t fBlue
blue component (0..65535)
UShort_t fMask
mask telling which color components are valid