Prepare for the new TPC layout
[u/mrichter/AliRoot.git] / EVE / macros / bright_colors.C
CommitLineData
29207369 1void bright_colors(Float_t value=1)
2{
3 // Notes:
4 // you can store the original colors by creating a clone of
5 // (TObjArray*)gROOT->GetListOfColors() and restore the colors by
6 // assigning the vector with original values to the list of colors
7 // that gROOT handles.
8
9 if (value > 5)
10 {
11 printf("Value %f too high - maximum is 5.\n", value);
12 return;
13 }
14 value *= 0.1f;
15
16 TObjArray *colors = (TObjArray*) gROOT->GetListOfColors();
17 TColor *color = 0;
18 Float_t r, g, b;
19 for (int i = 0; i < colors->GetSize(); ++i)
20 {
21 if ((color = dynamic_cast<TColor*>(colors->At(i))) != 0)
22 {
23 color->GetRGB(r, g, b);
24 if (r < 0.01 && g < 0.01 && b < 0.01) continue; // skip black
25 if (r > 0.95 && g > 0.95 && b > 0.95) continue; // skip white
26 r = TMath::Min(r + value, 1.0f);
27 g = TMath::Min(g + value, 1.0f);
28 b = TMath::Min(b + value, 1.0f);
29 color->SetRGB(r, g, b);
30 }
31 }
32
33 if (gEve)
34 gEve->FullRedraw3D();
35}