grayscale
Remove all chroma (c = 0), keeping OKLCH lightness, hue and alpha, so the gray has the same perceived lightness as the input.
import { grayscale } from '@pbroom/color-kit';index.ts:297function grayscale(color: Color): Color;Parameters
Returns
ColorA new Color
Example
import { grayscale, parse, toHex } from '@pbroom/color-kit';
toHex(grayscale(parse('oklch(0.7 0.15 30)'))); // → '#9e9e9e'