I have a color specified in the CIE Lab* color space which is outside the range that standard sRGB monitors can display. I'd like to display an approximation of the given color (at the same luminance/L value as specified), but the maths is pretty gnarly and involves finding intersections between piecewise functions and so on.
Is there any reference code for this, or should I forge ahead with the maths?
To clarify: given a point a,b
that is NOT within the shape below, I would like to find the nearest a,b
that IS within the shape.