colorLegible
Darkens a color so that it will appear legible on a white background.
Basic example
Section titled “Basic example”Each pale input is darkened (its lightness capped, saturation clamped) to a deeper shade of the same hue that stays readable as text on a white background.
import {colorLegible} from "@d3plus/color";
colorLegible("#aaddff");
colorLegible("#ffeb3b");
colorLegible("#c8e6c9");
colorLegible("#ff8a80");
colorLegible("#e0e0e0");
Parameters
import {colorLegible} from "@d3plus/color";
crequiredstringA valid CSS color string.