TH1D *histo = new TH1D("histo","Example Histogram", 10, 0, 10); histo->SetFillColor(2); // set fill color to red
TH1D *histo2 = new TH1D("histo2","Example Histogram 2", 20, 0, 20); histo2->SetFillColorAlpha(4,0.6); // set fill color to blue, alpha value to 0.6This example is similar to Example 1, except that SetFillColorAlpha method is used instead of SetFillColor. This method allows setting an alpha value for transparency. Here, the fill color is set to blue (code 4 in ROOT) and the alpha value is set to 0.6. Package library: ROOT Framework