Text with foreground color #ff00ff and background #ff7700 is hard to read. Here is an example:
I would like a function that can detect hard to read color combinations like this. The input can be hex strings, or rgb triplet like (1, 0, 1) and (1, 0.5, 0). The result would either be a number that quantifies how readable the text is, or a boolean.
I tried some color distance algorithms, but the results were not great. I could find other color combinations with a smaller distance which were more readable.
My project is written in Python, but the answer can be any language or pseudo code, I will port it to Python.