Socket
Book a DemoInstallSign in
Socket

colors-palette

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colors-palette

Generate color palette with nodejs and ImageMagick.

0.0.4
latest
npmnpm
Version published
Weekly downloads
10
Maintainers
1
Weekly downloads
 
Created
Source

A ImageMagick Script Can Generate Color Palettes JSON Format.

Install

First download and install ImageMagick. In Mac OS X, you can simply use Homebrew and do:

brew install imagemagick

then either use npm:

npm install colors-palette

or clone the repo:

git clone git://github.com/cyrilis/colors-palette.git

Usage :

    var colorPalette = require("colors-palette");

    colorPalette("/path/to/img", 8, function(err, colors){

        if(err){
            console.error(err);
            return false;
        }

        console.log(colors);

    });

Result JSON:

{
    "result": [
        {
            "counts": 272530,
            "rgb": "228,234,237",
            "hex": "E4EAED",
            "percentage": 0.2957,
            "percent": "29.57%"
        },
        {
            "counts": 148684,
            "rgb": "172,142,114",
            "hex": "AC8E72",
            "percentage": 0.1613,
            "percent": "16.13%"
        },
        {
            "counts": 133115,
            "rgb": "191,181,170",
            "hex": "BFB5AA",
            "percentage": 0.1444,
            "percent": "14.44%"
        },
        {
            "counts": 103595,
            "rgb": "95,11,9",
            "hex": "5F0B09",
            "percentage": 0.1124,
            "percent": "11.24%"
        },
        {
            "counts": 100268,
            "rgb": "201,177,152",
            "hex": "C9B198",
            "percentage": 0.1088,
            "percent": "10.88%"
        },
        {
            "counts": 84419,
            "rgb": "163,59,55",
            "hex": "A33B37",
            "percentage": 0.0916,
            "percent": "9.16%"
        },
        {
            "counts": 66604,
            "rgb": "57,20,15",
            "hex": "39140F",
            "percentage": 0.0723,
            "percent": "7.23%"
        },
        {
            "counts": 12385,
            "rgb": "189,113,141",
            "hex": "BD718D",
            "percentage": 0.0134,
            "percent": "1.34%"
        }
    ]
}

Test Image

Test Image

Example

Demo Image

Keywords

color

FAQs

Package last updated on 31 Jan 2015

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.