UNPKG

counter-color

Version:

Helps to determine what color of text goes best for a given background, light or dark (and vice versa).

6 lines 207 B
import { sRGB, toRGB } from "./rgb"; export function colorLuminance(color) { const [r, g, b] = sRGB(toRGB(color)); return 0.2126 * r + 0.7152 * g + 0.0722 * b; } //# sourceMappingURL=luminance.js.map