Hi all hope you are well!
simply put: text change to black or white depending on the background image uploaded.
using - BackgroundCheck
and trying here - Webflow
My knowledge of js isnt great although i did get this working however it only scans colours not images - GitHub - jamiebrittain/colourBrightness.js: A lightweight and easy-to-use jQuery plugin that determines if the background colour of an element is light or dark.
DETAILS:
Using this - BackgroundCheck
Found here at GitHub - kennethcachia/background-check: Automatically switch to a darker or a lighter version of an element depending on the brightness of images behind it.
JS here - https://github.com/kennethcachia/background-check/blob/master/background-check.js and https://github.com/kennethcachia/background-check/blob/master/background-check.min.js
https://cdn.jsdelivr.net/gh/kennethcachia/background-check@master/background-check.js
https://cdn.jsdelivr.net/gh/kennethcachia/background-check@master/background-check.min.js
Js -
Css -
It does state -
"If an element overlaps any of the images, either .background--dark
or .background--light
is added to it. BackgroundCheck does not change an element’s style — you must do so using CSS.
For example, if <p>
has the following default style:
p { color: white; }
you can then add the following:
p.background–light { color: black; }
THANKYOU
Here is my site Read-Only: https://preview.webflow.com/preview/background-check-test?utm_medium=preview_link&utm_source=designer&utm_content=background-check-test&preview=8e12d25d6051c4616d7a087066e7e2a6&mode=preview