Hi SDK Team,
we're currently developing a plugin that uses GeUserArea to display color swatches that users can sample with the ColorField's eyedropper. We've encountered some color space behaviors we'd like clarification on.
Issue 1: GetColorField returns LINEAR, DrawSetPen expects sRGB
When using a ColorField with a GeUserArea:
# Get color from ColorField - returns LINEAR
field_data = self.GetColorField(self.ID_COLOR_FIELD)
linear_color = field_data['color']
# Draw in GeUserArea - expects sRGB
self.DrawSetPen(linear_color) # WRONG - appears too dark!
# Correct approach:
srgb_color = c4d.utils.TransformColor(linear_color, c4d.COLORSPACETRANSFORMATION_LINEAR_TO_SRGB)
self.DrawSetPen(srgb_color) # Correct!
Question 1:
Is this the intended behavior? Should we always convert LINEAR→sRGB when drawing colors from ColorField/ColorDialog in a GeUserArea?
Issue 2: Eyedropper Roundtrip Doesn't Preserve Saturated Colors
We've noticed a more significant issue when using the ColorField's eyedropper to sample colors from our GeUserArea:
Test Case
- Draw a pure red square in GeUserArea using
DrawSetPen(Vector(1.0, 0, 0)) (sRGB)
- Use ColorField's eyedropper to sample that red pixel
GetColorField() returns a LINEAR value
- Convert back with
linear_to_srgb() and draw the result
Expected Result
The sampled color should match the original: sRGB (1.0, 0, 0)
Actual Result
- Purple (less saturated): Works correctly - roundtrip preserves the color
- Pure Red/Green/Blue (saturated): Fails - the result appears darker/desaturated
The LINEAR value returned seems incorrect for highly saturated colors, causing the sRGB conversion to not match the original. That's why the user need to be advised to sample colors in "Raw" mode?! But then again, it's not working in all cases.
Reproducible Demo
We've attached a demo script (color_space_demo.py) that demonstrates this. It shows:
- Test color squares (RED, GREEN, BLUE, PURPLE) drawn with known sRGB values
- A ColorField to sample those colors
- The result after LINEAR→sRGB conversion
- The actual LINEAR and sRGB values for comparison
Question 2:
Is there a known issue with the ColorDialog eyedropper and color space conversion for saturated colors? Or are we missing something in our approach? Clearly I'm a little lost at this point. 
Environment
- Cinema 4D 2025+
- macOS and Windows
Attached Files
color_space_demo.py - Runnable demo in Script Manager showing both issues
Thanks for any clarification!
→ Video: color_space_demo.py
→ color_space_demo.py