20 auto c1 =
new TCanvas(
"c1",
"triangles", 10, 10, 700, 700);
28 x[0] =
r.Uniform(.05, .95);
29 y[0] =
r.Uniform(.05, .95);
30 x[1] =
x[0] +
dx *
r.Rndm();
31 y[1] =
y[0] +
dy *
r.Rndm();
32 x[2] =
x[1] -
dx *
r.Rndm();
33 y[2] =
y[1] -
dy *
r.Rndm();
38 int ci = ncolors *
r.Rndm();
40 c->SetAlpha(
r.Rndm());
41 pl->SetFillColor(
c->GetNumber());
44 c1->AddExec(
"ex",
"TriangleClicked()");
52 int event =
gPad->GetEvent();
60 printf(
"You have clicked triangle %d, color=%d\n",
pl->GetUniqueID(),
pl->GetFillColor());
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
R__EXTERN TStyle * gStyle
The color creation and management class.
static Int_t GetColorPalette(Int_t i)
Static function returning the color number i in current palette.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
static Int_t GetNumberOfColors()
Static function returning number of colors in the color palette.
Mother of all ROOT objects.
Defined by an array on N points in a 2-D space.
This is the base class for the ROOT Random number generators.
void SetPalette(Int_t ncolors=kBird, Int_t *colors=nullptr, Float_t alpha=1.)
See TColor::SetPalette.