solveForContrast function
solveLightness that throws when the target is unreachable.
Implementation
int solveForContrast(
double l0,
double c,
double hDeg,
int bgArgb,
double target,
) =>
solveLightness(
l0: l0,
c: c,
hDeg: hDeg,
againstArgb: bgArgb,
target: target,
) ??
(throw StateError(
'contrast $target unreachable against '
'0x${bgArgb.toRadixString(16)}',
));