5.1.36 • Published 1 month ago

splashy v5.1.36

Weekly downloads
138
License
MIT
Repository
github
Last release
1 month ago

Last version Coverage Status NPM Status

Given an image, extract predominant & palette colors. 20+ image formats well tested.

Install

$ npm install splashy --save

Usage

From URL

(async () => {
  const splashy = require('splashy')
  const got = require('got')

  const url = 'https://kikobeats.com/images/avatar.jpg'
  const { body } = await got(url, { responseType: 'buffer' })
  const palette = await splashy(body)

  console.log(palette)
  // => [ '#941c1c', '#841c16', '#aa695e', '#ca866c', '#6c5444', '#cca4a4' ]
})()

From Buffer

(async () => {
  const splashy = require('splashy')
  const path = require('path')
  const fs = require('fs')

  const filepath = path.resolve(__dirname, 'avatar.jpg')
  const buffer = await fs.readFile(filepath)
  const palette = await splashy(buffer)

  console.log(palette)
  // => [ '#941c1c', '#841c16', '#aa695e', '#ca866c', '#6c5444', '#cca4a4' ]
})()

API

splashy(input)

input

Required Type: ImageSource

The raw content for detecting the color information.

Related

License

microlink-function © Microlink, released under the MIT License. Authored and maintained by Kiko Beats with help from contributors.

microlink.io · GitHub microlinkhq · Twitter @microlinkhq

5.1.36

1 month ago

5.1.35

1 month ago

5.1.34

2 months ago

5.1.33

3 months ago

5.1.32

3 months ago

5.1.31

4 months ago

5.1.30

5 months ago

5.1.29

6 months ago

5.1.28

7 months ago

5.1.27

7 months ago

5.1.26

8 months ago

5.1.25

8 months ago

5.1.24

9 months ago

5.1.23

9 months ago

5.1.22

10 months ago

5.1.21

10 months ago

5.1.20

10 months ago

5.1.19

12 months ago

5.1.18

12 months ago

5.1.17

1 year ago

5.1.16

1 year ago

5.1.15

1 year ago

5.1.14

1 year ago

5.1.13

1 year ago

5.1.12

1 year ago

5.1.11

2 years ago

5.1.13-0

1 year ago

5.1.10

2 years ago

5.1.9

2 years ago

5.1.8

2 years ago

5.1.5

2 years ago

5.1.4

2 years ago

5.1.7

2 years ago

5.1.6

2 years ago

5.1.3

2 years ago

5.1.2

2 years ago

5.1.1

2 years ago

5.0.3

3 years ago

5.1.0

2 years ago

5.1.0-beta.0

3 years ago

5.1.0-beta.1

3 years ago

5.1.0-beta.2

2 years ago

5.1.0-beta.3

2 years ago

5.1.0-beta.4

2 years ago

5.1.0-beta.5

2 years ago

5.0.2

4 years ago

5.0.1

5 years ago

5.0.0

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.0.0

5 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago