Closed parterburn closed 10 years ago
Interesting. Let's assume we have the following HTML and CSS:
<div class="wrapper">
<img src=".."/>
</div>
.wrapper {
width: 200px;
height: 200px;
}
.wrapper.background--light {
background: .. ;
}
img {
width: 100%;
}
The following should add a class to .wrapper
:
BackgroundCheck.init({
targets: '.wrapper',
images: 'img',
minOverlap: 0
});
BackgroundCheck will add .background--light
to .wrapper
when a lighter image is uploaded as it's assuming that the target is currently on top of a light image.
Let me know if it works!
Would it be possible to use this as a way to change the background depending on what the image sitting on top of it is?
The use case here is that we have an app at https://brandfolder.com/brandfolder and it would be nice if this could detect if the logo uploaded was lighter to show a dark background.