Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

RGBaster

A dead simple javascript library for extracting the dominant color from an image.

Usage

Usage is simple. Create an image, then get its dominant color & palette.

var img = document.getElementById('image');
var colors = RGBaster.colors(img, function(payload){
  // You now have the payload.
  console.log(payload.dominant);
  console.log(payload.palette);
});

The colors function takes an optionanl third parameter, which is the size of the palette to return. By default, it returns a palette size of 10.

var colors = RGBaster.colors(img, success, 30) // Returns 30 colors.

Author

twitter/brianmgonzalez
Brian Gonzalez

About

A simple library for extracting dominant colors from images.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages