@stackmeister/color
TypeScript icon, indicating that this package has built-in type declarations

0.1.7 • Public • Published

@stackmeister/color

Color conversion and manipulation toolbelt.

Install

// Yarn
yarn add @stackmeister/color

// NPM
npm i @stackmeister/color

TypeScript typings are included (No @types/ package needed)

Usage

Notice many features are not documented yet.

Parsing colors

import { parse } from '@stackmeister/color'

const red = parse('red') // { space: 'rgb', data: [255, 0, 0] }
const blue = parse('#00f') // { space: 'rgb', data: [0, 0, 255] }
const green = parse('rgb(0, 255, 0)') // { space: 'rgb', data: [0, 255, 0] }

Supported syntaxes:

  • Color names (extensive list of over 600 known colors)
  • Hex codes (short and long)
  • Function syntax (rgb, rgba, hsl, hsla)

Manipulating colors

Check auto-completion for full capabilities for now

const darkRed = red.darken(.5)

Readme

Keywords

none

Package Sidebar

Install

npm i @stackmeister/color

Weekly Downloads

5

Version

0.1.7

License

MIT

Unpacked Size

181 kB

Total Files

35

Last publish

Collaborators

  • torbenkoehn