-
首页
-
C4D R23.110 C++ SDK
详细描述
函数
|
enum
SWATCH_CATEGORY
|
MAXON_ENUM_LIST
(
SWATCH_CATEGORY
)
|
String
|
ColorRGBToString
(const
向量
&color)
|
String
|
ColorHSVToString
(const
向量
&color)
|
Int
|
ColorComponentFloatTo8Bit
(
Float
colorComponent)
|
Float
|
ColorComponent8BitToFloat
(
Int
colorComponent)
|
void
|
ColorFloatTo8Bit
(const
向量
&floatColor,
Int
&red,
Int
&green,
Int
&blue)
|
向量
|
Color8BitToFloat
(
Int
red,
Int
green,
Int
blue)
|
Int
|
ColorComponentFloatTo16Bit
(
Float
colorComponent)
|
Float
|
ColorComponent16BitToFloat
(
Int
colorComponent)
|
void
|
ColorFloatTo16Bit
(const
向量
&floatColor,
Int
&red,
Int
&green,
Int
&blue)
|
向量
|
Color16BitToFloat
(
Int
red,
Int
green,
Int
blue)
|
向量
|
ColorKelvinTemperatureToRGB
(
Float
kelvinDegrees,
Float
tint=0.0)
|
Bool
|
ColorHarmonyGetComplementary
(const
向量
&color,
Bool
ryb,
maxon::BaseArray
<
向量
> &palette)
|
Bool
|
ColorHarmonyGetSplitComplementary
(const
向量
&color,
Bool
ryb,
maxon::BaseArray
<
向量
> &palette)
|
Bool
|
ColorHarmonyGetTetradic
(const
向量
&color,
Bool
ryb,
maxon::BaseArray
<
向量
> &palette)
|
Bool
|
ColorHarmonyGetAnalogous
(const
向量
&color,
Int
colorCount,
Bool
ryb,
maxon::BaseArray
<
向量
> &palette)
|
Bool
|
ColorHarmonyGetEquiangular
(const
向量
&color,
Int
colorCount,
Bool
ryb,
maxon::BaseArray
<
向量
> &palette)
|
Bool
|
ColorHarmonyRotateColor
(const
向量
&color,
Int
colorCount,
Float
angle,
Bool
ryb,
maxon::BaseArray
<
向量
> &palette)
|
Bool
|
ColorHarmonyInterpolateColors
(const
向量
&color1, const
向量
&color2,
Int
colorCount,
Bool
ryb,
maxon::BaseArray
<
向量
> &palette)
|
Macro Definition Documentation
◆
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
Enumerator
|
GLOBAL
|
|
DOCUMENT
|
|
Function Documentation
◆
MAXON_ENUM_LIST()
◆
ColorRGBToString()
String
ColorRGBToString
|
(
|
const
向量
&
|
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
向量
(0.45, 0.32, 1.0) will be
"115, 82, 255"
if
WPREF_COLOR_RGBRANGE
is configured to
COLORSYSTEM_RANGE_255
.
-
由于
-
R18
-
参数
-
[in]
|
color
|
The RGB color to convert to string. Its components must be in range [0.0, 1.0].
|
-
返回
-
The string representation of the color.
◆
ColorHSVToString()
String
ColorHSVToString
|
(
|
const
向量
&
|
color
|
)
|
|
Converts a HSV
color
to string. Example: The string result for the color
向量
(0.45, 0.32, 1.0) will be
"251.471 °, 68 %, 100 %"
-
由于
-
R18
-
参数
-
[in]
|
color
|
The HSV color to convert to string. Its components must be in range [0.0, 1.0].
|
-
另请参阅
-
RGBToHSV()
/
HSVToRGB()
-
返回
-
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]).
-
由于
-
R18
-
参数
-
[in]
|
colorComponent
|
The color component to be converted. Must be in range [0.0, 1.0].
|
-
返回
-
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].
-
由于
-
R18
-
参数
-
[in]
|
colorComponent
|
The 8-bit color component to be converted. Must be in range [0, 255].
|
-
返回
-
The converted color component in range [0.0, 1.0].
◆
ColorFloatTo8Bit()
void ColorFloatTo8Bit
|
(
|
const
向量
&
|
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]).
-
由于
-
R18
-
参数
-
[in]
|
floatColor
|
The color to be converted. Must be in range [0.0, 1.0].
|
[out]
|
red
|
The converted 8-bit red color component.
|
[out]
|
green
|
The converted 8-bit green color component.
|
[out]
|
blue
|
The converted 8-bit blue color component.
|
◆
Color8BitToFloat()
Converts a RGB 8-bit color (range [0, 255]) to float color in range [0.0, 1.0].
-
由于
-
R18
-
参数
-
[in]
|
red
|
The 8-bit color component to be converted. Must be in range [0, 255].
|
[in]
|
green
|
The 8-bit color component to be converted. Must be in range [0, 255].
|
[in]
|
blue
|
The 8-bit color component to be converted. Must be in range [0, 255].
|
-
返回
-
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]).
-
由于
-
R18
-
参数
-
[in]
|
colorComponent
|
The color component to be converted. Must be in range [0.0, 1.0].
|
-
返回
-
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].
-
由于
-
R18
-
参数
-
[in]
|
colorComponent
|
The 16-bit color component to be converted. Must be in range [0, 65535].
|
-
返回
-
The converted color component in range [0.0, 1.0].
◆
ColorFloatTo16Bit()
void ColorFloatTo16Bit
|
(
|
const
向量
&
|
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]).
-
由于
-
R18
-
参数
-
[in]
|
floatColor
|
The color to be converted. Must be in range [0.0, 1.0].
|
[out]
|
red
|
The converted 16-bit red color component.
|
[out]
|
green
|
The converted 16-bit green color component.
|
[out]
|
blue
|
The converted 16-bit blue color component.
|
◆
Color16BitToFloat()
向量
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].
-
由于
-
R18
-
参数
-
[in]
|
red
|
The 8-bit color component to be converted. Must be in range [0, 65535].
|
[in]
|
green
|
The 8-bit color component to be converted. Must be in range [0, 65535].
|
[in]
|
blue
|
The 8-bit color component to be converted. Must be in range [0, 65535].
|
-
返回
-
The converted float color.
◆
ColorKelvinTemperatureToRGB()
向量
ColorKelvinTemperatureToRGB
|
(
|
Float
|
kelvinDegrees
,
|
|
|
Float
|
tint
=
0.0
|
|
)
|
|
|
Converts color Kelvin temperature to RGB value.
-
由于
-
R18
-
参数
-
[in]
|
kelvinDegrees
|
The Kelvin temperature value in Kelvin degrees. Useful range: [1000.0, 10000.0] °K
|
[in]
|
tint
|
Offsets 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].
|
-
返回
-
The converted RGB color value.
◆
ColorHarmonyGetComplementary()
Generates a Complementary Color Harmony palette from
color
. Contains the input color and its opposite color in a Color Wheel.
-
由于
-
R18
-
参数
-
[in]
|
color
|
The color to generate the palette. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
|
[in]
|
ryb
|
Set 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]
|
palette
|
List to add generated colors to. Data is preserved.
|
-
返回
-
true
if successful, otherwise
false
.
◆
ColorHarmonyGetSplitComplementary()
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.
-
由于
-
R18
-
参数
-
[in]
|
color
|
The color to generate the palette. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
|
[in]
|
ryb
|
Set 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]
|
palette
|
List to add generated colors to. Data is preserved.
|
-
返回
-
true
if successful, otherwise
false
.
◆
ColorHarmonyGetTetradic()
Generates a Tetradric Color Harmony palette. The rectangle or tetradic color scheme uses four colors arranged into two complementary pairs.
-
由于
-
R18
-
参数
-
[in]
|
color
|
The color to generate the palette. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
|
[in]
|
ryb
|
Set 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]
|
palette
|
List to add generated colors to. Data is preserved.
|
-
返回
-
true
if successful, otherwise
false
.
◆
ColorHarmonyGetAnalogous()
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.
-
由于
-
R18
-
参数
-
[in]
|
color
|
The color to generate the palette. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
|
[in]
|
colorCount
|
Number of colors to generate. Because of input color is added as well, the resulting palette will have
colorCount
+ 1 colors.
|
[in]
|
ryb
|
Set 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]
|
palette
|
List to add generated colors to. Data is preserved.
|
-
返回
-
true
if successful, otherwise
false
.
◆
ColorHarmonyGetEquiangular()
Generates an Equiangular Color Harmony palette. All colors are evenly arranged around the color wheel.
-
由于
-
R18
-
参数
-
[in]
|
color
|
The color to generate the palette. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
|
[in]
|
colorCount
|
Number of colors to generate. Because of input color is added as well, the resulting palette will have
colorCount
+ 1 colors.
|
[in]
|
ryb
|
Set 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]
|
palette
|
List to add generated colors to. Data is preserved.
|
-
返回
-
true
if successful, otherwise
false
.
◆
ColorHarmonyRotateColor()
Generates a palette composed by a defined amount of colors whose hue is separated by a defined angle in HSV color space.
-
由于
-
R18
-
参数
-
[in]
|
color
|
The color to generate the palette. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
|
[in]
|
colorCount
|
Number of colors to generate. Because of input color is added as well, the resulting palette will have
colorCount
+ 1 colors.
|
[in]
|
angle
|
Rotation angle in radians.
|
-
另请参阅
-
DegToRad()
-
参数
-
[in]
|
ryb
|
Set 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]
|
palette
|
List to add generated colors to. Data is preserved.
|
-
返回
-
true
if successful, otherwise
false
.
◆
ColorHarmonyInterpolateColors()
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.
-
由于
-
R18
-
参数
-
[in]
|
color1
|
The first generator color. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
|
[in]
|
color2
|
The second generator color. This color will be added to the resulting palette as well, and converted to RYB space if enabled.
|
[in]
|
colorCount
|
Number of colors to generate. Because of the two input colors are added as well, the resulting palette will have
colorCount
+ 2 colors.
|
[in]
|
ryb
|
Set 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]
|
palette
|
List to add generated colors to. Data is preserved.
|
-
返回
-
true
if successful, otherwise
false
.
Variable Documentation
◆
MAXON_ENUM_LIST