SBDTypeColor Class Reference

This class describes a color. More...

Static Public Attributes

static const SBDTypeColor black
 The black color.
 
static const SBDTypeColor white
 The white color.
 
static const SBDTypeColor red
 The red color.
 
static const SBDTypeColor green
 The green color.
 
static const SBDTypeColor blue
 The blue color.
 
static const SBDTypeColor cyan
 The cyan color.
 
static const SBDTypeColor magenta
 The magenta color.
 
static const SBDTypeColor yellow
 The yellow color.
 

Constructors and destructors

 SBDTypeColor ()
 Constructs a color (1.0f, 1.0f, 1.0f, 1.0f)
 
 SBDTypeColor (float red, float green, float blue, float alpha=1.0f)
 Constructs a color (red, green, blue, alpha)
 
 SBDTypeColor (int red, int green, int blue, int alpha=255)
 Constructs a color (red, green, blue, alpha)
 
 SBDTypeColor (float *color)
 Constructs a color (color[0], color[1], color[2], color[3])
 
 SBDTypeColor (const SBDTypeColor &color)
 Constructs a color (color[0], color[1], color[2], color[3])
 
virtual ~SBDTypeColor ()
 Destructs the color.
 

Serialization

bool isSerializable () const
 Returns true.
 
void serialize (SBCSerializer *serializer, const SBNodeIndexer &nodeIndexer, const SBVersionNumber &sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber &classVersionNumber=SBVersionNumber(1, 0, 0)) const
 Serializes the document.
 
void unserialize (SBCSerializer *serializer, const SBNodeIndexer &nodeIndexer, const SBVersionNumber &sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber &classVersionNumber=SBVersionNumber(1, 0, 0))
 Unserializes the document.
 

Operators

SBDTypeColoroperator= (const SBDTypeColor &color)
 

Accessors

float getRed () const
 
void setRed (float red)
 Returns the red component.
 
float getGreen () const
 Sets the red component.
 
void setGreen (float green)
 Returns the green component.
 
float getBlue () const
 Sets the green component.
 
void setBlue (float blue)
 Returns the blue component.
 
float getAlpha () const
 Sets the blue component.
 
void setAlpha (float alpha)
 Returns the alpha component.
 
const float * getColor () const
 Sets the alpha component. More...
 
void getColor (float *color) const
 Stores the four components as a float array.
 
float & operator[] (int index)
 Returns a reference to component index.
 
const float & operator[] (int index) const
 Returns a reference to component index (const version)
 

Conversions

static SBDTypeColor fromHSV (float hue, float saturation, float value)
 Creates a color from a given HSV color.
 
static SBDTypeColor fromHCL (float hue, float chroma, float luminance)
 Creates a color from a given HCL (CIE LCh_uv) color.
 

Debugging

virtual void print (unsigned int offset=0) const
 Prints the color.
 

Detailed Description

This class describes a color in SAMSON. Please refer to this page for more information.

See also
Color schemes

Member Function Documentation

◆ getColor()

const float * SBDTypeColor::getColor ( ) const

Returns a pointer to the color array