static double darkerMaxL(double r, double lighterL) { var lighterY = Hsluv.lToY(lighterL); var maxY = (20 * lighterY - r + 1) / (20 * r); return Hsluv.yToL(maxY); }