JSPM

  • Created
  • Published
  • Downloads 1086
  • Score
    100M100P100Q88372F
  • License MIT

Given an image, extract predominant & palette colors

Package Exports

  • splashy

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (splashy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

splashy

Last version Build Status Coverage Status Dependency status Dev Dependencies Status NPM Status Donate

Given an image, extract predominant & palette colors.

Install

$ npm install splashy --save

Usage

const splashy = require('splashy')

splashy
  .fromUrl('https://i.imgur.com/ZJDyOhn.jpg')
  .then(predominantColors => console.log(predominantColors))
  // => {
  //  dominantColor: '#951E1A',
  //  paletteColors: [ '#921D1C', '#CBB9AC', '#E04844' ]
  // }

API

splashy(filepath, [options])

filepath

Required
Type: String

The file path of the image to extract the color information.

options

paletteColors

Type: Number
Default: 3

Number of colors for create the palette based on the image.

splashy.fromUrl(url, [options])

url

Required
Type: String

The url of the image to extract the color information.

options

paletteColors

Type: Number
Default: 3

Number of colors for create the palette based on the image.

tempFileOpts

create-tempfile-file2 configuration related with temporal file location.

License

MIT © Kiko Beats.