Calculate RGB color ratio for a color space given a white point?
Here is the chart from https://en.wikipedia.org/wiki/CIE_1931_color_space#/media/File:CIE1931xy_blank.svg
This is what the formulas do.
Imagine you have an RGB LED that contains LEDs of the three colors in the three black circles.
You want to produce white light with those three LEDs.
Turn on only the red LED to around 1/2 brightness.
Turn on the blue LED and adjust the brightness of the blue LED until you see the purple color in the gray circle.
Turn on the green LED and adjust the brightness of the green LED until you see the desired white light.