VTK  9.3.20240415
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
vtkNamedColors Class Reference

A class holding colors and their names. More...

#include <vtkNamedColors.h>

Inheritance diagram for vtkNamedColors:
[legend]
Collaboration diagram for vtkNamedColors:
[legend]

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkNamedColorsNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
int GetNumberOfColors ()
 Get the number of colors. More...
 
void ResetColors ()
 Reset the colors in the color map to the original colors. More...
 
bool ColorExists (const vtkStdString &name)
 Return true if the color exists. More...
 
vtkColor4ub GetColor4ub (const vtkStdString &name)
 Get the color by name. More...
 
void GetColor (const vtkStdString &name, unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a)
 Get the color by name. More...
 
void GetColor (const vtkStdString &name, unsigned char rgba[4])
 Get the color by name. More...
 
void GetColor (const vtkStdString &name, vtkColor4ub &rgba)
 Get the color by name. More...
 
vtkColor4d GetColor4d (const vtkStdString &name)
 Get the color by name. More...
 
void GetColor (const vtkStdString &name, double &r, double &g, double &b, double &a)
 Get the color by name. More...
 
void GetColor (const vtkStdString &name, double rgba[4])
 Get the color by name. More...
 
void GetColor (const vtkStdString &name, vtkColor4d &rgba)
 Get the color by name. More...
 
vtkColor3ub GetColor3ub (const vtkStdString &name)
 Get the color by name. More...
 
vtkColor3d GetColor3d (const vtkStdString &name)
 Get the color by name. More...
 
void GetColor (const vtkStdString &name, double &r, double &g, double &b)
 Get the color by name. More...
 
void GetColorRGB (const vtkStdString &name, double rgb[3])
 Get the color by name. More...
 
void GetColor (const vtkStdString &name, vtkColor3ub &rgb)
 Get the color by name. More...
 
void GetColor (const vtkStdString &name, vtkColor3d &rgb)
 Get the color by name. More...
 
virtual void SetColor (const vtkStdString &name, const unsigned char &r, const unsigned char &g, const unsigned char &b, const unsigned char &a=255)
 Set the color by name. More...
 
virtual void SetColor (const vtkStdString &name, const double &r, const double &g, const double &b, const double &a=1)
 Set the color by name. More...
 
virtual void SetColor (const vtkStdString &name, const unsigned char rgba[4])
 Set the color by name. More...
 
virtual void SetColor (const vtkStdString &name, const vtkColor4ub &rgba)
 Set the color by name. More...
 
virtual void SetColor (const vtkStdString &name, const vtkColor3ub &rgb)
 Set the color by name. More...
 
virtual void SetColor (const vtkStdString &name, const double rgba[4])
 Set the color by name. More...
 
virtual void SetColor (const vtkStdString &name, const vtkColor4d &rgba)
 Set the color by name. More...
 
virtual void SetColor (const vtkStdString &name, const vtkColor3d &rgb)
 Set the color by name. More...
 
void RemoveColor (const vtkStdString &name)
 Remove the color by name. More...
 
vtkStdString GetColorNames ()
 Return a string of color names with each name delimited by a line feed. More...
 
void GetColorNames (vtkStringArray *colorNames)
 Return a string array of color names. More...
 
vtkStdString GetSynonyms ()
 Return a string of synonyms such as cyan/aqua and magenta/fuchsia. More...
 
vtkColor4ub HTMLColorToRGBA (const vtkStdString &colorString)
 Return a vtkColor4ub instance from an HTML color string in any of the following formats: More...
 
vtkColor3ub HTMLColorToRGB (const vtkStdString &colorString)
 Return a vtkColor3ub instance from an HTML color string in any of the following formats: More...
 
vtkStdString RGBToHTMLColor (const vtkColor3ub &rgb)
 Given a vtkColor3ub instance as input color return a valid HTML color string in the #RRGGBB format. More...
 
vtkStdString RGBAToHTMLColor (const vtkColor4ub &rgba)
 Given a vtkColor4ub instance as input color return a valid HTML color string in the rgba(r, g, b, a) format. More...
 
void SetColor (const vtkStdString &name, const vtkStdString &htmlString)
 Set the color by name. More...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on. More...
 
virtual void DebugOff ()
 Turn debugging output off. More...
 
bool GetDebug ()
 Get the value of the debug flag. More...
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag. More...
 
virtual void Modified ()
 Update the modification time for this object. More...
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time. More...
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
vtkTypeBool HasObserver (unsigned long event)
 
vtkTypeBool HasObserver (const char *event)
 
vtkTypeBool InvokeEvent (unsigned long event)
 
vtkTypeBool InvokeEvent (const char *event)
 
std::string GetObjectDescription () const override
 The object description printed in messages and PrintSelf output. More...
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method. More...
 
vtkTypeBool InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
vtkTypeBool InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
virtual void SetObjectName (const std::string &objectName)
 Set/get the name of this object for reporting purposes. More...
 
virtual std::string GetObjectName () const
 Set/get the name of this object for reporting purposes. More...
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. More...
 
virtual vtkIdType GetNumberOfGenerationsFromBase (const char *name)
 Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). More...
 
virtual void Delete ()
 Delete a VTK object. More...
 
virtual void FastDelete ()
 Delete a reference to this object. More...
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream. More...
 
void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object). More...
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object). More...
 
int GetReferenceCount ()
 Return the current reference count of this object. More...
 
void SetReferenceCount (int)
 Sets the reference count. More...
 
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual bool UsesGarbageCollector () const
 Indicate whether the class uses vtkGarbageCollector or not. More...
 

Static Public Member Functions

static vtkTypeBool IsTypeOf (const char *type)
 
static vtkNamedColorsSafeDownCast (vtkObjectBase *o)
 
static vtkNamedColorsNew ()
 Create a new vtkNamedColors object. More...
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes. More...
 
static void SetGlobalWarningDisplay (vtkTypeBool val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static vtkTypeBool GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class. More...
 
static vtkIdType GetNumberOfGenerationsFromBaseType (const char *name)
 Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. More...
 
static bool GetUsingMemkind ()
 A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space. More...
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkNamedColors ()
 
 ~vtkNamedColors () override
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
 These methods allow a command to exclusively grab all events. More...
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events. More...
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
 
static vtkReallocingFunction GetCurrentReallocFunction ()
 
static vtkFreeingFunction GetCurrentFreeFunction ()
 
static vtkFreeingFunction GetAlternateFreeFunction ()
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
std::string ObjectName
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

A class holding colors and their names.

For a web page showcasing VTK Named Colors and their RGB values, see: VTKNamedColorPatches; NamedColorPatches was used to generate this table.

Color names are case insensitive and are stored as lower-case names along with a 4-element array whose elements are red, green, blue and alpha, in that order, corresponding to the RGBA value of the color.

It is assumed that if the RGBA values are unsigned char then each element lies in the range 0...255 and if the RGBA values are double then each element lies in the range 0...1.

The colors and names are those in Web colors that are derived from the CSS3 specification: CSS Color Module Level 3 In this table common synonyms such as cyan/aqua and magenta/fuchsia are also included.

Also included in this class are names and colors taken from Wrapping/Python/vtkmodules/util/colors.py that were originally taken from Wrapping/Tcl/vtktesting/colors.tcl (no longer in the VTK source files - deleted 06-Dec-2017).

Web colors and names in Web colors take precedence over those in colors.py. One consequence of this is that while colors.py specifies green as equivalent to (0,255,0), the web color standard defines it as (0,128,0).

The SetColor methods will overwrite existing colors if the name of the color being set matches an existing color. Note that ColorExists() can be used to test for existence of the color being set.

In the case of the GetColor methods returning doubles, alternative versions, identified by the letters RGB in the names, are provided. These get functions return just the red, green and blue components of a color.

The class also provides methods for defining a color through an HTML color string. The following formats are supported:

Definition at line 185 of file vtkNamedColors.h.

Member Typedef Documentation

◆ Superclass

Definition at line 188 of file vtkNamedColors.h.

Constructor & Destructor Documentation

◆ vtkNamedColors()

vtkNamedColors::vtkNamedColors ( )
protected

◆ ~vtkNamedColors()

vtkNamedColors::~vtkNamedColors ( )
overrideprotected

Member Function Documentation

◆ IsTypeOf()

static vtkTypeBool vtkNamedColors::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual vtkTypeBool vtkNamedColors::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class.

Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObjectBase.

◆ SafeDownCast()

static vtkNamedColors* vtkNamedColors::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase* vtkNamedColors::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkNamedColors* vtkNamedColors::NewInstance ( ) const

◆ PrintSelf()

void vtkNamedColors::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Methods invoked by print to print information about the object including superclasses.

Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObjectBase.

◆ New()

static vtkNamedColors* vtkNamedColors::New ( )
static

Create a new vtkNamedColors object.

◆ GetNumberOfColors()

int vtkNamedColors::GetNumberOfColors ( )

Get the number of colors.

◆ ResetColors()

void vtkNamedColors::ResetColors ( )

Reset the colors in the color map to the original colors.

Any colors inserted by the user will be lost.

◆ ColorExists()

bool vtkNamedColors::ColorExists ( const vtkStdString name)

Return true if the color exists.

◆ GetColor4ub()

vtkColor4ub vtkNamedColors::GetColor4ub ( const vtkStdString name)

Get the color by name.

The name is treated as being case-insensitive. The color is returned as a vtkColor4ub class. The color black is returned if the color is not found.

◆ GetColor() [1/9]

void vtkNamedColors::GetColor ( const vtkStdString name,
unsigned char &  r,
unsigned char &  g,
unsigned char &  b,
unsigned char &  a 
)

Get the color by name.

The name is treated as being case-insensitive. The color is returned as four unsigned char variables: red, green, blue, alpha. The range of each element is 0...255. The color black is returned if the color is not found.

◆ GetColor() [2/9]

void vtkNamedColors::GetColor ( const vtkStdString name,
unsigned char  rgba[4] 
)

Get the color by name.

The name is treated as being case-insensitive. The color is returned as an unsigned char array: [red, green, blue, alpha]. The range of each element is 0...255. The color black is returned if the color is not found.

◆ GetColor() [3/9]

void vtkNamedColors::GetColor ( const vtkStdString name,
vtkColor4ub rgba 
)

Get the color by name.

The name is treated as being case-insensitive. The color is returned as a vtkColor4ub class. The color black is returned if the color is not found.

◆ GetColor4d()

vtkColor4d vtkNamedColors::GetColor4d ( const vtkStdString name)

Get the color by name.

The name is treated as being case-insensitive. The color is returned as a vtkColor4d class. The color black is returned if the color is not found.

◆ GetColor() [4/9]

void vtkNamedColors::GetColor ( const vtkStdString name,
double &  r,
double &  g,
double &  b,
double &  a 
)

Get the color by name.

The name is treated as being case-insensitive. The color is returned as four double variables: red, green, blue, alpha. The range of each element is 0...1. The color black is returned if the color is not found.

◆ GetColor() [5/9]

void vtkNamedColors::GetColor ( const vtkStdString name,
double  rgba[4] 
)

Get the color by name.

The name is treated as being case-insensitive. The color is returned as a double array: [red, green, blue, alpha]. The range of each element is 0...1. The color black is returned if the color is not found.

◆ GetColor() [6/9]

void vtkNamedColors::GetColor ( const vtkStdString name,
vtkColor4d rgba 
)

Get the color by name.

The name is treated as being case-insensitive. The color is returned as a vtkColor4d class. The color black is returned if the color is not found.

◆ GetColor3ub()

vtkColor3ub vtkNamedColors::GetColor3ub ( const vtkStdString name)

Get the color by name.

The name is treated as being case-insensitive. The color is returned as a vtkColor3ub class. The color black is returned if the color is not found.

◆ GetColor3d()

vtkColor3d vtkNamedColors::GetColor3d ( const vtkStdString name)

Get the color by name.

The name is treated as being case-insensitive. The color is returned as a vtkColor3d class. The color black is returned if the color is not found.

◆ GetColor() [7/9]

void vtkNamedColors::GetColor ( const vtkStdString name,
double &  r,
double &  g,
double &  b 
)

Get the color by name.

The name is treated as being case-insensitive. The color is returned as three double variables: red, green, blue. The range of each element is 0...1. The color black is returned if the color is not found.

◆ GetColorRGB()

void vtkNamedColors::GetColorRGB ( const vtkStdString name,
double  rgb[3] 
)

Get the color by name.

The name is treated as being case-insensitive. The color is returned as a double array: [red, green, blue]. The range of each element is 0...1. The color black is returned if the color is not found.

◆ GetColor() [8/9]

void vtkNamedColors::GetColor ( const vtkStdString name,
vtkColor3ub rgb 
)

Get the color by name.

The name is treated as being case-insensitive. The color is returned as a vtkColor3ub class. The color black is returned if the color is not found.

◆ GetColor() [9/9]

void vtkNamedColors::GetColor ( const vtkStdString name,
vtkColor3d rgb 
)

Get the color by name.

The name is treated as being case-insensitive. The color is returned as a vtkColor3d class. The color black is returned if the color is not found.

◆ SetColor() [1/9]

virtual void vtkNamedColors::SetColor ( const vtkStdString name,
const unsigned char &  r,
const unsigned char &  g,
const unsigned char &  b,
const unsigned char &  a = 255 
)
virtual

Set the color by name.

The name is treated as being case-insensitive. The range of each color is 0...255. No color is set if the name is empty.

◆ SetColor() [2/9]

virtual void vtkNamedColors::SetColor ( const vtkStdString name,
const double &  r,
const double &  g,
const double &  b,
const double &  a = 1 
)
virtual

Set the color by name.

The name is treated as being case-insensitive. The range of each color is 0...1. No color is set if the name is empty.

◆ SetColor() [3/9]

virtual void vtkNamedColors::SetColor ( const vtkStdString name,
const unsigned char  rgba[4] 
)
virtual

Set the color by name.

The name is treated as being case-insensitive. The color is an unsigned char array: [red, green, blue, alpha]. The range of each element is 0...255. The user must ensure that the color array size is 4. No color is set if the name is empty.

◆ SetColor() [4/9]

virtual void vtkNamedColors::SetColor ( const vtkStdString name,
const vtkColor4ub rgba 
)
virtual

Set the color by name.

The name is treated as being case-insensitive. The color is a vtkColor4ub class. No color is set if the name is empty.

◆ SetColor() [5/9]

virtual void vtkNamedColors::SetColor ( const vtkStdString name,
const vtkColor3ub rgb 
)
virtual

Set the color by name.

The name is treated as being case-insensitive. The color is a vtkColor3ub class. No color is set if the name is empty.

◆ SetColor() [6/9]

virtual void vtkNamedColors::SetColor ( const vtkStdString name,
const double  rgba[4] 
)
virtual

Set the color by name.

The name is treated as being case-insensitive. The color is a double array: [red, green, blue, alpha]. The range of each element is 0...1. No color is set if the name is empty.

◆ SetColor() [7/9]

virtual void vtkNamedColors::SetColor ( const vtkStdString name,
const vtkColor4d rgba 
)
virtual

Set the color by name.

The name is treated as being case-insensitive. The color is a vtkColor4d class. No color is set if the name is empty.

◆ SetColor() [8/9]

virtual void vtkNamedColors::SetColor ( const vtkStdString name,
const vtkColor3d rgb 
)
virtual

Set the color by name.

The name is treated as being case-insensitive. The color is a vtkColor3d class. No color is set if the name is empty.

◆ RemoveColor()

void vtkNamedColors::RemoveColor ( const vtkStdString name)

Remove the color by name.

The name is treated as being case-insensitive. Examples for parsing are provided in: TestNamedColors.cxx and TestNamedColorsIntegration.py

◆ GetColorNames() [1/2]

vtkStdString vtkNamedColors::GetColorNames ( )

Return a string of color names with each name delimited by a line feed.

This is easily parsed by the user into whatever data structure they require. Examples for parsing are provided in: TestNamedColors.cxx and TestNamedColorsIntegration.py

◆ GetColorNames() [2/2]

void vtkNamedColors::GetColorNames ( vtkStringArray colorNames)

Return a string array of color names.

◆ GetSynonyms()

vtkStdString vtkNamedColors::GetSynonyms ( )

Return a string of synonyms such as cyan/aqua and magenta/fuchsia.

The string is formatted such that a single line feed delimits each color in the synonym and a double line feed delimits each synonym. Warning this could take a long time for very large color maps. This is easily parsed by the user into whatever data structure they require.

◆ HTMLColorToRGBA()

vtkColor4ub vtkNamedColors::HTMLColorToRGBA ( const vtkStdString colorString)

Return a vtkColor4ub instance from an HTML color string in any of the following formats:

  • #RGB
  • #RRGGBB
  • rgb(r, g, b)
  • rgba(r, g, b, a)
  • a CSS3 color name, e.g. "steelblue" If the string argument defines a color using one of the above formats the method returns the successfully parsed color else returns a color equal to rgba(0, 0, 0, 0).

◆ HTMLColorToRGB()

vtkColor3ub vtkNamedColors::HTMLColorToRGB ( const vtkStdString colorString)

Return a vtkColor3ub instance from an HTML color string in any of the following formats:

  • #RGB
  • #RRGGBB
  • rgb(r, g, b)
  • rgba(r, g, b, a)
  • a CSS3 color name, e.g. "steelblue" If the string argument defines a color using one of the above formats the method returns the successfully parsed color else returns the color black.

◆ RGBToHTMLColor()

vtkStdString vtkNamedColors::RGBToHTMLColor ( const vtkColor3ub rgb)

Given a vtkColor3ub instance as input color return a valid HTML color string in the #RRGGBB format.

◆ RGBAToHTMLColor()

vtkStdString vtkNamedColors::RGBAToHTMLColor ( const vtkColor4ub rgba)

Given a vtkColor4ub instance as input color return a valid HTML color string in the rgba(r, g, b, a) format.

◆ SetColor() [9/9]

void vtkNamedColors::SetColor ( const vtkStdString name,
const vtkStdString htmlString 
)

Set the color by name.

The name is treated as being case-insensitive. The color must be a valid HTML color string. No color is set if the name is empty or if htmlString is not a valid HTML color string.


The documentation for this class was generated from the following file: