culori
A general-purpose color library for JavaScript
rework-color-distinguish
rework-color-distinguish is a plugin for Rework, It is easy to seprate foreground from background.
d3-color-difference
See this [Observable notebook](https://beta.observablehq.com/@danburzo/color-difference-formulas-with-d3-color-difference) for a demonstration.