Consider this partial screenshot of a webpage:
The text color varies based on the background color because I am using mix-blend-mode: difference
on the text.
I would like to achieve a similar effect in my app, except I would like to use the following rule:
- There can be two backgrounds: #ED1B34 (red) and #FFFDF8 (cream)
- When the text is on top of the #FFFDF8 (cream) background its color should be #ED1B34 (red)
- When the text is on top of the #ED1B34 (red) background its color should be #FFFDF8 (cream)
- When the text is on top of anything else its color should be #ED1B34 (red).
Blending mode difference
comes very close to achieving (2) but not (3) as the text appears black and not cream over the red background.