🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

Primarycolor.js is a super light jQuery plugin used to extract the dominant color (RGB) of an image by using Html5 canvas.

image-color

Documentation

jquery.primarycolor.js

Get the primary color of the image

Demo

http://rythgs.co/demo/primarycolor/

How to use

$(function() {   $('img').primaryColor(function(color, colors) {     $(this).parents('.wrapper').css('background-color', 'rgb('+color+')');   }); });

Callback function

arguments type desc
color string Primary color
colors array Top 5 colors

License

MIT


You May Also Like