Adaptive Backgrounds – A JavaScript plugin for extracting the dominant color from images and applying the color to their parent.

2014-10-22 • Plugins • Views: 1551

A JavaScript plugin for extracting the dominant color from images and applying the color to their parent.

  • Simply set a data attribute on desired images and the plugin will apply the image’s dominant color to it’s parent element’s background.
  • Caveat: Doesn’t work with remote images if the respective server has CORS disabled, ie. it won’t work with Flickr URLs…
  • Credit: Heavily inspired by jquery.adaptive-backgrounds.js – basically, it’s the jQuery free version.
  • Browser support: IE9+

 

Website Demo

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Shares