A JavaScript plugin for extracting the dominant color from images and applying the color to their parent.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 8592ca5 Sep 18, 2018
Permalink
Failed to load latest commit information.
6.jpg init Dec 16, 2013
LICENSE Initial commit Dec 16, 2013
README.md Update README.md Sep 18, 2018
adaptive-backgrounds.js Ensuring we are only creating new instaces Sep 8, 2014
index.html styling Dec 16, 2013
style.css styling Dec 16, 2013

README.md

Adaptive-Backgrounds

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

Full docs & demo→

  • 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+