Web Analytics Made Easy - Statcounter
Skip to content

Class SBDTypeColor#

ClassList > SBDTypeColor

This class describes a color. More...

  • #include <SBDTypeColor.hpp>

Public Static Attributes#

Type Name
const SBDTypeColor black
The black color.
const SBDTypeColor blue
The blue color.
const SBDTypeColor cyan
The cyan color.
const SBDTypeColor defaultKeyframeColor
The default keyframe color.
const SBDTypeColor globalXAxis
The global X axis color.
const SBDTypeColor globalYAxis
The global Y axis color.
const SBDTypeColor globalZAxis
The global Z axis color.
const SBDTypeColor green
The green color.
const SBDTypeColor ice
The frozen color.
const SBDTypeColor localXAxis
The local X axis color.
const SBDTypeColor localYAxis
The local Y axis color.
const SBDTypeColor localZAxis
The local Z axis color.
const SBDTypeColor magenta
The magenta color.
const SBDTypeColor orange
The orange color.
const SBDTypeColor red
The red color.
const SBDTypeColor white
The white color.
const SBDTypeColor yellow
The yellow color.

Public Functions#

Type Name
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 std::string & hexColor)
Constructs a color from hex color.
SBDTypeColor (const SBDTypeColor & color)
Copy constructor.
SBDTypeColor (SBDTypeColor && color) noexcept
Move constructor.
SBDTypeColor & bound ()
Bounds the components within [0, 1].
SBDTypeColor bounded () const
Returns a bounded version of the color with components within [0, 1].
SBDTypeColor & freeze ()
Mixes the color with the frozen color.
SBDTypeColor frozen () const
Returns a frozen version of the color.
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.
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.
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 with the size of 4.
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.
std::string getRGBString (bool includeAlpha=false) const
Returns the RGB[A] string representation of the color as "rgb(r, g, b)" or "rgba(r, g, b, a)" if includeAlpha istrue ; with integer numbers in the [0, 255] interval.
float getRed () const
Returns the red component as a floating-point value in the range [0.0, 1.0].
int getRedInt () const
Returns the red component, the value is in the [0.0, 1.0] interval.
bool isSerializable () const
Returns true __
bool operator!= (const SBDTypeColor & color) const
Inequality operator.
SBDTypeColor operator* (float f) const
Multiply all components by f , including opacity.
SBDTypeColor operator* (const SBDTypeColor & color) const
Component-wise multiplication by color , including opacity.
SBDTypeColor & operator*= (float f)
Multiply all components by f , including opacity.
SBDTypeColor & operator*= (const SBDTypeColor & color)
Component-wise multiplication by color , including opacity.
SBDTypeColor operator+ (const SBDTypeColor & color) const
Component-wise addition by color , including opacity.
SBDTypeColor & operator+= (const SBDTypeColor & color)
Component-wise addition by color , including opacity.
SBDTypeColor operator- (const SBDTypeColor & color) const
Component-wise subtraction by color , including opacity.
SBDTypeColor & operator-= (const SBDTypeColor & color)
Component-wise subtraction by color , including opacity.
SBDTypeColor & operator= (const SBDTypeColor & color)
Copy assignment.
SBDTypeColor & operator= (SBDTypeColor && color) noexcept
Move assignment.
bool operator== (const SBDTypeColor & color) const
Equality operator.
float & operator[] (int index)
Returns a reference to component index .
const float & operator[] (int index) const
Returns a reference to component index (const version)
virtual void print (unsigned int offset=0) const
Prints the color.
void serialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER) const
Serializes the color.
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.
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.
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.
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.
double toGrayscale () const
Returns the grayscale representation of the color.
std::string toHex (bool includeAlpha=false) const
Returns the hex representation of the color.
virtual std::string toPythonCode () const
Returns the string representation of the object that can be used to reconstruct it in Python.
void unserialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER)
Unserializes the color.
virtual ~SBDTypeColor ()
Destructs the color.

Public Static Functions#

Type Name
void CIELabfromCIEXYZ (float * lab, float * XYZ)
Converts CIE XYZ D65/2° to CIE L*a*b*.
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*.
void CIELabfromSRGB (float * lab, float * rgb)
Converts color from standard RGB (sRGB) color space to CIE L*a*b* color space.
void CIELuvfromCIEXYZ (float * luv, float * XYZ)
Converts CIE XYZ D65/2° to CIE L*u*v*.
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*.
void CIEXYZfromCIELab (float * XYZ, float * lab)
Converts CIE L*a*b* to CIE XYZ D65/2°
void CIEXYZfromCIELuv (float * XYZ, float * luv)
Converts CIE L*u*v* to CIE XYZ D65/2°
void CIEXYZfromRGB (float * XYZ, float * rgb)
Converts linear RGB to CIE XYZ with D65/2° standard illuminant.
void CIEXYZfromSRGB (float * XYZ, float * rgb)
Converts device independent standard RGB (sRGB) to CIE XYZ with D65/2° standard illuminant.
void CIEuvfromCIEXYZ (float * uv, float * XYZ)
Converts CIE XYZ D65/2° to u and v coordinates for the CIE Luv.
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)
void HSVfromSRGB (float * hsv, float * rgb)
Converts sRGB color (as in SBColor) to HSV (Hue Saturation Value)
void RGBfromCIEXYZ (float * rgb, float * XYZ)
Converts CIE XYZ with D65/2° standard illuminant to linear RGB.
void RGBfromSRGB (float * rgb, float * srgb)
Converts standard RGB (sRGB) values to linear RGB values.
void SRGBfromCIELab (float * rgb, float * lab)
Converts color from CIE L*a*b* color space to standard RGB (sRGB) color space.
void SRGBfromCIEXYZ (float * rgb, float * XYZ)
Converts CIEXYZ with D65/2° standard illuminant to device independent standard RGB (sRGB)
void SRGBfromCylindricalCIELab (float * rgb, float * hcl)
Converts CIE L*a*b* in cylindrical coordinates (a.k.a. CIE LCh_ab) to standard RGB (sRGB)
void SRGBfromCylindricalCIELuv (float * rgb, float * hcl)
Converts CIE L*u*v* in cylindrical coordinates (a.k.a. CIE LCh_uv) to standard RGB (sRGB)
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.
void SRGBfromHSV (float * rgb, float * hsv)
Converts HSV color (Hue Saturation Value) to sRGB color (as in SBColor)
void SRGBfromRGB (float * srgb, float * rgb)
Converts linear RGB values to standard RGB (sRGB) values.
double SRGBtoGrayscale (double r, double g, double b)
Converts sRGB to grayscale.
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)
void cylindricalCIELabfromSRGB (float * hcl, float * rgb)
Converts standard RGB (sRGB) to CIE L*a*b* in cylindrical coordinates a.k.a. (CIE LCh_ab)
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)
void cylindricalCIELuvfromSRGB (float * hcl, float * rgb)
Converts standard RGB (sRGB) to CIE L*u*v* in cylindrical coordinates (a.k.a. CIE LCh_uv)
void darkenSRGBColor (float * rgb, float amount)
Darkens the standard RGB (sRGB) color rgb by the amountamount .
SBDTypeColor fromHCL (float hue, float chroma, float luminance)
Creates a color from a given HCL (CIE LCh_uv) color.
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)
SBDTypeColor fromHSV (float hue, float saturation, float value)
Creates a color from a given HSV color.
void fromHSV (float * color, float * hsv)
Converts HSV color (Hue Saturation Value) to sRGB color (as in SBColor)
void lightenSRGBColor (float * rgb, float amount)
Lightens the standard RGB (sRGB) color rgb by the amountamount .
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)
void toHSV (float * hsv, float * color)
Converts sRGB color (as in SBColor) to HSV (Hue Saturation Value)

Protected Attributes#

Type Name
SBDTypeColorData * dataPointer
A pointer to the private data.

Detailed Description#

This class describes a color in SAMSON.

Please refer to the Color schemes for more information.

Short name: SBColor

SBColor uses the standard RGB (sRGB).

Color 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);

Note: The conversions might not always be exact. For example, a conversion 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 arithmetic.

See also: Color schemes, SBDPalette

Public Static Attributes Documentation#

variable black#

The black color.

SBDTypeColor const SBDTypeColor::black;


variable blue#

The blue color.

SBDTypeColor const SBDTypeColor::blue;


variable cyan#

The cyan color.

SBDTypeColor const SBDTypeColor::cyan;


variable defaultKeyframeColor#

The default keyframe color.

SBDTypeColor const SBDTypeColor::defaultKeyframeColor;


variable globalXAxis#

The global X axis color.

SBDTypeColor const SBDTypeColor::globalXAxis;


variable globalYAxis#

The global Y axis color.

SBDTypeColor const SBDTypeColor::globalYAxis;


variable globalZAxis#

The global Z axis color.

SBDTypeColor const SBDTypeColor::globalZAxis;


variable green#

The green color.

SBDTypeColor const SBDTypeColor::green;


variable ice#

The frozen color.

SBDTypeColor const SBDTypeColor::ice;


variable localXAxis#

The local X axis color.

SBDTypeColor const SBDTypeColor::localXAxis;


variable localYAxis#

The local Y axis color.

SBDTypeColor const SBDTypeColor::localYAxis;


variable localZAxis#

The local Z axis color.

SBDTypeColor const SBDTypeColor::localZAxis;


variable magenta#

The magenta color.

SBDTypeColor const SBDTypeColor::magenta;


variable orange#

The orange color.

SBDTypeColor const SBDTypeColor::orange;


variable red#

The red color.

SBDTypeColor const SBDTypeColor::red;


variable white#

The white color.

SBDTypeColor const SBDTypeColor::white;


variable yellow#

The yellow color.

SBDTypeColor const SBDTypeColor::yellow;


Public Functions Documentation#

function SBDTypeColor [1/8]#

Constructs a color (1.0f, 1.0f, 1.0f, 1.0f)

SBDTypeColor::SBDTypeColor () 

Constructs a default color (white with full opacity).

Creates a color with red, green, blue components set to 1.0 and alpha set to 1.0.


function SBDTypeColor [2/8]#

Constructs a color (red, green, blue, alpha)

SBDTypeColor::SBDTypeColor (
    float red,
    float green,
    float blue,
    float alpha=1.0f
) 

Constructs a color from floating-point components.

Creates a color with the specified red, green, blue, and alpha components.

Parameters:

  • red Red component in the [0.0, 1.0] range.
  • green Green component in the [0.0, 1.0] range.
  • blue Blue component in the [0.0, 1.0] range.
  • alpha Alpha component in the [0.0, 1.0] range (default = 1.0).

function SBDTypeColor [3/8]#

Constructs a color (red, green, blue, alpha)

SBDTypeColor::SBDTypeColor (
    int red,
    int green,
    int blue,
    int alpha=255
) 

Constructs a color from integer components.

Creates a color with the specified red, green, blue, and alpha components given as integers in the [0, 255] range.

Parameters:

  • red Red component in the [0, 255] range.
  • green Green component in the [0, 255] range.
  • blue Blue component in the [0, 255] range.
  • alpha Alpha component in the [0, 255] range (default = 255).

function SBDTypeColor [4/8]#

Constructs a color (red, green, blue, alpha)

SBDTypeColor::SBDTypeColor (
    unsigned char red,
    unsigned char green,
    unsigned char blue,
    unsigned char alpha=255
) 

Constructs a color from unsigned byte components.

Creates a color with the specified red, green, blue, and alpha components given as unsigned bytes (0-255).

Parameters:

  • red Red component (0-255).
  • green Green component (0-255).
  • blue Blue component (0-255).
  • alpha Alpha component (0-255, default = 255).

function SBDTypeColor [5/8]#

Constructs a color (color[0], color[1], color[2], color[3])

SBDTypeColor::SBDTypeColor (
    float * color
) 

Constructs a color from an array of four floats.

The array must contain the red, green, blue, and alpha components in that order.

Parameters:

  • color Pointer to an array of four floats representing the color components.

function SBDTypeColor [6/8]#

Constructs a color from hex color.

SBDTypeColor::SBDTypeColor (
    const std::string & hexColor
) 

Creates a color from a hexadecimal color string.

The hex color can start with '#' or not and should contain a hex triplet (six‑digit) or hex quadruplet (eight‑digit) representing RGBA.

Examples:

SBColor color1 = SBDTypeColor("#0099CC");
SBColor color2 = SBDTypeColor("0099CC");

Parameters:

  • hexColor Hexadecimal color string, optionally prefixed with '#'.

function SBDTypeColor [7/8]#

Copy constructor.

SBDTypeColor::SBDTypeColor (
    const SBDTypeColor & color
) 

Creates a new color with the same component values as the source color.

Parameters:

  • color Source color to copy.

function SBDTypeColor [8/8]#

Move constructor.

SBDTypeColor::SBDTypeColor (
    SBDTypeColor && color
) noexcept

Constructs a new color by moving the component values from the source color. The source color is left in a valid but unspecified state.

Parameters:

  • color Source color to move from.

function bound#

Bounds the components within [0, 1].

SBDTypeColor & SBDTypeColor::bound () 

Clamps the color components to the range [0, 1].

Ensures each component (red, green, blue, alpha) lies within the interval [0, 1].

Returns:

Reference to this color after bounding.


function bounded#

Returns a bounded version of the color with components within [0, 1].

SBDTypeColor SBDTypeColor::bounded () const

Returns a bounded copy of the color.

Creates a new color whose components are clamped to the range [0, 1].

Returns:

New color with components bounded to [0, 1].


function freeze#

Mixes the color with the frozen color.

SBDTypeColor & SBDTypeColor::freeze () 

Blends this color with the predefined frozen color (ice) using a fixed weighting (20 % original, 80 % frozen).

Returns:

Reference to this color after freezing.


function frozen#

Returns a frozen version of the color.

SBDTypeColor SBDTypeColor::frozen () const

The frozen version blends the current color with the predefined frozen color using a fixed ratio of 20% of the original color and 80% of the frozen color.

Returns:

A new SBDTypeColor representing the frozen color.


function getAlpha#

Sets the blue component, the value should be in the [0.0, 1.0] interval.

float SBDTypeColor::getAlpha () const

Returns the alpha component as a floating-point value in the range [0.0, 1.0].

Returns:

The alpha component.


function getAlphaInt#

Returns the alpha component, the value is in the [0.0, 1.0] interval.

int SBDTypeColor::getAlphaInt () const

Returns the alpha component as an integer in the range [0, 255].

Returns:

The alpha component as an integer.


function getBlue#

Sets the green component, the value should be in the [0.0, 1.0] interval.

float SBDTypeColor::getBlue () const

Returns the blue component as a floating-point value in the range [0.0, 1.0].

Returns:

The blue component.


function getBlueInt#

Returns the blue component, the value is in the [0.0, 1.0] interval.

int SBDTypeColor::getBlueInt () const

Returns the blue component as an integer in the range [0, 255].

Returns:

The blue component as an integer.


function getColor [1/2]#

Sets the alpha component, the value should be in the [0.0, 1.0] interval.

const float * SBDTypeColor::getColor () const

Returns a pointer to the internal color array (red, green, blue, alpha).

Returns a pointer to the color array (size of 4)

The returned pointer may be nullptr if the internal data is unavailable.

Returns:

Pointer to an array of four floats, or nullptr.


function getColor [2/2]#

Stores the four components as a float array with the size of 4.

void SBDTypeColor::getColor (
    float * color
) const

Copies the color components into a user-provided array.

The destination array must have space for four float values.

Parameters:

  • color Destination array to receive the color components (size 4).

function getGreen#

Sets the red component, the value should be in the [0.0, 1.0] interval.

float SBDTypeColor::getGreen () const

Returns the green component as a floating-point value in the range [0.0, 1.0].

Returns:

The green component.


function getGreenInt#

Returns the green component, the value is in the [0.0, 1.0] interval.

int SBDTypeColor::getGreenInt () const

Returns the green component as an integer in the range [0, 255].

Returns:

The green component as an integer.


function getRGBString#

Returns the RGB[A] string representation of the color as "rgb(r, g, b)" or "rgba(r, g, b, a)" if includeAlpha istrue ; with integer numbers in the [0, 255] interval.

std::string SBDTypeColor::getRGBString (
    bool includeAlpha=false
) const

Returns the RGB[A] string representation of the color.

Format: "rgb(r, g, b)" or "rgba(r, g, b, a)" when includeAlpha is true. The components are integers in the range [0, 255].

Parameters:

  • includeAlpha If true, includes the alpha component in the output string.

Returns:

Formatted RGB or RGBA string.


function getRed#

Returns the red component as a floating-point value in the range [0.0, 1.0].

float SBDTypeColor::getRed () const

Returns:

The red component.


function getRedInt#

Returns the red component, the value is in the [0.0, 1.0] interval.

int SBDTypeColor::getRedInt () const

Returns the red component as an integer in the range [0, 255].

Returns:

The red component as an integer.


function isSerializable#

Returns true __

bool SBDTypeColor::isSerializable () const

Checks whether the color type is serializable.

This function always returns true for SBDTypeColor.

Returns:

true indicating that the object can be serialized.


function operator!=#

Inequality operator.

bool SBDTypeColor::operator!= (
    const SBDTypeColor & color
) const

Determines whether two colors differ in any component.

Parameters:

  • color Other color to compare with.

Returns:

true if any component differs; otherwise false.


function operator*#

Multiply all components by f , including opacity.

SBDTypeColor SBDTypeColor::operator* (
    float f
) const

Scales the color by a factor.

Multiplies each component (red, green, blue, alpha) by the given factor and returns a new color.

Parameters:

  • f Scaling factor.

Returns:

New color with scaled components.


function operator*#

Component-wise multiplication by color , including opacity.

SBDTypeColor SBDTypeColor::operator* (
    const SBDTypeColor & color
) const

Component‑wise multiplication of two colors.

Multiplies the corresponding components of this color and the given color, returning a new color.

Parameters:

  • color Other color to multiply with.

Returns:

New color resulting from component‑wise multiplication.


function operator*=#

Multiply all components by f , including opacity.

SBDTypeColor & SBDTypeColor::operator*= (
    float f
) 

Scales this color by a factor in-place.

Multiplies each component of this color by the given factor.

Parameters:

  • f Scaling factor.

Returns:

Reference to this color after scaling.


function operator*=#

Component-wise multiplication by color , including opacity.

SBDTypeColor & SBDTypeColor::operator*= (
    const SBDTypeColor & color
) 

Component‑wise multiplication in‑place.

Multiplies each component of this color by the corresponding component of the given color.

Parameters:

  • color Other color to multiply with.

Returns:

Reference to this color after multiplication.


function operator+#

Component-wise addition by color , including opacity.

SBDTypeColor SBDTypeColor::operator+ (
    const SBDTypeColor & color
) const

Component‑wise addition of two colors.

Adds the corresponding components of this color and the given color, returning a new color.

Parameters:

  • color Other color to add.

Returns:

New color resulting from component‑wise addition.


function operator+=#

Component-wise addition by color , including opacity.

SBDTypeColor & SBDTypeColor::operator+= (
    const SBDTypeColor & color
) 

Component‑wise addition in‑place.

Adds each component of the given color to this color.

Parameters:

  • color Other color to add.

Returns:

Reference to this color after addition.


function operator-#

Component-wise subtraction by color , including opacity.

SBDTypeColor SBDTypeColor::operator- (
    const SBDTypeColor & color
) const

Component‑wise subtraction of two colors.

Subtracts the corresponding components of the given color from this color, returning a new color.

Parameters:

  • color Other color to subtract.

Returns:

New color resulting from component‑wise subtraction.


function operator-=#

Component-wise subtraction by color , including opacity.

SBDTypeColor & SBDTypeColor::operator-= (
    const SBDTypeColor & color
) 

Component‑wise subtraction in‑place.

Subtracts each component of the given color from this color.

Parameters:

  • color Other color to subtract.

Returns:

Reference to this color after subtraction.


function operator=#

Copy assignment.

SBDTypeColor & SBDTypeColor::operator= (
    const SBDTypeColor & color
) 

Copy assignment operator.

Copies the color components from another color.

Parameters:

  • color Source color to copy from.

Returns:

Reference to this color after assignment.


function operator=#

Move assignment.

SBDTypeColor & SBDTypeColor::operator= (
    SBDTypeColor && color
) noexcept

Move assignment operator.

Moves the color components from another color into this one.

Parameters:

  • color Source color to move from.

Returns:

Reference to this color after move assignment.


function operator==#

Equality operator.

bool SBDTypeColor::operator== (
    const SBDTypeColor & color
) const

Determines whether two colors have identical component values.

Parameters:

  • color Other color to compare with.

Returns:

true if all components are equal; otherwise false.


function operator[]#

Returns a reference to component index .

float & SBDTypeColor::operator[] (
    int index
) 

Provides mutable access to a color component by index.

Index 0 = red, 1 = green, 2 = blue, 3 = alpha.

Parameters:

  • index Component index (0-3).

Returns:

Reference to the requested component.


function operator[]#

Returns a reference to component index (const version)

const float & SBDTypeColor::operator[] (
    int index
) const

Provides read-only access to a color component by index.

Index 0 = red, 1 = green, 2 = blue, 3 = alpha.

Parameters:

  • index Component index (0-3).

Returns:

Const reference to the requested component.


function print#

Prints the color.

virtual void SBDTypeColor::print (
    unsigned int offset=0
) const

Prints the color to standard output with optional indentation.

Each component is printed as a floating-point value.

Parameters:

  • offset Number of tab characters to prepend before printing.

function serialize#

Serializes the color.

void SBDTypeColor::serialize (
    SBCSerializer * serializer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) const

Serializes the color to a serializer.

Writes the color components (red, green, blue, alpha) to the given serializer.

Parameters:

  • serializer Pointer to the serializer used for writing the data.
  • sdkVersionNumber Version number of the SDK; defaults to SB_SDK_VERSION_NUMBER.

function setAlpha [1/2]#

Returns the alpha component, the value is in the [0, 255] interval.

void SBDTypeColor::setAlpha (
    int alpha
) 

Sets the alpha component using an integer value in the range [0, 255].

Parameters:

  • alpha Alpha component as an integer.

function setAlpha [2/2]#

Sets the alpha component, the value should be in the [0, 255] interval.

void SBDTypeColor::setAlpha (
    float alpha
) 

Sets the alpha component using a floating-point value in the range [0.0, 1.0].

Parameters:

  • alpha Alpha component as a float.

function setBlue [1/2]#

Returns the blue component, the value is in the [0, 255] interval.

void SBDTypeColor::setBlue (
    int blue
) 

Sets the blue component using an integer value in the range [0, 255].

Parameters:

  • blue Blue component as an integer.

function setBlue [2/2]#

Sets the blue component, the value should be in the [0, 255] interval.

void SBDTypeColor::setBlue (
    float blue
) 

Sets the blue component using a floating-point value in the range [0.0, 1.0].

Parameters:

  • blue Blue component as a float.

function setGreen [1/2]#

Returns the green component, the value is in the [0, 255] interval.

void SBDTypeColor::setGreen (
    int green
) 

Sets the green component using an integer value in the range [0, 255].

Parameters:

  • green Green component as an integer.

function setGreen [2/2]#

Sets the green component, the value should be in the [0, 255] interval.

void SBDTypeColor::setGreen (
    float green
) 

Sets the green component using a floating-point value in the range [0.0, 1.0].

Parameters:

  • green Green component as a float.

function setRed [1/2]#

Returns the red component, the value is in the [0, 255] interval.

void SBDTypeColor::setRed (
    int red
) 

Sets the red component using an integer value in the range [0, 255].

Parameters:

  • red Red component as an integer.

function setRed [2/2]#

Sets the red component, the value should be in the [0, 255] interval.

void SBDTypeColor::setRed (
    float red
) 

Sets the red component using a floating-point value in the range [0.0, 1.0].

Parameters:

  • red Red component as a float.

function toGrayscale#

Returns the grayscale representation of the color.

double SBDTypeColor::toGrayscale () const

The grayscale value is computed as 0.299 * R + 0.587 * G + 0.114 * B.

Returns:

Grayscale value as a double.


function toHex#

Returns the hex representation of the color.

std::string SBDTypeColor::toHex (
    bool includeAlpha=false
) const

Returns the hexadecimal representation of the color, prefixed with '#'.

The result is a six-digit hex string for RGB or an eight-digit string for RGBA when includeAlpha is true.

Parameters:

  • includeAlpha If true, includes the alpha component in the hex string.

Returns:

Hexadecimal color string.


function toPythonCode#

Returns the string representation of the object that can be used to reconstruct it in Python.

virtual std::string SBDTypeColor::toPythonCode () const

Returns a Python code representation of the color.

The string can be used to reconstruct the SBColor object in Python.

Returns:

Python code string for this color.


function unserialize#

Unserializes the color.

void SBDTypeColor::unserialize (
    SBCSerializer * serializer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) 

Unserializes the color from a serializer.

Reads the color components (red, green, blue, alpha) from the given serializer.

Parameters:

  • serializer Pointer to the serializer used for reading the data.
  • sdkVersionNumber Version number of the SDK; defaults to SB_SDK_VERSION_NUMBER.

function ~SBDTypeColor#

Destructs the color.

virtual SBDTypeColor::~SBDTypeColor () 

Destructor.

Destroys the color and releases any allocated resources.


Public Static Functions Documentation#

function CIELabfromCIEXYZ#

Converts CIE XYZ D65/2° to CIE L*a*b*.

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

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)

function CIELabfromCylindricalCIELab#

Converts CIE L*a*b* in cylindrical coordinates (a.k.a. CIE LCh_ab) to CIE L*a*b*.

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

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

function CIELabfromSRGB#

Converts color from standard RGB (sRGB) color space to CIE L*a*b* color space.

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

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)

function CIELuvfromCIEXYZ#

Converts CIE XYZ D65/2° to CIE L*u*v*.

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

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).

function CIELuvfromCylindricalCIELuv#

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

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

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

function CIEXYZfromCIELab#

Converts CIE L*a*b* to CIE XYZ D65/2°

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

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

function CIEXYZfromCIELuv#

Converts CIE L*u*v* to CIE XYZ D65/2°

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

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.

function CIEXYZfromRGB#

Converts linear RGB to CIE XYZ with D65/2° standard illuminant.

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

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).

function CIEXYZfromSRGB#

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

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

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).

function CIEuvfromCIEXYZ#

Converts CIE XYZ D65/2° to u and v coordinates for the CIE Luv.

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

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).

function HCLfromSRGB#

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

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

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

function HSVfromSRGB#

Converts sRGB color (as in SBColor) to HSV (Hue Saturation Value)

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

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

Parameters:

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

function RGBfromCIEXYZ#

Converts CIE XYZ with D65/2° standard illuminant to linear RGB.

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

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)

function RGBfromSRGB#

Converts standard RGB (sRGB) values to linear RGB values.

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

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

Parameters:

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

function SRGBfromCIELab#

Converts color from CIE L*a*b* color space to standard RGB (sRGB) color space.

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

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

function SRGBfromCIEXYZ#

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

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

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 chromaticities. 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)

function SRGBfromCylindricalCIELab#

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

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

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

function SRGBfromCylindricalCIELuv#

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

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

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

function SRGBfromHCL#

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

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

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

function SRGBfromHSV#

Converts HSV color (Hue Saturation Value) to sRGB color (as in SBColor)

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

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

Parameters:

  • rgb Output array (size 3) receiving the sRGB color components.
  • hsv Input array (size 3) containing hue, saturation, and value components.

function SRGBfromRGB#

Converts linear RGB values to standard RGB (sRGB) values.

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

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

Parameters:

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

function SRGBtoGrayscale#

Converts sRGB to grayscale.

static double SBDTypeColor::SRGBtoGrayscale (
    double r,
    double g,
    double b
) 

Converts sRGB components to a grayscale value.

The calculation uses the formula 0.299 * R + 0.587 * G + 0.114 * B.

Parameters:

  • r Red component in the range [0.0, 1.0].
  • g Green component in the range [0.0, 1.0].
  • b Blue component in the range [0.0, 1.0].

Returns:

Grayscale value as a double.


function cylindricalCIELabfromCIELab#

Converts CIE L*a*b* to CIE L*a*b* in cylindrical coordinates (a.k.a. CIE LCh_ab)

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

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*

function cylindricalCIELabfromSRGB#

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

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

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)

function cylindricalCIELuvfromCIELuv#

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

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

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*

function cylindricalCIELuvfromSRGB#

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

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

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)

function darkenSRGBColor#

Darkens the standard RGB (sRGB) color rgb by the amountamount .

static void SBDTypeColor::darkenSRGBColor (
    float * rgb,
    float amount
) 

SBDTypeColor::darkenSRGBColor - Darkens the given sRGB color by a specified amount.

Parameters:

  • rgb - Array (size 3) containing the sRGB color components to be darkened; modified in place.
  • amount - Amount to darken the color; positive values darken, negative values lighten.

function fromHCL [1/2]#

Creates a color from a given HCL (CIE LCh_uv) color.

static SBDTypeColor SBDTypeColor::fromHCL (
    float hue,
    float chroma,
    float luminance
) 

Creates a color from HCL (Hue, Chroma, Luminance) components.

The resulting color has an alpha component of 1.0.

Parameters:

  • hue Hue component.
  • chroma Chroma component.
  • luminance Luminance component.

Returns:

A new SBDTypeColor representing the HCL color.


function fromHCL [2/2]#

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

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

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

function fromHSV [1/2]#

Creates a color from a given HSV color.

static SBDTypeColor SBDTypeColor::fromHSV (
    float hue,
    float saturation,
    float value
) 

Creates a color from HSV (Hue, Saturation, Value) components.

The resulting color has an alpha component of 1.0.

Parameters:

  • hue Hue component (typically [0, 360] or [0, 1]).
  • saturation Saturation component in the range [0.0, 1.0].
  • value Value component in the range [0.0, 1.0].

Returns:

A new SBDTypeColor representing the HSV color.


function fromHSV [2/2]#

Converts HSV color (Hue Saturation Value) to sRGB color (as in SBColor)

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

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

function lightenSRGBColor#

Lightens the standard RGB (sRGB) color rgb by the amountamount .

static void SBDTypeColor::lightenSRGBColor (
    float * rgb,
    float amount
) 

SBDTypeColor::lightenSRGBColor - Lightens the given sRGB color by a specified amount.

Parameters:

  • rgb - Array (size 3) containing the sRGB color components to be lightened; modified in place.
  • amount - Amount to lighten the color; positive values lighten.

function toHCL#

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

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

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

function toHSV#

Converts sRGB color (as in SBColor) to HSV (Hue Saturation Value)

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

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

Protected Attributes Documentation#

variable dataPointer#

A pointer to the private data.

SBDTypeColorData* SBDTypeColor::dataPointer;