42VTK_ABI_NAMESPACE_BEGIN
68 vtkColor3(
const T& red,
const T& green,
const T& blue)
71 this->
Data[1] = green;
79 void Set(
const T& red,
const T& green,
const T& blue)
82 this->
Data[1] = green;
136 vtkColor4(
const T& red,
const T& green,
const T& blue,
const T& alpha)
139 this->
Data[1] = green;
140 this->
Data[2] = blue;
141 this->
Data[3] = alpha;
148 void Set(
const T& red,
const T& green,
const T& blue)
151 this->
Data[1] = green;
152 this->
Data[2] = blue;
160 void Set(
const T& red,
const T& green,
const T& blue,
const T& alpha)
163 this->
Data[1] = green;
164 this->
Data[2] = blue;
165 this->
Data[3] = alpha;
232 unsigned int hex =
static_cast<unsigned int>(hexSigned);
233 this->
Data[2] = hex & 0xff;
235 this->
Data[1] = hex & 0xff;
237 this->
Data[0] = hex & 0xff;
333 unsigned int hex =
static_cast<unsigned int>(hexSigned);
334 this->
Data[3] = hex & 0xff;
336 this->
Data[2] = hex & 0xff;
338 this->
Data[1] = hex & 0xff;
340 this->
Data[0] = hex & 0xff;
344 vtkColor4ub(
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a = 255)
349 :
vtkColor4<unsigned char>(c[0], c[1], c[2], 255)
437 static_cast<unsigned char>(std::round(std::clamp(this->
Data[0] * 255.0f, 0.0f, 255.0f))),
438 static_cast<unsigned char>(std::round(std::clamp(this->
Data[1] * 255.0f, 0.0f, 255.0f))),
439 static_cast<unsigned char>(std::round(std::clamp(this->
Data[2] * 255.0f, 0.0f, 255.0f))));
444 return vtkColor3d(
static_cast<double>(this->
Data[0]),
static_cast<double>(this->
Data[1]),
445 static_cast<double>(this->
Data[2]));
453 static_cast<unsigned char>(std::round(std::clamp(this->
Data[0] * 255.0, 0.0, 255.0))),
454 static_cast<unsigned char>(std::round(std::clamp(this->
Data[1] * 255.0, 0.0, 255.0))),
455 static_cast<unsigned char>(std::round(std::clamp(this->
Data[2] * 255.0, 0.0, 255.0))));
460 return vtkColor3f(
static_cast<float>(this->
Data[0]),
static_cast<float>(this->
Data[1]),
461 static_cast<float>(this->
Data[2]));
469 this->
Data[0] / 255.0f, this->
Data[1] / 255.0f, this->
Data[2] / 255.0f, this->
Data[3] / 255.0f);
475 this->
Data[0] / 255.0, this->
Data[1] / 255.0, this->
Data[2] / 255.0, this->
Data[3] / 255.0);
483 static_cast<unsigned char>(std::round(std::clamp(this->
Data[0] * 255.0f, 0.0f, 255.0f))),
484 static_cast<unsigned char>(std::round(std::clamp(this->
Data[1] * 255.0f, 0.0f, 255.0f))),
485 static_cast<unsigned char>(std::round(std::clamp(this->
Data[2] * 255.0f, 0.0f, 255.0f))),
486 static_cast<unsigned char>(std::round(std::clamp(this->
Data[3] * 255.0f, 0.0f, 255.0f))));
491 return vtkColor4d(
static_cast<double>(this->
Data[0]),
static_cast<double>(this->
Data[1]),
492 static_cast<double>(this->
Data[2]),
static_cast<double>(this->
Data[3]));
500 static_cast<unsigned char>(std::round(std::clamp(this->
Data[0] * 255.0, 0.0, 255.0))),
501 static_cast<unsigned char>(std::round(std::clamp(this->
Data[1] * 255.0, 0.0, 255.0))),
502 static_cast<unsigned char>(std::round(std::clamp(this->
Data[2] * 255.0, 0.0, 255.0))),
503 static_cast<unsigned char>(std::round(std::clamp(this->
Data[3] * 255.0, 0.0, 255.0))));
508 return vtkColor4f(
static_cast<float>(this->
Data[0]),
static_cast<float>(this->
Data[1]),
509 static_cast<float>(this->
Data[2]),
static_cast<float>(this->
Data[3]));
vtkColor3(const T &scalar)
void SetGreen(const T &green)
Set the green component of the color, i.e.
void Set(const T &red, const T &green, const T &blue)
Set the red, green and blue components of the color.
const T & GetBlue() const
Get the blue component of the color, i.e.
void SetRed(const T &red)
Set the red component of the color, i.e.
const T & GetRed() const
Get the red component of the color, i.e.
vtkColor3(const T &red, const T &green, const T &blue)
const T & GetGreen() const
Get the green component of the color, i.e.
void SetBlue(const T &blue)
Set the blue component of the color, i.e.
vtkColor3d(const double *init)
vtkColor3d(double scalar)
vtkColor3f ToFloat() const
Convert to vtkColor3f with a simple static_cast.
vtkColor3d(double r, double g, double b)
vtkColor3ub ToUnsignedChar() const
Convert to vtkColor3ub by scaling from [0.0,1.0] to [0,255].
vtkColor3f(float r, float g, float b)
vtkColor3d ToDouble() const
Convert to vtkColor3d with a simple static_cast.
vtkColor3f(const float *init)
vtkColor3ub ToUnsignedChar() const
Convert to vtkColor3ub by scaling from [0.0,1.0] to [0,255].
Some derived classes for the different colors commonly used.
vtkColor3ub(unsigned char r, unsigned char g, unsigned char b)
vtkColor3ub(unsigned char scalar)
vtkColor3d ToDouble() const
Convert to vtkColor3d by scaling from [0,255] to [0.0,1.0].
vtkColor3f ToFloat() const
Convert to vtkColor3f by scaling from [0,255] to [0.0,1.0].
vtkColor3ub(int hexSigned)
Construct a color from a hexadecimal representation such as 0x0000FF (blue).
vtkColor3ub(const unsigned char *init)
const T & GetAlpha() const
Get the alpha component of the color, i.e.
void SetAlpha(const T &alpha)
Set the alpha component of the color, i.e.
vtkColor4(const T &scalar)
void Set(const T &red, const T &green, const T &blue, const T &alpha)
Set the red, green, blue and alpha components of the color.
vtkColor4(const T &red, const T &green, const T &blue, const T &alpha)
void SetRed(const T &red)
Set the red component of the color, i.e.
const T & GetBlue() const
Get the blue component of the color, i.e.
void SetBlue(const T &blue)
Set the blue component of the color, i.e.
const T & GetGreen() const
Get the green component of the color, i.e.
void SetGreen(const T &green)
Set the green component of the color, i.e.
void Set(const T &red, const T &green, const T &blue)
Set the red, green and blue components of the color.
const T & GetRed() const
Get the red component of the color, i.e.
vtkColor4d(double r, double g, double b, double a=1.0)
vtkColor4f ToFloat() const
Convert to vtkColor4f with a simple static_cast.
vtkColor4d(const double *init)
vtkColor4d(double scalar)
vtkColor4ub ToUnsignedChar() const
Convert to vtkColor4ub by scaling from [0.0,1.0] to [0,255].
vtkColor4f(float r, float g, float b, float a=1.0)
vtkColor4ub ToUnsignedChar() const
Convert to vtkColor4ub by scaling from [0.0,1.0] to [0,255].
vtkColor4f(const float *init)
vtkColor4d ToDouble() const
Convert to vtkColor4d with a simple static_cast.
vtkColor4d ToDouble() const
Convert to vtkColor4d by scaling from [0,255] to [0.0,1.0].
vtkColor4ub(int hexSigned)
Construct a color from a hexadecimal representation such as 0x0000FFAA (opaque blue).
vtkColor4f ToFloat() const
Convert to vtkColor4f by scaling from [0,255] to [0.0,1.0].
vtkColor4ub(const vtkColor3ub &c)
vtkColor4ub(unsigned char scalar)
vtkColor4ub(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
vtkColor4ub(const unsigned char *init)