About
Along with the ColorSwatchData and ColorSwatchGroup types these utility functions were introduced to handle colors. The functions are defined in the lib_colorchooser.h
header file.
String Conversion
These functions convert a given RGB color value to a formatted String:
Definition: c4d_gedata.h:83
const Vector & GetVector() const
Definition: c4d_gedata.h:486
Definition: c4d_string.h:39
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:210
String ColorHSVToString(const Vector &color)
String ColorRGBToString(const Vector &color)
#define ConstDescID(...)
Definition: lib_description.h:594
@ MATERIAL_COLOR_COLOR
Definition: mmaterial.h:56
Represents a level within a DescID.
Definition: lib_description.h:298
Color Format Conversion
The following functions allow easy conversion of colors stored in different formats.
These functions convert float colors (0.0 ... 1.0) to 8-bit colors (0 .. 255):
These functions convert float colors (0.0 ... 1.0) to 16-bit colors (0 .. 65536):
Also, a Kelvin color temperature can be converted:
const Float kelvin = 2600.0;
maxon::Float Float
Definition: ge_sys_math.h:66
Vector ColorKelvinTemperatureToRGB(Float kelvinDegrees, Float tint=0.0)
@ LIGHT_COLOR
Definition: olight.h:6
Color Harmony
These functions are used to calculate color palettes based on the given input color.
- Note
- The output maxon::BaseArray contains also the original color.
const Vector complementaryColor = results[1];
if (newMaterial == nullptr)
doc->InsertMaterial(newMaterial);
Definition: c4d_basematerial.h:28
static BaseMaterial * Alloc(Int32 type)
Bool SetParameter(const DescID &id, const GeData &t_data, DESCFLAGS_SET flags)
Definition: basearray.h:415
MAXON_ATTRIBUTE_FORCE_INLINE Int GetCount() const
Definition: basearray.h:576
#define Mmaterial
Standard material.
Definition: ge_prepass.h:1004
Bool ColorHarmonyGetComplementary(const Vector &color, Bool ryb, maxon::BaseArray< Vector > &palette)
const char * doc
Definition: pyerrors.h:226
Further Reading