How to use custom colours created in personal root style

Hi,

I would like to create some custom colours in my own RootStyle.h like so

{
TStyle *exampleStyle = new TStyle("exampleStyle", "");
...
const auto kC0 = TColor::GetFreeColorIndex();
const auto new_col_c0 = TColor(kC0, 0.12156862745098039, 0.4666666666666667, 0.7058823529411765, "C0");
...
gROOT->SetStyle("exampleStyle");
}

And then use this in my own scripts like so:

gROOT->ProcessLine(".L RootStyle.h");
auto histFillColour = kC0;

How would I go about doing this? (At the moment kC0 is not found in the scope, which is probably not a surprise)

Or is it easier to just move this to some utilitity class?

Thanks!

Welcome to the ROOT forum.

Colors definitions are not part of the styles.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.