CKTIS / CSS
lab(): color in CIE Lab coordinates
Describe a color through perceptual lightness and two opponent-color axes.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
color: lab(50% 30 0 / 0.5);lab() expresses a CSS color in the CIE Lab model. Its first coordinate is lightness: 0% is black and 100% is reference white. The a axis runs from green toward red, and the b axis from blue toward yellow. The space uses a D50 white point. Neutral colors have a and b equal to zero; this does not mean that the lightness number can be copied directly into an RGB byte.
The modern notation separates coordinates with spaces and introduces optional alpha with a slash. Comma-separated lab(50%, 0, 0) is not this syntax. Alpha controls compositing, separately from lightness. Colors outside the output device's gamut need conversion or gamut handling, so coordinates alone do not guarantee an identical appearance on every display.
The example paints neutral lab(50% 0 0), which becomes about RGB 119,119,119 in its sRGB raster. Increasing a shifts the sampled color toward red. Half alpha over white gives a lighter composited pixel. These samples demonstrate the coordinate roles and compositing; they are not a colorimeter measurement of the user's physical monitor.
Examples
const sample=async style=>{const svg='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8"><rect width="8" height="8" fill="white"/><foreignObject width="8" height="8"><div xmlns="http://www.w3.org/1999/xhtml" style="width:8px;height:8px;'+style.replaceAll('&','&').replaceAll('"','"')+'"></div></foreignObject></svg>';const image=new Image();image.src='data:image/svg+xml;charset=utf-8,'+encodeURIComponent(svg);await image.decode();const canvas=document.createElement('canvas');canvas.width=canvas.height=8;const context=canvas.getContext('2d');context.drawImage(image,0,0);return [...context.getImageData(4,4,1,1).data].slice(0,3).join(',')};
const neutral=await sample('background:lab(50% 0 0)');
const opponent=await sample('background:lab(50% 40 0)');
const alpha=await sample('background:lab(50% 0 0 / 50%)');
const commas=CSS.supports('color','lab(50%, 0, 0)');
console.log('neutral='+neutral+'; positive-a='+opponent+'; alpha-over-white='+alpha+'; commas='+commas);Result
neutral=119,119,119; positive-a=179,89,121; alpha-over-white=186,186,186; commas=false
The neutral sample is 119 per RGB channel, not 50 or 128. The comma-syntax support check is false.