0.0.3 • Published 6 years ago

@mzmap/color v0.0.3

Weekly downloads
1
License
Apache License 2....
Repository
-
Last release
6 years ago

Color

Support color mode list:

  • HSL
  • HSLA
  • RGB
  • RGBA
  • HSB

We will support CMYK, LAB in feature.

Install

$ npm install @mzmap/color --save

Usage

import Color from '@mzmap/color'

Create color methods

  • fromRGB
  • fromRGBA
  • fromHSL
  • fromHSLA
  • fromHSB

Get color array

  • toRGB
  • toRGBA
  • toHSL
  • toHSL
  • toHSB

Get color string

// rgb(255, 255, 255) ==> rgba(255, 255, 255, 1)
Color.fromRGB('rgb(255, 255, 255)').toString('rgba')