View All Posts

Auto Detect Lightness/Darkness of a Background Image!

This Script allows you to automatically switch to a darker or a lighter version of an element depending on the brightness of images behind it. Great for Sliders! 2016-09-02 11-31-48

How Simple It Is:


 <script src="scripts/css-backgrounds.js"></script>


.label.background--light {
  color: black;

.label.background--dark {
  color: white;


  targets: '.ui',
  images: '.thumbnail'
}); (Demos) (Code)


Posted: September 2nd, 2016
Category: Development
Tags: ,