c4d.modules.colorchooser
¶
New in version R18.011.
ColorRGBToString()
ColorHSVToString()
ColorComponentFloatTo8Bit()
ColorComponent8BitToFloat()
ColorFloatTo8Bit()
Color8BitToFloat()
ColorComponentFloatTo16Bit()
ColorComponent16BitToFloat()
ColorFloatTo16Bit()
Color16BitToFloat()
ColorKelvinTemperatureToRGB()
ColorHarmonyGetComplementary()
ColorHarmonyGetSplitComplementary()
ColorHarmonyGetTetradic()
ColorHarmonyGetAnalogous()
ColorHarmonyGetEquiangular()
ColorHarmonyRotateColor()
ColorHarmonyInterpolateColors()
c4d.modules.colorchooser.
ColorRGBToString
(
color
)
¶
Parameters: |
color
(
c4d.Vector
) – The RGB color to convert to string. Its components must be in range [0.0, 1.0].
|
---|---|
Return type: | str |
Returns: | The string representation of the color. |
c4d.modules.colorchooser.
ColorHSVToString
(
color
)
¶
Parameters: |
color
(
c4d.Vector
) – The HSV color to convert to string. Its components must be in range [0.0, 1.0]. See
RGBToHSV()
/
HSVToRGB()
.
|
---|---|
Return type: | str |
Returns: | The string representation of the color. |
c4d.modules.colorchooser.
ColorComponentFloatTo8Bit
(
colorComponentInput
)
¶
Converts a RGB float color component in range [0.0, 1.0] to 8-bit (range [0, 255]).
Parameters: | colorComponentInput ( float ) – The color component to be converted. Must be in range [0.0, 1.0]. |
---|---|
Return type: | int |
Returns: | The converted 8-bit color component in range [0, 255]. |
c4d.modules.colorchooser.
ColorComponent8BitToFloat
(
colorComponentInput
)
¶
Converts a RGB 8-bit color component (range [0, 255]) to float in range [0.0, 1.0].
Parameters: | colorComponentInput ( int ) – The 8-bit color component to be converted. Must be in range [0, 255]. |
---|---|
Return type: | float |
Returns: | The converted color component in range [0.0, 1.0]. |
c4d.modules.colorchooser.
ColorFloatTo8Bit
(
floatColor
)
¶
Converts a RGB float color in range [0.0, 1.0] to 8-bit color (range [0, 255]).
Parameters: |
floatColor
(
c4d.Vector
) – The color to be converted. Must be in range [0.0, 1.0].
|
---|---|
Return type: | list(int, int, int) |
Returns: | The converted 8-bit red, green and blue color components. |
c4d.modules.colorchooser.
Color8BitToFloat
(
red
,
green
,
blue
)
¶
Converts a RGB 8-bit color (range [0, 255]) to float color in range [0.0, 1.0].
Parameters: |
|
---|---|
Return type: | |
Returns: |
The converted float color in range [0.0, 1.0]. |
c4d.modules.colorchooser.
ColorComponentFloatTo16Bit
(
colorComponentInput
)
¶
Converts a RGB float color component in range [0.0, 1.0] to 16-bit (range [0, 65535]).
Parameters: | colorComponentInput ( float ) – The color component to be converted. Must be in range [0.0, 1.0]. |
---|---|
Return type: | int |
Returns: | The converted 16-bit color component in range [0, 65535]. |
c4d.modules.colorchooser.
ColorComponent16BitToFloat
(
colorComponentInput
)
¶
Converts a RGB 16-bit color component (range [0, 65535]) to float in range [0.0, 1.0].
Parameters: | colorComponentInput ( int ) – The 16-bit color component to be converted. Must be in range [0, 65535]. |
---|---|
Return type: | float |
Returns: | The converted color component in range [0.0, 1.0]. |
c4d.modules.colorchooser.
ColorFloatTo16Bit
(
floatColor
)
¶
Converts a RGB float color in range [0.0, 1.0] to 16-bit color (range [0, 65535]).
Parameters: |
floatColor
(
c4d.Vector
) – The color to be converted. Must be in range [0.0, 1.0].
|
---|---|
Return type: | list(int, int, int) |
Returns: | The converted 16-bit red, green and blue color components. |
c4d.modules.colorchooser.
Color16BitToFloat
(
)
¶
Converts a RGB 16-bit color (range [0, 65535]) to float color in range [0.0, 1.0].
Parameters: |
|
---|---|
Return type: | |
Returns: |
The converted float color in range [0.0, 1.0]. |
c4d.modules.colorchooser.
ColorKelvinTemperatureToRGB
(
kelvinDegree
[
,
tint=0.0
]
)
¶
Converts color Kelvin temperature to RGB value.
Parameters: |
|
---|---|
Return type: | |
Returns: |
The converted RGB color value. |
c4d.modules.colorchooser.
ColorHarmonyGetComplementary
(
color
,
ryb
)
¶
Generates a complementary color harmony palette from color . Contains the input color and its opposite color in a color wheel.
Parameters: |
|
---|---|
Return type: |
list of
|
Returns: |
The complementary color harmony palette. |
c4d.modules.colorchooser.
ColorHarmonyGetSplitComplementary
(
color
,
ryb
)
¶
Parameters: |
|
---|---|
Return type: |
list of
|
Returns: |
The split complementary color harmony palette. |
c4d.modules.colorchooser.
ColorHarmonyGetTetradic
(
color
,
ryb
)
¶
Generates a tetradric color harmony palette. The rectangle or Tetradic color scheme uses four colors arranged into 2 complementary pairs.
Parameters: |
|
---|---|
Return type: |
list of
|
Returns: |
The tetradric color harmony palette. |
c4d.modules.colorchooser.
ColorHarmonyGetAnalogous
(
color
,
colorCount
,
ryb
)
¶
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.
Parameters: |
|
---|---|
Return type: |
list of
|
Returns: |
The analogous color harmony palette. |
c4d.modules.colorchooser.
ColorHarmonyGetEquiangular
(
color
,
colorCount
,
ryb
)
¶
Generates an Equiangular Color Harmony palette. All colors are evenly arranged around the color wheel.
Parameters: |
|
---|---|
Return type: |
list of
|
Returns: |
The equiangular color harmony palette. |
c4d.modules.colorchooser.
ColorHarmonyRotateColor
(
color
,
colorCount
,
angle
,
ryb
)
¶
Generates a palette composed by a defined amount of colors whose hue is separated by a defined angle in HSV color space.
Parameters: |
|
---|---|
Return type: |
list of
|
Returns: |
The palette. |
c4d.modules.colorchooser.
ColorHarmonyInterpolateColors
(
color1
,
color2
,
colorCount
,
ryb
)
¶
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.
Parameters: |
|
---|---|
Return type: |
list of
|
Returns: |
The palette. |
c4d.modules.colorchooser.
ColorSwatchPresetExists
(
name
[
,
urls=None
]
)
¶
Checks if any preset with the given name exists in user’s color swatch preset directory, including subdirectories.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if any preset with the given name was found, otherwise False . |
c4d.modules.colorchooser.
ValidColorSwatchPreset
(
url
)
¶
Checks if the given URL points to a valid color swatch preset.
Parameters: | url ( str ) – The url to check. |
---|---|
Return type: | bool |
Returns: | True if the URL points to a valid color swatch preset, otherwise False . |
c4d.modules.colorchooser.
GetColorSwatchPresetDirectory
(
)
¶
Gets the user’s default color swatch preset directory.
Return type: | str |
---|---|
Returns: | The preset directory. |