1.3.0 • Published 3 years ago

pixar v1.3.0

Weekly downloads
7
License
ISC
Repository
github
Last release
3 years ago

pixar

Installation

npm i --save pixar

#or

yarn add pixar

Usage

1. Pick color from image

const path = require('path')
const {parse} = require('pixar')


setImmediate(async () => {
    const file = path.join(__dirname, 'test.png')

    try {
        const parsed = await parse(file, {
            top: 1,
            left: 1,
            width: 100,
            height: 100,
        })

        const x = parsed.toHex()
        const rgba = parsed.toRGBA()
        console.log('Hex:', x)
        console.log('RGA:', rgba)
    } catch (error) {
        console.log("ERROR", error)
    }
})

2. Get similar color

const {getSimilarColor} = require('pixar')


setImmediate(async () => {
    const color = '#0a8455'
    const colors = ['#10a068', '#2053a2', '#f2ced8', '#ffb43d', '#91b8e1']
    const similar = getSimilarColor(color, colors)
    console.log(similar)
})
1.3.0

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago