Grodriguez
Grodriguez

Reputation: 22005

How do you modify hue and saturation of a colour encoded as RGBW?

I am writing firmware to control a LED driver which has separate R,G,B, and W (white) channels. The firmware stores the current color in separate R,G,B,W variables.

I must support external requests to adjust hue and saturation (from the HSB model) but preserve current brightness. Is there a known algorithm to convert from RGBW to HSB, so that I can adjust hue/sat, and then convert back to RGBW?

This would be straightforward to do if there was no white channel, but the presence of the white channel complicates things, since it affects both saturation and brightness:

I have read this question but none of the answers cover the initial RGBW -> HSB conversion.

Upvotes: 0

Views: 54

Answers (0)

Related Questions