I'm working on a program using C# and WPF and I was curious about getting the text color of some text I have to change dynamically based on what the background image I set is.
The background images are loaded by random (I will have no control over what they are) and I need to maintain readability of the fonts depending on what it is.
As you can see here: http://i.gyazo.com/820c45dde9d767dcd7ab2a92bd1de898.png
With this background image set, there's no way to read what the text has to say. Meanwhile, it would look fine on a lighter background.
Basically what I think needs to happen is
- Get the most used color in that image
- Find out if it's a "light or dark color"
- Change the text accordingly How could I do this? Whether it's programmatically or in the WPF XAML (i'm still new to using WPF so bear with me there).
Thanks in advanced,
Mike