20void gradients(
bool gl =
true)
27 gStyle->SetCanvasPreferGL(gl);
29 auto c =
new TCanvas(
"cpie",
"Gradient colours demo", 700, 700);
31 if (!
c->UseGL() && !
c->IsWeb())
32 ::Warning(
"gradients",
"This macro requires either OpenGL or Web canvas to correctly handle gradient colors");
44 auto t =
new TText(0.05, 0.7,
"Can you see the text?");
50 auto pad =
new TPad(
"p",
"p", 0., 0., 1., 1.);
54 pad->SetFillColor(transparentFill);
72 c->SetFillColor(linearFill);
76 Double_t values[nSlices] = {0.8, 1.2, 1.2, 0.8, 1.};
77 Int_t colors[nSlices] = {radialFill, radialFill, radialFill, radialFill, radialFill};
79 TPie *
const pie =
new TPie(
"pie",
"TPie:", nSlices, values,
colors);
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
static Int_t GetRadialGradient(Double_t r, const std::vector< Int_t > &colors, const std::vector< Double_t > &positions={})
static Int_t GetLinearGradient(Double_t angle, const std::vector< Int_t > &colors, const std::vector< Double_t > &positions={})
static Int_t GetColor(const char *hexcolor)
The most important graphics class in the ROOT system.
void SetLabelsOffset(Float_t)
void SetEntryRadiusOffset(Int_t, Double_t)
void Draw(Option_t *option="l") override
Default Draw method for all objects.