imgcolr is a jQuery plugin for grabbing the dominant color of a given image's borders. You can programmably adapt the elements' color on the webpage for the image after getting the color.
Website Demo
Subscribe to email newsletter for latest jQuery plugins & tutorials.