ROOT hack for white fill color

Hi,

I find it hard to prevent ROOT from making gray backgrounds for TCanvas, TPaveStats, … objects consistently. E.g., the infamous color 19 keeps creeping in if you draw an additional TLegend or alike.
So I thought I’d address the problem by the ROOT (couldn’t possibly resist this pun, sorry) and tamper with the ROOT source files.
Searching for 19 wasn’t that hard, and I performed two changes that abolished ROOT’s liking of 19 (line numbers pertain to ROOT 5.22):
diff core/base/src/TStyle.cxx …/…/root/core/base/src/TStyle.cxx
381c381
< SetFillColor(19);

SetFillColor(0);
386c386
< fCanvasColor = 19;


fCanvasColor = 0;
420c420
< fFrameFillColor = 19;


fFrameFillColor = 0;

This made me happy for a while, i.e., until I drew my first TH2 in COLZ mode (enhanced palette) - see attachments.
Obviously, changing the two 19’s to 0’s had a side effect here.

Could someone tell me why that is? Can I somehow bleach the (ugly) gray without affecting my histograms?

Thanks,
Holger
grayBackgroundInTH2F.pdf (15.2 KB)
whiteBackgroundInTH2F.pdf (15.2 KB)

To avoid the gray I do the following in my rootlogon.C:

   gStyle->SetCanvasColor(0);
   gStyle->SetFrameBorderMode(0);
   gStyle->SetStatBorderSize(1);
   gStyle->SetFrameFillColor(0);
   gStyle->SetTitleFillColor(0);
   gStyle->SetPalette(1);
   gROOT->ForceStyle();