ColorChooser Library

Detailed Description

Classes

class  ColorSwatchGroup
 
class  ColorSwatchData
 

Macros

#define LIB_COLORCHOOSER
 
#define LIB_COLORSWATCHDATA
 
#define LIB_COLORSWATCHGROUP
 

Typedefs

using ColorAlphaArray = maxon::BaseArray< maxon::ColorA >
 

Enumerations

enum  SWATCH_CATEGORY {
  GLOBAL,
  DOCUMENT
}
 

Functions

enum SWATCH_CATEGORY MAXON_ENUM_LIST (SWATCH_CATEGORY)
 
String ColorRGBToString (const Vector &color)
 
String ColorHSVToString (const Vector &color)
 
Int ColorComponentFloatTo8Bit (Float colorComponent)
 
Float ColorComponent8BitToFloat (Int colorComponent)
 
void ColorFloatTo8Bit (const Vector &floatColor, Int &red, Int &green, Int &blue)
 
Vector Color8BitToFloat (Int red, Int green, Int blue)
 
Int ColorComponentFloatTo16Bit (Float colorComponent)
 
Float ColorComponent16BitToFloat (Int colorComponent)
 
void ColorFloatTo16Bit (const Vector &floatColor, Int &red, Int &green, Int &blue)
 
Vector Color16BitToFloat (Int red, Int green, Int blue)
 
Vector ColorKelvinTemperatureToRGB (Float kelvinDegrees, Float tint=0.0)
 
Bool ColorHarmonyGetComplementary (const Vector &color, Bool ryb, maxon::BaseArray< Vector > &palette)
 
Bool ColorHarmonyGetSplitComplementary (const Vector &color, Bool ryb, maxon::BaseArray< Vector > &palette)
 
Bool ColorHarmonyGetTetradic (const Vector &color, Bool ryb, maxon::BaseArray< Vector > &palette)
 
Bool ColorHarmonyGetAnalogous (const Vector &color, Int colorCount, Bool ryb, maxon::BaseArray< Vector > &palette)
 
Bool ColorHarmonyGetEquiangular (const Vector &color, Int colorCount, Bool ryb, maxon::BaseArray< Vector > &palette)
 
Bool ColorHarmonyRotateColor (const Vector &color, Int colorCount, Float angle, Bool ryb, maxon::BaseArray< Vector > &palette)
 
Bool ColorHarmonyInterpolateColors (const Vector &color1, const Vector &color2, Int colorCount, Bool ryb, maxon::BaseArray< Vector > &palette)
 

Variables

class ColorSwatchGroup MAXON_ENUM_LIST
 

Macro Definition Documentation

◆ LIB_COLORCHOOSER

#define LIB_COLORCHOOSER

ColorChooser library ID.

◆ LIB_COLORSWATCHDATA

#define LIB_COLORSWATCHDATA

ColorSwatchData library ID.

◆ LIB_COLORSWATCHGROUP

#define LIB_COLORSWATCHGROUP

ColorSwatchGroup library ID.

Typedef Documentation

◆ ColorAlphaArray

Enumeration Type Documentation

◆ SWATCH_CATEGORY

enum SWATCH_CATEGORY
strong
Enumerator
GLOBAL 
DOCUMENT 

Function Documentation

◆ MAXON_ENUM_LIST()

enum SWATCH_CATEGORY MAXON_ENUM_LIST ( SWATCH_CATEGORY  )

◆ ColorRGBToString()

String ColorRGBToString ( const Vector color)

Converts a RGB color to string formatted based on the color range defined in Cinema 4D preferences: WPREF_COLOR_RGBRANGE Example: The string result for the color Vector(0.45, 0.32, 1.0) will be "115, 82, 255" if WPREF_COLOR_RGBRANGE is configured to COLORSYSTEM_RANGE_255.

Since
R18
Parameters
[in]colorThe RGB color to convert to string. Its components must be in range [0.0, 1.0].
Returns
The string representation of the color.

◆ ColorHSVToString()

String ColorHSVToString ( const Vector color)

Converts a HSV color to string. Example: The string result for the color Vector(0.45, 0.32, 1.0) will be "251.471 &deg;, 68 %, 100 %"

Since
R18
Parameters
[in]colorThe HSV color to convert to string. Its components must be in range [0.0, 1.0].
See also
RGBToHSV() / HSVToRGB()
Returns
The string representation of the color.

◆ ColorComponentFloatTo8Bit()

Int ColorComponentFloatTo8Bit ( Float  colorComponent)

Converts a RGB float color component in range [0.0, 1.0] to 8-bit (range [0, 255]).

Since
R18
Parameters
[in]colorComponentThe color component to be converted. Must be in range [0.0, 1.0].
Returns
The converted 8bit color component.

◆ ColorComponent8BitToFloat()

Float ColorComponent8BitToFloat ( Int  colorComponent)

Converts a RGB 8bit color component (range [0, 255]) to float in range [0.0, 1.0].

Since
R18
Parameters
[in]colorComponentThe 8-bit color component to be converted. Must be in range [0, 255].
Returns
The converted color component in range [0.0, 1.0].

◆ ColorFloatTo8Bit()

void ColorFloatTo8Bit ( const Vector floatColor,
Int red,
Int green,
Int blue 
)

Converts a RGB float color in range [0.0, 1.0] to 8-bit color (range [0, 255]).

Since
R18
Parameters
[in]floatColorThe color to be converted. Must be in range [0.0, 1.0].
[out]redThe converted 8-bit red color component.
[out]greenThe converted 8-bit green color component.
[out]blueThe converted 8-bit blue color component.

◆ Color8BitToFloat()

Vector Color8BitToFloat ( Int  red,
Int  green,
Int  blue 
)

Converts a RGB 8-bit color (range [0, 255]) to float color in range [0.0, 1.0].

Since
R18
Parameters
[in]redThe 8-bit color component to be converted. Must be in range [0, 255].
[in]greenThe 8-bit color component to be converted. Must be in range [0, 255].
[in]blueThe 8-bit color component to be converted. Must be in range [0, 255].
Returns
The converted float color.

◆ ColorComponentFloatTo16Bit()

Int ColorComponentFloatTo16Bit ( Float  colorComponent)

Converts a RGB float color component in range [0.0, 1.0] to 16-bit (range [0, 65535]).

Since
R18
Parameters
[in]colorComponentThe color component to be converted. Must be in range [0.0, 1.0].
Returns
The converted 16-bit color component.

◆ ColorComponent16BitToFloat()

Float ColorComponent16BitToFloat ( Int  colorComponent)

Converts a RGB 16-bit color component (range [0, 65535]) to float in range [0.0, 1.0].

Since
R18
Parameters
[in]colorComponentThe 16-bit color component to be converted. Must be in range [0, 65535].
Returns
The converted color component in range [0.0, 1.0].

◆ ColorFloatTo16Bit()

void ColorFloatTo16Bit ( const Vector floatColor,
Int red,
Int green,
Int blue 
)

Converts a RGB float color in range [0.0, 1.0] to 16-bit color (range [0, 65535]).

Since
R18
Parameters
[in]floatColorThe color to be converted. Must be in range [0.0, 1.0].
[out]redThe converted 16-bit red color component.
[out]greenThe converted 16-bit green color component.
[out]blueThe converted 16-bit blue color component.

◆ Color16BitToFloat()

Vector Color16BitToFloat ( Int  red,
Int  green,
Int  blue 
)

Converts a RGB 16-bit color (range [0, 65535]) to float color in range [0.0, 1.0].

Since
R18
Parameters
[in]redThe 8-bit color component to be converted. Must be in range [0, 65535].
[in]greenThe 8-bit color component to be converted. Must be in range [0, 65535].
[in]blueThe 8-bit color component to be converted. Must be in range [0, 65535].
Returns
The converted float color.

◆ ColorKelvinTemperatureToRGB()

Vector ColorKelvinTemperatureToRGB ( Float  kelvinDegrees,
Float  tint = 0.0 
)

Converts color Kelvin temperature to RGB value.

Since
R18
Parameters
[in]kelvinDegreesThe Kelvin temperature value in Kelvin degrees. Useful range: [1000.0, 10000.0] °K
[in]tintOffsets the color temperature from green (negative value) to magenta (positive value). Set to 0.0 to disable tinting. Value will be clamped to range [-1.0, 1.0].
Returns
The converted RGB color value.

◆ ColorHarmonyGetComplementary()

Bool ColorHarmonyGetComplementary ( const Vector color,
Bool  ryb,
maxon::BaseArray< Vector > &  palette 
)

Generates a Complementary Color Harmony palette from color. Contains the input color and its opposite color in a Color Wheel.

Since
R18
Parameters
[in]colorThe color to generate the palette. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
[in]rybSet to true to use RYB (red-yellow-blue) HSV space, set to false to use RGB (red-green-blue) HSV space. RYB generates visually more nicer palettes, but is less accurate because is smaller that RGB space. This means different RGB values could be converted to the same RYB value.
[out]paletteList to add generated colors to. Data is preserved.
Returns
true if successful, otherwise false.

◆ ColorHarmonyGetSplitComplementary()

Bool ColorHarmonyGetSplitComplementary ( const Vector color,
Bool  ryb,
maxon::BaseArray< Vector > &  palette 
)

Generates a Split Complementary Color Harmony palette from color. Contains the input color and the two analogous colors to its complementary color The complementary color is calculated rotating 180° the hue of the original color in HSV space.

Since
R18
Parameters
[in]colorThe color to generate the palette. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
[in]rybSet to true to use RYB (red-yellow-blue) HSV space, set to false to use RGB (red-green-blue) HSV space. RYB generates visually more nicer palettes, but is less accurate because is smaller that RGB space. This means different RGB values could be converted to the same RYB value.
[out]paletteList to add generated colors to. Data is preserved.
Returns
true if successful, otherwise false.

◆ ColorHarmonyGetTetradic()

Bool ColorHarmonyGetTetradic ( const Vector color,
Bool  ryb,
maxon::BaseArray< Vector > &  palette 
)

Generates a Tetradric Color Harmony palette. The rectangle or tetradic color scheme uses four colors arranged into two complementary pairs.

Since
R18
Parameters
[in]colorThe color to generate the palette. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
[in]rybSet to true to use RYB (red-yellow-blue) HSV space, set to false to use RGB (red-green-blue) HSV space. RYB generates visually more nicer palettes, but is less accurate because is smaller that RGB space. This means different RGB values could be converted to the same RYB value.
[out]paletteList to add generated colors to. Data is preserved.
Returns
true if successful, otherwise false.

◆ ColorHarmonyGetAnalogous()

Bool ColorHarmonyGetAnalogous ( const Vector color,
Int  colorCount,
Bool  ryb,
maxon::BaseArray< Vector > &  palette 
)

Generates an Analogous Color Harmony palette. Analogous color schemes use colors that are next to each other on the color wheel, i.e. 30° far away.

Since
R18
Parameters
[in]colorThe color to generate the palette. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
[in]colorCountNumber of colors to generate. Because of input color is added as well, the resulting palette will have colorCount + 1 colors.
[in]rybSet to true to use RYB (red-yellow-blue) HSV space, set to false to use RGB (red-green-blue) HSV space. RYB generates visually more nicer palettes, but is less accurate because is smaller that RGB space. This means different RGB values could be converted to the same RYB value.
[out]paletteList to add generated colors to. Data is preserved.
Returns
true if successful, otherwise false.

◆ ColorHarmonyGetEquiangular()

Bool ColorHarmonyGetEquiangular ( const Vector color,
Int  colorCount,
Bool  ryb,
maxon::BaseArray< Vector > &  palette 
)

Generates an Equiangular Color Harmony palette. All colors are evenly arranged around the color wheel.

Since
R18
Parameters
[in]colorThe color to generate the palette. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
[in]colorCountNumber of colors to generate. Because of input color is added as well, the resulting palette will have colorCount + 1 colors.
[in]rybSet to true to use RYB (red-yellow-blue) HSV space, set to false to use RGB (red-green-blue) HSV space. RYB generates visually more nicer palettes, but is less accurate because is smaller that RGB space. This means different RGB values could be converted to the same RYB value.
[out]paletteList to add generated colors to. Data is preserved.
Returns
true if successful, otherwise false.

◆ ColorHarmonyRotateColor()

Bool ColorHarmonyRotateColor ( const Vector color,
Int  colorCount,
Float  angle,
Bool  ryb,
maxon::BaseArray< Vector > &  palette 
)

Generates a palette composed by a defined amount of colors whose hue is separated by a defined angle in HSV color space.

Since
R18
Parameters
[in]colorThe color to generate the palette. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
[in]colorCountNumber of colors to generate. Because of input color is added as well, the resulting palette will have colorCount + 1 colors.
[in]angleRotation angle in radians.
See also
DegToRad()
Parameters
[in]rybSet to true to use RYB (red-yellow-blue) HSV space, set to false to use RGB (red-green-blue) HSV space. RYB generates visually more nicer palettes, but is less accurate because is smaller that RGB space. This means different RGB values could be converted to the same RYB value.
[out]paletteList to add generated colors to. Data is preserved.
Returns
true if successful, otherwise false.

◆ ColorHarmonyInterpolateColors()

Bool ColorHarmonyInterpolateColors ( const Vector color1,
const Vector color2,
Int  colorCount,
Bool  ryb,
maxon::BaseArray< Vector > &  palette 
)

Generates a palette composed by a defined amount of colors interpolated between color1 and color2 in HSV color space. All 3 HSV values will be interpolated.

Since
R18
Parameters
[in]color1The first generator color. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
[in]color2The second generator color. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
[in]colorCountNumber of colors to generate. Because of the two input colors are added as well, the resulting palette will have colorCount + 2 colors.
[in]rybSet to true to use RYB (red-yellow-blue) HSV space, set to false to use RGB (red-green-blue) HSV space. RYB generates visually more nicer palettes, but is less accurate because is smaller that RGB space. This means different RGB values could be converted to the same RYB value.
[out]paletteList to add generated colors to. Data is preserved.
Returns
true if successful, otherwise false.

Variable Documentation

◆ MAXON_ENUM_LIST

class ColorSwatchGroup MAXON_ENUM_LIST