Interactive color checker for LAB conversions.
Read more : https://drafts.csswg.org/css-color-4/#binsearch
This code is not written for performance and will run very slowly on older/under powered machines.
Colors out of gamut for sRGB (with outline) will have been adjusted through chroma reduction in OKLCH.
It seems as if Safari displays LAB with what is available in Display-P3.
Colors out of gamut (with outline) for Display-P3 might be clipped or modified in other ways.
Code used to convert LAB to sRGB with coloraide :
# python3 -m pip install coloraide
from coloraide import Color
l = 50;
a = 0;
b = 0;
color = Color('lab({}% {} {})'.format(l, a, b));
color.convert('oklch').fit('srgb', method='lch-chroma').convert('srgb').fit('srgb', method='clip').coords();