Loading...
Searching...
No Matches
SBDTypeColor Class Reference

This class describes a color. More...

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)
 

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 (unsigned char red, unsigned char green, unsigned char blue, unsigned char 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)
 Copy constructor.
 
 SBDTypeColor (SBDTypeColor &&color) noexcept
 Move constructor.
 
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)
 Copy assignment.
 
SBDTypeColoroperator= (SBDTypeColor &&color) noexcept
 Move assignment.
 
float & operator[] (int index)
 Returns a reference to component index.
 
const float & operator[] (int index) const
 Returns a reference to component index (const version)
 
bool operator== (const SBDTypeColor &color) const
 
bool operator!= (const SBDTypeColor &color) const
 

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.
 
void getColor (float *color) const
 Stores the four components as a float array.
 

Color 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.
 
static void toHSV (float *hsv, float *color)
 Converts sRGB color (as in SBColor) to HSV (Hue Saturation Value)
 
static void fromHSV (float *color, float *hsv)
 Converts HSV color (Hue Saturation Value) to sRGB color (as in SBColor)
 
static void HSVfromSRGB (float *hsv, float *rgb)
 Converts sRGB color (as in SBColor) to HSV (Hue Saturation Value)
 
static void SRGBfromHSV (float *rgb, float *hsv)
 Converts HSV color (Hue Saturation Value) to sRGB color (as in SBColor)
 
static void toHCL (float *hcl, float *color)
 Converts sRGB color (as in SBColor) to HCL (cylindrical representation of CIE L*u*v* a.k.a. CIE LCh_uv)
 
static void fromHCL (float *color, float *hcl)
 Converts HCL color (cylindrical representation of CIE L*u*v* a.k.a. CIE LCh_uv) to sRGB color (as in SBColor)
 
static void HCLfromSRGB (float *hcl, float *rgb)
 Converts standard RGB (sRGB) color to HCL color (cylindrical representation of CIE L*u*v* a.k.a. CIE LCh_uv)
 
static void SRGBfromHCL (float *rgb, float *hcl)
 Converts HCL color (cylindrical representation of CIE L*u*v* a.k.a. CIE LCh_uv) to standard RGB (sRGB) color.
 
static void SRGBfromRGB (float *srgb, float *rgb)
 Converts linear RGB values to standard RGB (sRGB) values.
 
static void RGBfromSRGB (float *rgb, float *srgb)
 Converts standard RGB (sRGB) values to linear RGB values.
 
static void CIEXYZfromRGB (float *XYZ, float *rgb)
 Converts linear RGB to CIE XYZ with D65/2° standard illuminant.
 
static void RGBfromCIEXYZ (float *rgb, float *XYZ)
 Converts CIE XYZ with D65/2° standard illuminant to linear RGB.
 
static void CIEXYZfromSRGB (float *XYZ, float *rgb)
 Converts device independent standard RGB (sRGB) to CIE XYZ with D65/2° standard illuminant.
 
static void SRGBfromCIEXYZ (float *rgb, float *XYZ)
 Converts CIEXYZ with D65/2° standard illuminant to device independent standard RGB (sRGB)
 
static void SRGBfromCIELab (float *rgb, float *lab)
 Converts color from CIE L*a*b* color space to standard RGB (sRGB) color space.
 
static void CIELabfromSRGB (float *lab, float *rgb)
 Converts color from standard RGB (sRGB) color space to CIE L*a*b* color space.
 
static void CIEXYZfromCIELab (float *XYZ, float *lab)
 Converts CIE L*a*b* to CIE XYZ D65/2°
 
static void CIELabfromCIEXYZ (float *lab, float *XYZ)
 Converts CIE XYZ D65/2° to CIE L*a*b*.
 
static void CIEXYZfromCIELuv (float *XYZ, float *luv)
 Converts CIE L*u*v* to CIE XYZ D65/2°
 
static void CIELuvfromCIEXYZ (float *luv, float *XYZ)
 Converts CIE XYZ D65/2° to CIE L*u*v*.
 
static void CIEuvfromCIEXYZ (float *uv, float *XYZ)
 Converts CIE XYZ D65/2° to u and v coordinates for the CIE Luv.
 
static void cylindricalCIELabfromCIELab (float *hcl, float *lab)
 Converts CIE L*a*b* to CIE L*a*b* in cylindrical coordinates (a.k.a. CIE LCh_ab)
 
static void CIELabfromCylindricalCIELab (float *lab, float *hcl)
 Converts CIE L*a*b* in cylindrical coordinates (a.k.a. CIE LCh_ab) to CIE L*a*b*.
 
static void cylindricalCIELuvfromCIELuv (float *hcl, float *luv)
 Converts CIE L*u*v* to CIE L*u*v* in cylindrical coordinates (a.k.a. CIE LCh_uv)
 
static void CIELuvfromCylindricalCIELuv (float *luv, float *hcl)
 Converts CIE L*u*v* in cylindrical coordinates (a.k.a. CIE LCh_uv) to CIE L*u*v*.
 
static void cylindricalCIELabfromSRGB (float *hcl, float *rgb)
 Converts standard RGB (sRGB) to CIE L*a*b* in cylindrical coordinates a.k.a. (CIE LCh_ab)
 
static void SRGBfromCylindricalCIELab (float *rgb, float *hcl)
 Converts CIE L*a*b* in cylindrical coordinates (a.k.a. CIE LCh_ab) to standard RGB (sRGB)
 
static void cylindricalCIELuvfromSRGB (float *hcl, float *rgb)
 Converts standard RGB (sRGB) to CIE L*u*v* in cylindrical coordinates (a.k.a. CIE LCh_uv)
 
static void SRGBfromCylindricalCIELuv (float *rgb, float *hcl)
 Converts CIE L*u*v* in cylindrical coordinates (a.k.a. CIE LCh_uv) to standard RGB (sRGB)
 

Utility functions

static void darkenSRGBColor (float *rgb, float amount)
 Darkens the standard RGB (sRGB) color rgb by the amount amount.
 
static void lightenSRGBColor (float *rgb, float amount)
 Lightens the standard RGB (sRGB) color rgb by the amount amount.
 

Detailed Description

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

SBColor uses the standard RGB (sRGB).

conversions

This class also provides static functions to transform colors between different color spaces:

  • standard gamma-corrected RGB (sRGB)
  • RGB
  • HSV (hue, saturation, value)
  • HCL (hue, chroma, luminance) - cylindrical representation of CIE L*u*v*, a.k.a. CIE LCh_uv
  • CIE L*u*v*
  • CIE L*a*b*
  • CIE L*a*b* in cylindrical coordinates, a.k.a. CIE LCh_ab
  • CIE XYZ with D65/2° standard illuminant.

To use color conversion function, pass two pointers to float arrays (with 3 values) in a function: the first one will contain the result, the second one contains the input color data.

Example:

float color_in_sRGB[3] = {1.0, 0.0, 0.0}; // red color in sRGB color space
float color_in_HCL[3];
SBColor::toHCL(color_in_HCL, color_in_sRGB);
static void toHCL(float *hcl, float *color)
Converts sRGB color (as in SBColor) to HCL (cylindrical representation of CIE L*u*v* a....
Definition: SBDTypeColor.cpp:780

Note: The conversions might not always be exact. For example, a converstion from sRGB to HCL and then back from HCL to sRGB might result in values that might slightly differ from the original ones by some numerical error due to approximations in conversion functions and floating-point arithmetics.

See also
Color schemes, SBDPalette

Member Function Documentation

◆ CIELabfromCIEXYZ()

void SBDTypeColor::CIELabfromCIEXYZ ( float *  lab,
float *  XYZ 
)
static

SBDTypeColor::CIELabfromCIEXYZ - Converts CIE XYZ D65/2° to CIE L*a*b*.

Parameters
lab- CIE L*a*b* coordinates
XYZ- X, Y, Z input refer to a D65/2° standard illuminant. The CIE XYZ values must be scaled so that the Y of D65 ("white") is 1.0 (X,Y,Z = 0.95047, 1.0000, 1.08883)

◆ CIELabfromCylindricalCIELab()

void SBDTypeColor::CIELabfromCylindricalCIELab ( float *  lab,
float *  hcl 
)
static

SBDTypeColor::CIELabfromCylindricalCIELab - Converts CIE L*a*b* in cylindrical coordinates (CIE LCh_ab) to CIE L*a*b*.

Parameters
lab- L*a*b* coordinates in the CIE L*a*b*
hcl- hue, chroma, and luminance values in the cylindrical CIEL*a*b* color space. Cylindrical CIE Lab: H: 0 ... 360; C: 0 ... 100; L: 0 ... 100

◆ CIELabfromSRGB()

void SBDTypeColor::CIELabfromSRGB ( float *  lab,
float *  rgb 
)
static

SBDTypeColor::CIELabfromSRGB - Converts standard RGB (sRGB) to CIE L*a*b*.

Parameters
lab- L*a*b* coordinates in the CIE L*a*b* color space
rgb- standard RGB (sRGB)

◆ CIELuvfromCIEXYZ()

void SBDTypeColor::CIELuvfromCIEXYZ ( float *  luv,
float *  XYZ 
)
static

SBDTypeColor::CIELuvfromCIEXYZ - Converts CIE XYZ D65/2° to CIE L*u*v*.

Parameters
luv- Resulting L*u*v* coordinates in the CIE L*u*v* color space.
XYZ- X, Y, Z input refer to a D65/2° standard illuminant. The CIE XYZ values must be scaled so that the Y of D65 ("white") is 1.0 (X,Y,Z = 0.95047, 1.0000, 1.08883).

◆ CIELuvfromCylindricalCIELuv()

void SBDTypeColor::CIELuvfromCylindricalCIELuv ( float *  luv,
float *  hcl 
)
static

SBDTypeColor::CIELuvfromCylindricalCIELuv - Converts CIE L*u*v* in cylindrical coordinates (a.k.a. CIE LCh_uv) to CIE L*u*v*.

Parameters
luv- L*u*v* coordinates in the CIE L*u*v*
hcl- hue, chroma, and luminance values in the cylindrical CIEL*u*v* color space. Cylindrical CIE Luv: H: 0 ... 360; C: 0 ... 100; L: 0 ... 100

◆ CIEuvfromCIEXYZ()

void SBDTypeColor::CIEuvfromCIEXYZ ( float *  uv,
float *  XYZ 
)
static

SBDTypeColor::CIEuvfromCIEXYZ - An auxiliary function that computes u and v coordinates for the CIE Luv from CIE XYZ.

Parameters
uv- u and v values
XYZ- X, Y, Z input refer to a D65/2° standard illuminant. The CIE XYZ values must be scaled so that the Y of D65 ("white") is 1.0 (X,Y,Z = 0.95047, 1.0000, 1.08883).

◆ CIEXYZfromCIELab()

void SBDTypeColor::CIEXYZfromCIELab ( float *  XYZ,
float *  lab 
)
static

SBDTypeColor::CIEXYZfromCIELab - Converts CIE L*a*b* to CIE XYZ D65/2°

Parameters
XYZ- X, Y, Z input refer to a D65/2° standard illuminant. The CIE XYZ values must be scaled so that the Y of D65 ("white") is 1.0 (X,Y,Z = 0.95047, 1.0000, 1.08883).
lab- L*a*b* coordinates in the CIE L*a*b* color space

◆ CIEXYZfromCIELuv()

void SBDTypeColor::CIEXYZfromCIELuv ( float *  XYZ,
float *  luv 
)
static

SBDTypeColor::CIEXYZfromCIELuv - Converts CIE L*u*v* to CIE XYZ D65/2°

Parameters
XYZ- X, Y, Z coordinates in the CIEXYZ color space, that refer to a D65/2° standard illuminant. The CIE XYZ values must be scaled so that the Y of D65 ("white") is 1.0 (X,Y,Z = 0.95047, 1.0000, 1.08883).
luv- L*u*v* coordinates in the CIE L*u*v* color space.

◆ CIEXYZfromRGB()

void SBDTypeColor::CIEXYZfromRGB ( float *  XYZ,
float *  rgb 
)
static

SBDTypeColor::CIEXYZfromRGB - Converts linear RGB to CIE XYZ with D65/2° standard illuminant.

Parameters
XYZ- X, Y and Z give the CIE chromaticies. X, Y, Z output refer to a D65/2° standard illuminant. The CIE XYZ values are scaled so that the Y of D65 ("white") is 1.0 (X,Y,Z = 0.95047, 1.0000, 1.08883) (chromaticity of the white point).
rgb- linear R, G, and B give the levels of red, green and blue as values in the interval [0.0, 1.0] (input range: 0 ÷ 1).

◆ CIEXYZfromSRGB()

void SBDTypeColor::CIEXYZfromSRGB ( float *  XYZ,
float *  rgb 
)
static

SBDTypeColor::CIEXYZfromSRGB - Converts device independent standard RGB (sRGB) to CIE XYZ with D65/2° standard illuminant.

Parameters
XYZ- X, Y and Z give the CIE chromaticies. X, Y, Z output refer to a D65/2° standard illuminant. The CIE XYZ values are scaled so that the Y of D65 ("white") is 1.0 (X,Y,Z = 0.95047, 1.0000, 1.08883) (chromaticity of the white point).
rgb- standard R, G, and B give the levels of red, green and blue as values in the interval [0.0, 1.0] (input range: 0 ÷ 1).

◆ cylindricalCIELabfromCIELab()

void SBDTypeColor::cylindricalCIELabfromCIELab ( float *  hcl,
float *  lab 
)
static

SBDTypeColor::cylindricalCIELabfromCIELab - Converts CIE L*a*b* to CIE L*a*b* in cylindrical coordinates (CIE LCh_ab)

Parameters
hcl- hue, chroma, and luminance values in the cylindrical CIEL*a*b* color space. Cylindrical CIE Lab: H: 0 ... 360; C: 0 ... 100; L: 0 ... 100
lab- L*a*b* coordinates in the CIE L*a*b*

◆ cylindricalCIELabfromSRGB()

void SBDTypeColor::cylindricalCIELabfromSRGB ( float *  hcl,
float *  rgb 
)
static

SBDTypeColor::cylindricalCIELabfromSRGB - Converts standard RGB (sRGB) to CIE L*a*b* in cylindrical coordinates (a.k.a. CIE LCh_ab)

Parameters
hcl- hue, chroma, and luminance values in the cylindrical CIEL*a*b* color space. Cylindrical CIE Luv: H: 0 ... 360; C: 0 ... 100; L: 0 ... 100
rgb- standard RGB (sRGB)

◆ cylindricalCIELuvfromCIELuv()

void SBDTypeColor::cylindricalCIELuvfromCIELuv ( float *  hcl,
float *  luv 
)
static

SBDTypeColor::cylindricalCIELuvfromCIELuv - Converts CIE L*u*v* to CIE L*u*v* in cylindrical coordinates (a.k.a. CIE LCh_uv)

Parameters
hcl- hue, chroma, and luminance values in the cylindrical CIE L*u*v* color space. Cylindrical CIE Luv: H: 0 ... 360; C: 0 ... 100; L: 0 ... 100
luv- L*u*v* coordinates in the CIE L*u*v*

◆ cylindricalCIELuvfromSRGB()

void SBDTypeColor::cylindricalCIELuvfromSRGB ( float *  hcl,
float *  rgb 
)
static

SBDTypeColor::cylindricalCIELuvfromSRGB - Converts standard RGB (sRGB) to CIE L*u*v* in cylindrical coordinates (a.k.a. CIE LCh_uv)

Parameters
hcl- hue, chroma, and luminance values in the cylindrical CIEL*u*v* color space. Cylindrical CIE Luv: H: 0 ... 360; C: 0 ... 100; L: 0 ... 100
rgb- standard RGB (sRGB)

◆ fromHCL()

void SBDTypeColor::fromHCL ( float *  color,
float *  hcl 
)
static

SBDTypeColor::fromHCL - Converts HCL color (cylindrical representation of CIE L*u*v* a.k.a. CIE LCh_uv) to sRGB color as in SBColor.

Parameters
color- sRGB color as in SBColor
hcl- hue, chroma, and luminance values in the cylindrical CIEL*u*v* color space. Cylindrical CIE Luv: H: 0 ... 360; C: 0 ... 100; L: 0 ... 100

◆ fromHSV()

void SBDTypeColor::fromHSV ( float *  color,
float *  hsv 
)
static

SBDTypeColor::fromHSV - Converts HSV color (Hue Saturation Value) to sRGB color (as in SBColor)

Parameters
color- sRGB color as in SBColor
hsv- hue, saturation, and value

◆ getColor()

const float * SBDTypeColor::getColor ( ) const

Returns a pointer to the color array

◆ HCLfromSRGB()

void SBDTypeColor::HCLfromSRGB ( float *  hcl,
float *  rgb 
)
static

SBDTypeColor::HCLfromSRGB - Converts standard RGB (sRGB) color to HCL color (cylindrical representation of CIE L*u*v* a.k.a. CIE LCh_uv)

Parameters
hcl- hue, chroma, and luminance values in the cylindrical CIEL*u*v* color space. Cylindrical CIE Luv: H: 0 ... 360; C: 0 ... 100; L: 0 ... 100
rgb- standard RGB (sRGB) color

◆ HSVfromSRGB()

void SBDTypeColor::HSVfromSRGB ( float *  hsv,
float *  rgb 
)
static

SBDTypeColor::HSVfromSRGB - Converts sRGB color (as in SBColor) to HSV (Hue Saturation Value)

Parameters
hsv- hue, saturation, and value
rgb- standard RGB (sRGB) color

◆ RGBfromCIEXYZ()

void SBDTypeColor::RGBfromCIEXYZ ( float *  rgb,
float *  XYZ 
)
static

SBDTypeColor::RGBfromCIEXYZ - Converts CIE XYZ with D65/2° standard illuminant to linear RGB.

Parameters
rgb- linear R, G, and B give the levels of red, green and blue as values in the interval [0.0, 1.0] (input range: 0 ÷ 1).
XYZ- X, Y and Z are the CIE chromaticies. X, Y, Z input refer to a D65/2° standard illuminant. The CIE XYZ values must be scaled so that the Y of D65 ("white") is 1.0 (X,Y,Z = 0.95047, 1.0000, 1.08883)

◆ RGBfromSRGB()

void SBDTypeColor::RGBfromSRGB ( float *  rgb,
float *  srgb 
)
static

SBDTypeColor::RGBfromSRGB - Converts standard gamma-corrected RGB values to linear RGB values.

Parameters
rgb- linear RGB
srgb- standard RGB (sRGB)

◆ SRGBfromCIELab()

void SBDTypeColor::SRGBfromCIELab ( float *  rgb,
float *  lab 
)
static

SBDTypeColor::SRGBfromCIELab - Converts CIE L*a*b* to standard RGB (sRGB)

Parameters
rgb- standard RGB (sRGB)
lab- L*a*b* coordinates in the CIE L*a*b* color space

◆ SRGBfromCIEXYZ()

void SBDTypeColor::SRGBfromCIEXYZ ( float *  rgb,
float *  XYZ 
)
static

SBDTypeColor::SRGBfromCIEXYZ - Converts CIEXYZ with D65/2° standard illuminant to device independent standard RGB (sRGB)

Parameters
rgb- standard R, G, and B give the levels of red, green and blue as values in the interval [0.0, 1.0] (input range: 0 ÷ 1).
XYZ- X, Y and Z are the CIE chromaticies. X, Y, Z input refer to a D65/2° standard illuminant. The CIE XYZ values must be scaled so that the Y of D65 ("white") is 1.0 (X,Y,Z = 0.95047, 1.0000, 1.08883)

◆ SRGBfromCylindricalCIELab()

void SBDTypeColor::SRGBfromCylindricalCIELab ( float *  rgb,
float *  hcl 
)
static

SBDTypeColor::SRGBfromCylindricalCIELab - Converts CIE L*a*b* in cylindrical coordinates (a.k.a. CIE LCh_ab) to standard RGB (sRGB)

Parameters
rgb- standard RGB (sRGB)
hcl- hue, chroma, and luminance values in the cylindrical CIEL*a*b* color space. Cylindrical CIE Luv: H: 0 ... 360; C: 0 ... 100; L: 0 ... 100

◆ SRGBfromCylindricalCIELuv()

void SBDTypeColor::SRGBfromCylindricalCIELuv ( float *  rgb,
float *  hcl 
)
static

SBDTypeColor::SRGBfromCylindricalCIELuv - Converts CIE L*u*v* in cylindrical coordinates (a.k.a. CIE LCh_uv) to standard RGB (sRGB)

Parameters
rgb- standard RGB (sRGB)
hcl- hue, chroma, and luminance values in the cylindrical CIEL*u*v* color space. Cylindrical CIE Luv: H: 0 ... 360; C: 0 ... 100; L: 0 ... 100

◆ SRGBfromHCL()

void SBDTypeColor::SRGBfromHCL ( float *  rgb,
float *  hcl 
)
static

SBDTypeColor::SRGBfromHCL - Converts HCL color (cylindrical representation of CIE L*u*v* a.k.a. CIE LCh_uv) to standard RGB (sRGB) color.

Parameters
rgb- standard RGB (sRGB) color
hcl- hue, chroma, and luminance values in the cylindrical CIEL*u*v* color space. Cylindrical CIE Luv: H: 0 ... 360; C: 0 ... 100; L: 0 ... 100

◆ SRGBfromHSV()

void SBDTypeColor::SRGBfromHSV ( float *  rgb,
float *  hsv 
)
static

SBDTypeColor::SRGBfromHSV - Converts HSV color (Hue Saturation Value) to sRGB color (as in SBColor)

Parameters
rgb- standard RGB (sRGB) color
hsv- hue, saturation, and value

◆ SRGBfromRGB()

void SBDTypeColor::SRGBfromRGB ( float *  srgb,
float *  rgb 
)
static

SBDTypeColor::SRGBfromRGB - Converts linear RGB values to standard gamma-corrected RGB values.

Parameters
srgb- standard RGB (sRGB)
rgb- linear RGB

◆ toHCL()

void SBDTypeColor::toHCL ( float *  hcl,
float *  color 
)
static

SBDTypeColor::toHCL - Converts sRGB color as in SBColor to HCL color (cylindrical representation of CIE L*u*v* a.k.a. CIE LCh_uv)

Parameters
hcl- hue, chroma, and luminance values in the cylindrical CIEL*u*v* color space. Cylindrical CIE Luv: H: 0 ... 360; C: 0 ... 100; L: 0 ... 100
color- sRGB color as in SBColor

◆ toHSV()

void SBDTypeColor::toHSV ( float *  hsv,
float *  color 
)
static

SBDTypeColor::toHSV - Converts sRGB color (as in SBColor) to HSV (Hue Saturation Value)

Parameters
hsv- hue, saturation, and value
color- sRGB color as in SBColor