What I want to see is someone go through and assign sRGB colors for each of the main LED types. It's surprisingly difficult. I've failed every time I've tried, in that what I come up with doing it by starting from the spectra (or a simple gaussian approximation) looks on screen nothing like the real LEDs. The greens (515-525nm) are particularly difficult.
I recognize that sRGB will never be able to do a perfect job, but it seems like it has to be possible to do decently well.
(What do I need this for? I design electronics. I use LEDs as indicators. I like to show the true color of the LED in my schematics and documentation, as best I can. And I try to never use the same color twice, in small and bespoke things, so there's less risk of indicator confusion, which means I've often got a lot of funny colors around.)
In abstract case, you'd probably want to use xy color coordinates from xyY color space to specify LED color. Or even wavelength + spread, as you've tried. Those were the models that were used in one microLED-related research project I was part of.
Using those in images however would be another can of worms, you'll need some kind of physics-based rendering with good HDR tone mapping, as the human perception of light-emitting object against reflective background is highly non-linear.
For your use case it would probably be better to develop a standardized testing setup and just take RGB or XYZ coordinates from an image taken with a calibrated camera. Something like this:
* "standard gray" material surface
* a hole for LED with some kind of light pipe of standard shape
* uniform diffuse lighting of intensity computed to be proportional to your LED power measured in a standard way.
In this way it should be possible to create a catalog of LEDs useful for designing products.
Part of the motivation for doing this was to be able to visualize things without having actual parts in hand, to save on prototyping effort. I agree that just measuring the thing is probably the solution, though I'm perennially disappointed that following the Official Rules for just calculating the result is so terrible.
That's not the point. The point is that I have to put representations of LEDs in places that are sRGB only (documentation!), so I want the best I can do in sRGB.
I mean, I'm not immediately jumping to sRGB or anything. (Well, I think I tried that at one point, not like it worked....) I just need to end there. I've tried plenty of things over the years and I simply cannot make an algorithm that takes some kind of spectral input and outputs a hex color code that I can make a blob of on my (color-calibrated!) monitor which looks anything like the LED I have in hand.
Coming up with a matching color by hand can give a decent result, so this is not solely sRGB being crap.
Very cool to see this on the front page - Don's "The Most Efficient LEDs!" site at https://donklipstein.com/led.html is a great resource, since it is very hard to come by reliable information on early commercial devices!
We used some of this data to trace progress in LED development for our recent Nature Energy paper on technology spillovers in solid-state lighting: https://doi.org/g9kcjd.
I remember seeing in a Popular Electronics Magazine, in the late 60s or early 70s, stating "There will never be a Blue LED". Despite looking I've not found that issue again.
I recognize that sRGB will never be able to do a perfect job, but it seems like it has to be possible to do decently well.
(What do I need this for? I design electronics. I use LEDs as indicators. I like to show the true color of the LED in my schematics and documentation, as best I can. And I try to never use the same color twice, in small and bespoke things, so there's less risk of indicator confusion, which means I've often got a lot of funny colors around.)