44 assert(nPoints != 0 &&
"TColorGradient, number of points is 0");
45 assert(
points !=
nullptr &&
"TColorGradient, points parameter is null");
46 assert(indices !=
nullptr &&
"TColorGradient, indices parameter is null");
60 assert(nPoints != 0 &&
"TColorGradient, number of points is 0");
61 assert(
points !=
nullptr &&
"TColorGradient, points parameter is null");
62 assert(
colors !=
nullptr &&
"TColorGradient, colors parameter is null");
73 assert(nPoints != 0 &&
"ResetColor, number of points is 0");
74 assert(
points !=
nullptr &&
"ResetColor, points parameter is null");
75 assert(colorIndices !=
nullptr &&
"ResetColor, colorIndices parameter is null");
77 std::vector<Double_t>
colors(nPoints * 4);
79 for (
UInt_t i = 0, pos = 0; i < nPoints; ++i, pos += 4) {
80 const TColor *clearColor =
gROOT->GetColor(colorIndices[i]);
82 Error(
"ResetColor",
"Bad color for index %d, set to opaque black", colorIndices[i]);
89 Warning(
"ResetColor",
"Gradient color index %d used as base for other gradient color", colorIndices[i]);
106 assert(nPoints != 0 &&
"ResetColor, number of points is 0");
107 assert(
points !=
nullptr &&
"ResetColor, points parameter is null");
108 assert(
colors !=
nullptr &&
"ResetColor, colors parameter is null");
118#pragma clang loop vectorize(disable)
132 if (indx*4 + 3 <
fColors.size())
141 if (indx*4 + 3 <
fColors.size())
196 if (
gROOT->GetColor(colorIndex)) {
197 Warning(
"RegisterColor",
"Color with index %d is already defined", colorIndex);
202 colors->AddAtAndExpand(
this, colorIndex);
204 Error(
"RegisterColor",
"List of colors is a null pointer in gROOT, color was not registered");
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
double Double_t
Double 8 bytes.
short Color_t
Color number (short).
TColorGradient extends basic TColor.
void RegisterColor(Color_t colorIndex)
Register color.
const Double_t * GetColors() const
Get colors.
std::vector< Double_t > fColorPositions
std::vector< Color_t >::size_type SizeType_t
Double_t GetColorAlpha(UInt_t indx) const
Return alpha parameter of selected color.
void SetCoordinateMode(ECoordinateMode mode)
Set coordinate mode.
void ResetColor(UInt_t nPoints, const Double_t *points, const Color_t *colorIndices)
Reset color.
void SetColorAlpha(UInt_t indx, Double_t alpha)
Change alpha parameter of the color.
SizeType_t GetNumberOfSteps() const
Get number of steps.
ECoordinateMode fCoordinateMode
ECoordinateMode GetCoordinateMode() const
Get coordinate mode.
const Double_t * GetColorPositions() const
Get color positions.
std::vector< Double_t > fColors
void SetName(const char *name) override
Set the name of the TNamed.
Int_t fNumber
Color number identifier.
virtual void SetAlpha(Float_t a)
virtual void SetRGB(Float_t r, Float_t g, Float_t b)
void SetStartEnd(const Point &p1, const Point &p2)
Set end and start.
const Point & GetEnd() const
Get end.
const Point & GetStart() const
Get start.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Double_t GetRadius() const
Get radius.
void SetStartEndR1R2(const Point &p1, Double_t r1, const Point &p2, Double_t r2)
Set start and end R1 and R2.
const Point & GetStart() const
Get start.
Double_t GetR2() const
Get R2.
const Point & GetCenter() const
Get center.
EGradientType GetGradientType() const
Get gradient type.
const Point & GetEnd() const
Get end.
void SetRadialGradient(const Point ¢er, Double_t radius)
Set radial gradient.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
static uint64_t sum(uint64_t i)