@sahilkathpal/aesthetic-hue-bg
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

aesthetic-hue-bg

A library to pull the dominant colour from an image and provide aesthetic background and border stroke colours.
Currently intended for creating backgrounds for link previews based on the favicon, this library supports only png and ico formats.

Installation

npm install @sahilkathpal/aesthetic-hue-bg --save

This package is intended for use in node environments. It won't work in a browser because it has node-specific dependencies.

Usage

const fs = require('fs');
const linkColour = require('aesthetic-hue-bg');

const buffer = fs.readFileSync("./test-images/bitcoin.ico");

const colours = linkColour.fetchColors(buffer, "image/x-icon").then((colors) => {
    // 'colors' is a JSON object {'fill': some-hex-code, 'stroke': some-other-hex-code}   
});

Readme

Keywords

none

Package Sidebar

Install

npm i @sahilkathpal/aesthetic-hue-bg

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

4.95 kB

Total Files

8

Last publish

Collaborators

  • sahilkathpal