41 : fCoordinateMode(kObjectBoundingMode)
53 assert(nPoints != 0 &&
"TColorGradient, number of points is 0");
54 assert(points != 0 &&
"TColorGradient, points parameter is null");
55 assert(indices != 0 &&
"TColorGradient, indices parameter is null");
69 assert(nPoints != 0 &&
"TColorGradient, number of points is 0");
70 assert(points != 0 &&
"TColorGradient, points parameter is null");
71 assert(colors != 0 &&
"TColorGradient, colors parameter is null");
82 assert(nPoints != 0 &&
"ResetColor, number of points is 0");
83 assert(points != 0 &&
"ResetColor, points parameter is null");
84 assert(colorIndices != 0 &&
"ResetColor, colorIndices parameter is null");
90 for (
UInt_t i = 0, pos = 0; i < nPoints; ++i, pos += 4) {
91 const TColor *clearColor =
gROOT->GetColor(colorIndices[i]);
92 if (!clearColor || dynamic_cast<const TColorGradient *>(clearColor)) {
94 Error(
"ResetColor",
"Bad color for index %d, set to opaque black", colorIndices[i]);
100 clearColor->
GetRGB(rgba[0], rgba[1], rgba[2]);
116 assert(nPoints != 0 &&
"ResetColor, number of points is 0");
117 assert(points != 0 &&
"ResetColor, points parameter is null");
118 assert(colors != 0 &&
"ResetColor, colors parameter is null");
121 fColors.assign(colors, colors + nPoints * 4);
173 if (
gROOT->GetColor(colorIndex)) {
174 Warning(
"RegisterColor",
"Color with index %d is already defined", colorIndex);
179 colors->AddAtAndExpand(
this, colorIndex);
181 Error(
"RegisterColor",
"List of colors is a null pointer in gROOT, color was not registered");
Double_t GetRadius() const
Get radius.
const Point & GetCenter() const
Get center.
const Double_t * GetColorPositions() const
Get color positions.
ECoordinateMode GetCoordinateMode() const
Get coordinate mode.
virtual void SetName(const char *name)
Set the name of the TNamed.
SizeType_t GetNumberOfSteps() const
Get number of steps.
const Point & GetEnd() const
Get end.
std::vector< Double_t > fColorPositions
void SetRadialGradient(const Point ¢er, Double_t radius)
Set radial gradient.
Define a radial color gradient.
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
void SetStartEndR1R2(const Point &p1, Double_t r1, const Point &p2, Double_t r2)
Set start and end R1 and R2.
TColorGradient()
Constructor.
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)
Double_t GetR2() const
Get R2.
void SetCoordinateMode(ECoordinateMode mode)
Set coordinate mode.
std::vector< Double_t > fColors
void RegisterColor(Color_t colorIndex)
Register color.
std::vector< Color_t >::size_type SizeType_t
const Point & GetStart() const
Get start.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
static double p1(double t, double a, double b)
Int_t fNumber
Color number identifier.
Define a linear color gradient.
const Point & GetStart() const
Get start.
The color creation and management class.
void ResetColor(UInt_t nPoints, const Double_t *points, const Color_t *colorIndices)
Reset color.
EGradientType GetGradientType() const
Get gradient type.
const Double_t * GetColors() const
Get colors.
void SetStartEnd(const Point &p1, const Point &p2)
Set end and start.
const Point & GetEnd() const
Get end.
TColorGradient extends basic TColor.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
ECoordinateMode fCoordinateMode