fitPaperWash function
rim with its alpha lowered in steps of 2 until every label keeps
GuardrailLimits.labelRatio under it (0 at worst).
Implementation
int fitPaperWash(Palette p, int rim, GuardrailLimits lim) {
var a = (rim >>> 24) & 0xFF;
if (a > paperWashRimMaxAlpha) a = paperWashRimMaxAlpha;
while (a > 0 &&
paperWashLabelContrast(p, withAlpha(rim, a)) < lim.labelRatio) {
a = a - 2 < 0 ? 0 : a - 2;
}
return withAlpha(rim, a);
}