38 : fCoordinateMode(kObjectBoundingMode)
48 : fCoordinateMode(mode)
50 assert(nPoints != 0 &&
"TColorGradient, number of points is 0");
51 assert(points != 0 &&
"TColorGradient, points parameter is null");
52 assert(indices != 0 &&
"TColorGradient, indices parameter is null");
64 : fCoordinateMode(mode)
66 assert(nPoints != 0 &&
"TColorGradient, number of points is 0");
67 assert(points != 0 &&
"TColorGradient, points parameter is null");
68 assert(colors != 0 &&
"TColorGradient, colors parameter is null");
79 assert(nPoints != 0 &&
"ResetColor, number of points is 0");
80 assert(points != 0 &&
"ResetColor, points parameter is null");
81 assert(colorIndices != 0 &&
"ResetColor, colorIndices parameter is null");
87 for (
UInt_t i = 0, pos = 0; i < nPoints; ++i, pos += 4) {
88 const TColor *clearColor =
gROOT->GetColor(colorIndices[i]);
89 if (!clearColor || dynamic_cast<const TColorGradient *>(clearColor)) {
91 Error(
"ResetColor",
"Bad color for index %d, set to opaque black", colorIndices[i]);
97 clearColor->
GetRGB(rgba[0], rgba[1], rgba[2]);
113 assert(nPoints != 0 &&
"ResetColor, number of points is 0");
114 assert(points != 0 &&
"ResetColor, points parameter is null");
115 assert(colors != 0 &&
"ResetColor, colors parameter is null");
118 fColors.assign(colors, colors + nPoints * 4);
170 if (
gROOT->GetColor(colorIndex)) {
171 Warning(
"RegisterColor",
"Color with index %d is already defined", colorIndex);
176 colors->AddAtAndExpand(
this, colorIndex);
178 Error(
"RegisterColor",
"List of colors is a null pointer in gROOT, color was not registered");
ECoordinateMode GetCoordinateMode() const
Get coordinate mode.
virtual void SetName(const char *name)
Change (i.e.
std::vector< Double_t > fColorPositions
void SetRadialGradient(const Point ¢er, Double_t radius)
Set radial gradient.
const Point & GetCenter() const
Get center.
Define a radial color gradient.
Double_t GetR2() const
Get R2.
void SetStartEndR1R2(const Point &p1, Double_t r1, const Point &p2, Double_t r2)
Set start and end R1 and R2.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
static double p2(double t, double a, double b, double c)
void SetCoordinateMode(ECoordinateMode mode)
Set coordinate mode.
const Point & GetEnd() const
Get end.
std::vector< Double_t > fColors
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void RegisterColor(Color_t colorIndex)
Register color.
std::vector< Color_t >::size_type SizeType_t
Double_t GetRadius() const
Get radius.
SizeType_t GetNumberOfSteps() const
Get number of steps.
unsigned int r1[N_CITIES]
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
const Point & GetEnd() const
Get end.
static double p1(double t, double a, double b)
ClassImp(TColorGradient) TColorGradient
Constructor.
Define a linear color gradient.
EGradientType GetGradientType() const
Get gradient type.
const Double_t * GetColors() const
Get colors.
The color creation and management class.
const Point & GetStart() const
Get start.
void ResetColor(UInt_t nPoints, const Double_t *points, const Color_t *colorIndices)
Reset color.
const Double_t * GetColorPositions() const
Get color positions.
void SetStartEnd(const Point &p1, const Point &p2)
Set end and start.
const Point & GetStart() const
Get start.
TColorGradient extends basic TColor.
unsigned int r2[N_CITIES]
ECoordinateMode fCoordinateMode
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.