# How can I use 5 LEDs for additive colour mixing using the CIE 1931 Chromaticity diagram?

I am using Amber, Green, Blue, White (2500K - Colour Temperature) and White (6500K - Colour Temperature) LEDs, and altering their brightness to get to a specific colour and brightness (luminous flux) on the CIE 1931 Chromaticity diagram.

I am specifing xamber, yamber, xgreen, ygreen, xblue, yblue, xwhite2500K, ywhite2500K, xwhite6500K, ywhite6500K. These are the respective coordinates of each LED on the CIE 1931 diagram. I am also specifying xmix and ymix, which is the coordinate of the colour I want to get to, and Ymix, which is the brightness of the colour I want to get to.

The solution I want to get is the Yamber, Ygreen, Yblue, Ywhite2500K and Ywhite6500K brightness values for each LED to get to xmix, ymix and Ymix.

I can do this right now, but the problem is is that my method only gives me one possible combination of the brightnesses of the LEDs. Sometimes this combination is impossible to achieve (ie Yblue is too high - my blue LED simply can't shine as bright as the solution requires).

I was wondering if there is a way to get lots of different combinations of brightness for the 5 LEDs to get to my desired colour and brightness, so I can choose which ones are optimal and within range of possible values.

I can go into more detail if you would like, such as the formulas and method I use to get my singular solution if it helps.

This is my first question here so if there is something I have done wrong or something you could suggest that I do to make the question more answerable please let me know.

Thank you very much.

EDIT: The calculation I have used to get a combination of Yamber, Ygreen, Yblue, Ywhite2500K and Ywhite6500K is as follows:

Firstly we set up a 3x5 matrix A:

Then we take the pseudo inverse of this matrix and call the result B. I did this in MATLAB like so:

B = pinv(A);

Then we multiply B by another matrix, and we have our result in the form of a 5x1 Matrix:

Attaching images seemed easier because of the formatting. Hope this helps.

• At the moment I can't write the lengthy answer this question deserves. Some hints: you can only reach colours which are within your LED set's gamut. Of course there is more than one solution for one tristimulus value. Can you disclose your calculation used so far, so it is easier to help you advance. Jul 29, 2016 at 12:56
• Thank you the response. Yes I understand that the colours I can reach have to be within the LED set's gamut. I have attached the calculation I am using so far. Hope this helps. It should show you why I am only getting one possible combination of the luminous flux values to get to xmix, ymix at Ymix Aug 1, 2016 at 9:49
• To avoid requiring a "blue too bright," I recommend "normalizing" the luminosity of the LEDs to produce the brightest white light possible. Once you get the "appropriate percentages", then you can use your matrix calculations. For example, if you determine that you need 52% green, then (.52g) will be your "normalized" green. Aug 10, 2016 at 5:30
• Just noticed this Q. One thing that is completely missing in your question, just with a cursory examination so perhaps I missed it, is your selected white point. Once you map your coordinates onto the 2D CIE 1931 plane, you still need a white point via which you can draw a line to reach the curve at a specific hue value. Just the point itself doesn't do it by itself.
– jonk
Nov 3, 2016 at 20:14
• LambdaD (nm) vs (cd/m2) vs If for all LEDS Input: Reference white xyY 0.3127 0.3290 100 THen spectral plot of all potential LEDs then apply Planck's Law then Normalize PLanks out vs Current in then compute X Y Z x y u v u' v' then compute error distance from target if withing tolerance Nov 8, 2016 at 5:03