/contrast-text

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.

Primary LanguageHTML

contrast-text

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.

Getting started

You'll need to run the index.html using a local server such as http-server to avoid security-related canvas errors.

Works with

  • Chrome
  • Firefox
  • Edge Legacy
  • IE11