26 Int_t indices[2] = {};
27 if (ROOT::GLTutorials::FindFreeCustomColorIndices(indices) != 2) {
28 ::Error(
"transp",
"failed to create new custom colors");
33 const Int_t redIndex = indices[0], greeIndex = indices[1];
35 new TColor(redIndex, 1., 0., 0.,
"red", 0.85);
36 new TColor(greeIndex, 0., 1., 0.,
"green", 0.5);
38 gStyle->SetCanvasPreferGL(kTRUE);
39 TCanvas *
const cnv =
new TCanvas(
"trasnparency",
"transparency demo", 600, 400);
41 TH1F *
const hist =
new TH1F(
"a5",
"b5", 10, -2., 3.);
42 TH1F *
const hist2 =
new TH1F(
"c6",
"d6", 10, -3., 3.);
43 hist->FillRandom(
"landau", 100000);
44 hist2->FillRandom(
"gaus", 100000);
46 hist->SetFillColor(redIndex);
47 hist2->SetFillColor(greeIndex);