@atlaskit/tokens
Version:
Design tokens are the single source of truth to name and store design decisions.
16 lines (15 loc) • 412 B
JavaScript
import { labInvf } from './lab-invf';
/**
* Converts an L* value to a Y value.
*
* L* in L*a*b* and Y in XYZ measure the same quantity, luminance.
*
* L* measures perceptual luminance, a linear scale. Y in XYZ
* measures relative luminance, a logarithmic scale.
*
* @param lstar L* in L*a*b*
* @return Y in XYZ
*/
export function yFromLstar(lstar) {
return 100.0 * labInvf((lstar + 16.0) / 116.0);
}