New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

colorchart

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colorchart

Get a color palette of an image in the DOM

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

colorchart

Get most used colors in an image (in the browser). Compatible with browserify.

Demo page

Based on https://github.com/lokesh/color-thief but commonjs compatible and using the quantize module from npm.

npm install colorchart

Use

Get color palette

var colormap = require('colorchart')();

// arg 1 = dom image node to parse
// arg 2 = amount of colors get back
// arg 3 = quality level/accuracy to use in algorithm (default = 10)

var palette = colorchart.get(document.querySelector('img'), 5);

Get dominant color

var colorchart = require('colorchart')();
var palette = colorchart.getDominant(document.querySelector('img'));

Go to /example folder and run npm run example-js & npm start for a working example.

License

MIT licensed

Keywords

FAQs

Package last updated on 23 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc