enableLightForeground static method

double enableLightForeground(
  1. double tone
)

Adjust a tone such that white has 4.5 contrast, if the tone is reasonably close to supporting it.

Implementation

static double enableLightForeground(double tone) {
  if (tonePrefersLightForeground(tone) && !toneAllowsLightForeground(tone)) {
    return 49.0;
  }
  return tone;
}