32 ::Error(
"grad2",
"can not allocate new custom colors");
37 const Color_t customRed = freeIndices[0], grad1 = freeIndices[1];
38 const Color_t customGreen = freeIndices[2], grad2 = freeIndices[3];
44 TCanvas *
const cnv =
new TCanvas(
"gradiend demo 2",
"gradient demo 2", 100, 100, 800, 600);
46 ::Error(
"grad2",
"This macro requires OpenGL");
53 new TColor(customRed, 1., 0., 0.,
"red", 0.5);
66 const Double_t locations[] = {0., 1.};
72 gradFill1->
SetStartEnd(Point(0., 0.), Point(0., 1.));
75 new TColor(customGreen, 0., 1., 0.,
"green", 0.5);
82 gradFill2->
SetStartEnd(Point(0., 0.), Point(0., 1.));
84 TH1F *
const hist =
new TH1F(
"a2",
"b2", 10, -2., 3.);
85 TH1F *
const hist2 =
new TH1F(
"c3",
"d3", 10, -3., 3.);
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
R__EXTERN TStyle * gStyle
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
The color creation and management class.
1-D histogram with a float per channel (see TH1 documentation)}
virtual void FillRandom(const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr)
Fill histogram following distribution in function fname.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Define a linear color gradient.
void SetStartEnd(const Point &p1, const Point &p2)
Set end and start.
void SetCanvasPreferGL(Bool_t prefer=kTRUE)
unsigned FindFreeCustomColorIndices(T(&indices)[N])