In javascript/jquery, if I have two colors in HSL (or hex or rgb) format, is there an algorithm that can check if the contrast is bad? One color is text, and the other color is the background of the text. I need to follow standard accessibility guidelines and make sure the text is well readable. So I think I need to check if the contrast is good enough between the two values.
Thanks