Skip to content

[Bug] Color conversion in espXYToRgbColor() too dark – XYZ values scaled down by /100 #11619

@micromasterminds

Description

@micromasterminds

The current implementation of espXYToRgbColor() divides the already-normalized XYZ values by 100.0f before the XYZ→sRGB matrix multiplication.
This scales X, Y, Z down by a factor 100 and therefore makes all RGB output ≈100× too dark.

// current code (snippet)
X = X / 100.0f;   // <-- should be removed
Y = Y / 100.0f;   // <-- should be removed
Z = Z / 100.0f;   // <-- should be removed
r = (X * 3.2406f) - (Y * 1.5372f) - (Z * 0.4986f);
...

https://github.com/espressif/arduino-esp32/blob/6015fd73e0d9d065c80fc79ef0f35d3273a217de/libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.cpp#L86C24-L86C39

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions