Draw series of histograms using random colours

Dear co-rooters,

I am creating quite a lot of histograms using the following code

for (int dt = 100; dt<=500; dt=dt+20){ TH1F *hyieldCut = new TH1F(TString::Format("hyieldCut%d_%d", det, dt),TString::Format("Cut Yield - %d ns - #%d; Neutron energy (eV); Counts (arb. units)", dt, det),nbins,ebins); < calculations > TFile fout(TString::Format("DeltaT_%d_%d_PileUp.root", run, det),"UPDATE"); hyieldCut->SetLineColor(????);//<---- Here's the tricky part hyieldCut->Write(); fout.Close(); hyieldCut->Delete(); }

The tricky part is that I would like to save those histograms, using a different line color for each, avoiding red and white. I could use the basic colors but the look a lot the same (for instance from 10 to 19). For some reason this seems to be tricky at the moment!

Any ideas are more than welcome!

Thanks in advance!

A possible suggestion

// Compose your palette
int mycolors[] = {kBlue, kViolet, kMagenta, kPink, kOrange, kYellow, kSpring, kGreen, kTeal, kCyan, kAzure, kGray, kGray+1, kGray+3 };


 hyieldCut->SetLineColor( mycolors[ dt/20 ] );