2

I have not been able to find much info on the RGBW color system, other than that the final W stands for 'white'. I thought you could form white perfectly well with just red, green and blue, so I do not understand the function of white here.

Searching StackOverflow, I've found this question about converting between RGB and RGBW. Both answers suggest this 'algorithm' for conversion:

// RGBW from RGB
R, G, B, W = R, G, B, min(R, G, B) // i.e. W=min(R,G,B)

// RGB from RGBW
R, G, B = R, G, B // throw away the W

This doesn't only look useless, it's also not true. My Android phone, running Cyanogenmod, has a light sensor that outputs RGBW (cat /sys/class/sensors/light_sensor/lux) and the white value is definitely not min(r,g,b). I've made a chart with the values:

chart showing RGBW values of light sensor over 48 seconds

(The X axis is time.)

The black line represents the white value (an actually white line would be rather difficult to see), the other colors are accurate (i.e. red line is the measured red value, etc.). From sight, I cannot determine any relation between white and the other colors, so it probably serves a function. I just cannot understand which.

It's this sensor: http://www.capellamicro.com.tw/EN/product_c.php?id=68&mode=16

And here is the source code that controls the sensor: https://github.com/mozilla-b2g/kernel-android-galaxy-s2-ics/blob/master/drivers/sensor/cm36651.c#L605-L630

That is all I've been able to figure out, but nothing contains info on what this white value represents.

Community
  • 1
  • 1
Luc
  • 5,339
  • 2
  • 48
  • 48

1 Answers1

1

That exactly it – you can't form white perfectly using only RGB LEDs. This is because the RGB colorspace is a small, pale fraction of the CIE-1931 XYZ space, and it’s distorted: incrementing an RGB values’ “R” by 1 is not at all qualitatively the same as incrementing its “G” value or “B” value, for example. Just do a side by side comparison and the difference will be very, very clear. You can google “True white RGB led” and you'll learn a lot more; a good introduction is here: http://www.ledsmagazine.com/articles/print/volume-10/issue-6/features/understand-rgb-led-mixing-ratios-to-realize-optimal-color-in-signs-and-displays-magazine.html

fish2000
  • 4,289
  • 2
  • 37
  • 76
jojonl
  • 11
  • 4
  • Alright, but the sensor I'm trying to read is not an LED, it doesn't form any colors, because it's just a sensor. What is the function of the W value that this sensor gives me? – Luc Feb 06 '16 at 18:55