(failures: ContrastEntry[])
| 305 | } |
| 306 | |
| 307 | function printContrastFailures(failures: ContrastEntry[]) { |
| 308 | console.log(); |
| 309 | console.log(` ${c.warn("⚠")} WCAG AA contrast warnings (${failures.length}):`); |
| 310 | for (const cf of failures) { |
| 311 | const threshold = cf.large ? "3" : "4.5"; |
| 312 | console.log( |
| 313 | ` ${c.warn("·")} ${cf.selector} ${c.dim(`"${cf.text}"`)} — ${c.warn(cf.ratio + ":1")} ${c.dim(`(need ${threshold}:1, t=${cf.time}s)`)}`, |
| 314 | ); |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | function emitJsonReport( |
| 319 | errors: ConsoleEntry[], |