I've thought about the following for a while already, so now I want to know your opinions, possible solutions, and so on.
I am looking for a plugin or technique that changes a text's color or switches between predefined images/icons depending on the average brightness of the covered pixels of it's parent's background-image or -color.
If the covered area of it's background is rather dark, make the text white or switch the icons.
Additionally, it'd be great if the script would notice if the parent has no defined background-color or -image and then continue to search for the most nearest (from parent element to it's parent element..).
What do you think, know about this idea? Is there something similar out there already? script-examples?
Cheers, J.
Here's my attempt:
Then to use it:
This will straight away, make the text either black or white as appropriate. To do the icons:
Then each icon could look like
'save' + iconSuffix + '.jpg'
.Note that this won't work where any container overflows its parent (for example, if the CSS height is 0, and overflow isn't hidden). To get that working would be a lot more complex.