A small proof of concept script to determine the brightness of an image behind a text element, then use classes to set the text colour for appropriate contrast.
You'll need to run the index.html
using a local server such as http-server
to avoid security-related canvas errors.
- Chrome
- Firefox
- Edge Legacy
- IE11