SBCOLOR(3iv)
π NAME π
okay so bestie, welcome to SbColor β the color vector class π
this is page SbColor(3IV) from the manual, and she is that girl. periodt.
π¦ INHERITS FROM π¦
SbVec3f β yes she's a nepo baby and honestly? deserved. π
β¨ SYNOPSIS β¨
first thing first, you gotta include her:
#include <Inventor/SbColor.h>
then here's the whole squad of methods you get, fr fr β first the ones that are her own:
Methods from class SbColor:
SbColor(const SbVec3f vec3f)
SbColor(const float rgb[3])
SbColor(float r, float g, float b)
SbColor & setHSVValue(float h, float s, float v)
SbColor & setHSVValue(const float hsv[3])
void getHSVValue(float &h, float &s, float &v) const
void getHSVValue(float hsv[3]) const
SbColor & setPackedValue(uint32_t rgba, float& transparency)
uint32_t getPackedValue(float transparency = 0.0) const
and then everything she inherited from SbVec3f because family money hits different π«Ά:
Methods from class SbVec3f:
SbVec3f cross(const SbVec3f &v) const
float dot(const SbVec3f &v) const
SbBool equals(const SbVec3f v, float tolerance) const
SbVec3f getClosestAxis() const
const float * getValue() const
void getValue(float &x, float &y, float &z) const
float length() const
void negate()
float normalize()
SbVec3f & setValue(const float v[3])
SbVec3f & setValue(float x, float y, float z)
SbVec3f & setValue(const SbVec3f &barycentic, const SbVec3f &v0,
const SbVec3f &v1, const SbVec3f &v2)
float & operator [](int i)
const float & operator [](int i)
SbVec3f & operator *=(float d)
SbVec3f & operator /=(float d)
SbVec3f & operator +=(const SbVec3f &u)
SbVec3f & operator -=(const SbVec3f &u)
SbVec3f operator -() const
SbVec3f operator *(const SbVec3f &v, float d)
SbVec3f operator *(float d, const SbVec3f &v)
SbVec3f operator /(const SbVec3f &v, float d)
SbVec3f operator +(const SbVec3f &v1, const SbVec3f &v2)
SbVec3f operator -(const SbVec3f &v1, const SbVec3f &v2)
int operator ==(const SbVec3f &v1, const SbVec3f &v2)
int operator !=(const SbVec3f &v1, const SbVec3f &v2)
πΈ DESCRIPTION πΈ
so like, what is she? SbColor is literally just an RGB color living her best life as a vector. every single component of that vector is a floating-point number chilling between 0.0 and 1.0. no cap. π
and the best part? there are routines to convert back and forth between RGB and HSV β so you can switch your whole vibe whenever. iconic behavior honestly. β¨
π METHODS π
SbColor(const SbVec3f vec3f)SbColor(const float rgb[3])SbColor(float r, float g, float b)
these are the constructors for the color vector, bestie. three ways to be born, all valid. π
SbColor & setHSVValue(float h, float s, float v)
sets the value of the color vector from 3 HSV (Hue, Saturation, and Value) components. and heads up β Value here is the same thing as the brightness of the color. π¦
SbColor & setHSVValue(const float hsv[3])
same energy, but you're handing her an array of 3 HSV components instead. π
void getHSVValue(float &h, float &s, float &v) const
hands you back 3 individual HSV components, one by one. very personal. π«Ά
void getHSVValue(float hsv[3]) const
hands you back an array of 3 HSV components instead. multitasking queen. β¨
SbColor & setPackedValue(uint32_t rgba, float& transparency)
sets the value of the color vector from an RGBA packed color value. the packed color format, when you write it in hexadecimal, is 0xrrggbbaa, where:
rris the red valueggis the green valuebbis the blue valueaais the alpha value
RGBA component values range from 0 to 0xFF (that's 255, bestie). and the transparency value it returns? that's a floating point value between 0.0 (opaque, fully here) and 1.0 (completely transparent, ghosted you π). it's derived from the alpha component of the RGBA color. no cap.
uint32_t getPackedValue(float transparency = 0.0) const
returns an RGBA packed color value, derived from the color vector and the transparency value you passed in. the alpha component gets set to (1.0 - transparency) * 255, which lands you a hex value between 0 and 0xFF. and if you don't specify transparency at all? alpha defaults to 0xFF, which is opaque. she's showing up fully, periodt. π
and that's the whole page, bestie π§ this one's SbColor(3IV) through and through β the header says it, the footer says it, and the footer's source/version and date slots are literally just sitting there empty (yes, the footer is just SbColor(3IV)() with nothing in the parens, we love a low-effort signature π). go forth and color something gorgeous. ππ
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms