title: Detect unreadable color combinations
body: <p>Text with foreground color #ff00ff and background #ff7700 is hard to read. Here is an example:</p>
  
  <p><img src="https://edwardbetts.com/hard_to_read.png" alt="example of text that is hard to read"></p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>My project is written in Python, but the answer can be any language or pseudo code, I will port it to Python.</p>