SbColor — color vector class
Contents
Description
This class is used to represent an RGB color. Each component of the vector is a floating-point number
between 0.0 and 1.0. There are routines to convert back and forth between RGB and HSV.
Inherits From
SbVec3f
Methods
SbColor(constSbVec3fvec3f)SbColor(constfloatrgb[3])SbColor(floatr,floatg,floatb)
Constructors for color vector.
SbColor&setHSVValue(floath,floats,floatv)
Sets value of color vector from 3 HSV (Hue, Saturation, and Value) components. Value is the same as
brightness of the color.
SbColor&setHSVValue(constfloathsv[3])
Sets value of color vector from array of 3 HSV components
voidgetHSVValue(float&h,float&s,float&v)const
Returns 3 individual HSV components
voidgetHSVValue(floathsv[3])const
Returns an array of 3 HSV components
SbColor&setPackedValue(uint32_trgba,float&transparency)
Sets value of color vector from an RGBA packed color value. The packed color format expressed in
hexadecimal is 0xrrggbbaa, where
rr is the red value
gg is the green value
bb is the blue value
aa is the alpha value
RGBA component values range from 0 to 0xFF (255). The returned transparency value is a floating point
value between 0.0 (opaque) and 1.0 (completely transparent). It is derived from the alpha component of
the RGBA color.
uint32_tgetPackedValue(floattransparency=0.0)const
Returns an RGBA packed color value, derived from the color vector and the passed transparency value.
The alpha component is set to (1.0 - transparency) * 255, resulting in a hex value between 0 and 0xFF.
If transparency not specified, alpha is set to 0xFF (opaque).
SbColor(3IV)()
Name
SbColor — color vector class
Synopsis
#include<Inventor/SbColor.h>
Methods from class SbColor:
SbColor(constSbVec3fvec3f)SbColor(constfloatrgb[3])SbColor(floatr,floatg,floatb)SbColor&setHSVValue(floath,floats,floatv)SbColor&setHSVValue(constfloathsv[3])voidgetHSVValue(float&h,float&s,float&v)constvoidgetHSVValue(floathsv[3])constSbColor&setPackedValue(uint32_trgba,float&transparency)uint32_tgetPackedValue(floattransparency=0.0)const
Methods from class SbVec3f:
SbVec3fcross(constSbVec3f&v)constfloatdot(constSbVec3f&v)constSbBoolequals(constSbVec3fv,floattolerance)constSbVec3fgetClosestAxis()constconstfloat*getValue()constvoidgetValue(float&x,float&y,float&z)constfloatlength()constvoidnegate()floatnormalize()SbVec3f&setValue(constfloatv[3])SbVec3f&setValue(floatx,floaty,floatz)SbVec3f&setValue(constSbVec3f&barycentic,constSbVec3f&v0,constSbVec3f&v1,constSbVec3f&v2)float&operator[](inti)constfloat&operator[](inti)SbVec3f&operator*=(floatd)SbVec3f&operator/=(floatd)SbVec3f&operator+=(constSbVec3f&u)SbVec3f&operator-=(constSbVec3f&u)SbVec3foperator-()constSbVec3foperator*(constSbVec3f&v,floatd)SbVec3foperator*(floatd,constSbVec3f&v)SbVec3foperator/(constSbVec3f&v,floatd)SbVec3foperator+(constSbVec3f&v1,constSbVec3f&v2)SbVec3foperator-(constSbVec3f&v1,constSbVec3f&v2)intoperator==(constSbVec3f&v1,constSbVec3f&v2)intoperator!=(constSbVec3f&v1,constSbVec3f&v2)