SBDTypeColor Class Reference

This class describes a color. More...

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])
 
 SBDTypeColor (SBDTypeColor &&color)
 Moves 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 SBVersionNumber &sdkVersionNumber=SB_SDK_VERSION_NUMBER) const
 Serializes the color.
 
void unserialize (SBCSerializer *serializer, const SBVersionNumber &sdkVersionNumber=SB_SDK_VERSION_NUMBER)
 Unserializes the color.
 

Operators

SBDTypeColoroperator= (const SBDTypeColor &color)
 
SBDTypeColoroperator= (SBDTypeColor &&color)
 

Accessors

float getRed () const
 
int getRedInt () const
 Returns the red component, the value is in the [0.0, 1.0] interval.
 
void setRed (int red)
 Returns the red component, the value is in the [0, 255] interval.
 
void setRed (float red)
 Sets the red component, the value should be in the [0, 255] interval.
 
float getGreen () const
 Sets the red component, the value should be in the [0.0, 1.0] interval.
 
int getGreenInt () const
 Returns the green component, the value is in the [0.0, 1.0] interval.
 
void setGreen (int green)
 Returns the green component, the value is in the [0, 255] interval.
 
void setGreen (float green)
 Sets the green component, the value should be in the [0, 255] interval.
 
float getBlue () const
 Sets the green component, the value should be in the [0.0, 1.0] interval.
 
int getBlueInt () const
 Returns the blue component, the value is in the [0.0, 1.0] interval.
 
void setBlue (int blue)
 Returns the blue component, the value is in the [0, 255] interval.
 
void setBlue (float blue)
 Sets the blue component, the value should be in the [0, 255] interval.
 
float getAlpha () const
 Sets the blue component, the value should be in the [0.0, 1.0] interval.
 
int getAlphaInt () const
 Returns the alpha component, the value is in the [0.0, 1.0] interval.
 
void setAlpha (int alpha)
 Returns the alpha component, the value is in the [0, 255] interval.
 
void setAlpha (float alpha)
 Sets the alpha component, the value should be in the [0, 255] interval.
 
const float * getColor () const
 Sets the alpha component, the value should be in the [0.0, 1.0] interval. 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

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.
 
static const SBDTypeColor orange
 The orange color.
 
static const SBDTypeColor globalXAxis
 The global X axis color.
 
static const SBDTypeColor globalYAxis
 The global Y axis color.
 
static const SBDTypeColor globalZAxis
 The global Z axis color.
 
static const SBDTypeColor localXAxis
 The local X axis color.
 
static const SBDTypeColor localYAxis
 The local Y axis color.
 
static const SBDTypeColor localZAxis
 The local Z axis color.
 
static const SBDTypeColor defaultKeyframeColor
 The default keyframe color.
 
SBDTypeColorData * dataPointer
 
virtual void print (unsigned int offset=0) const
 Prints the color.
 
 SB_DECLARE_DATA (SBDTypeColor)
 

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