1.1.0 • Published 8 months ago

hexashades v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

Currently, it only supports RGB Hex codes. More input formats will be allowed in the future.

Installation

NPM

npm install hexashades --save

Or load using a <script> tag from a CDN

<script src="https://cdn.jsdelivr.net/npm/hexashades/"></script>

Usage

// Import Hexashades & initialize.
import { Colors } from "hexashades";
const color = new Colors();

// Generate tints & shades.
const tintsAndShades = color.createColors("663399", 10, false);

API

createColors(color, percentage, prefix)

Returns an array of tints & shades for the given color with a given percentage of increments.

Throws an error if no/invalid inputs are given.

  • @param {string} color - a valid RGB hex code without #
  • @param {number} percentage - a valid percentage value between 0 and 100
  • @param {boolean} prefix - (Optional) true/false. Whether the output should include #
  • @return {Array<string>} - array with hex codes

License

MIT © arjunkdot

1.1.0

8 months ago

1.0.1

2 years ago

1.0.0

2 years ago