colorido
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

colorido

Set of helpers and types to work with RGBA colors as [number, number, number, number] tuples.

Install

$ yarn add colorido

Usage

type TColor = [number, number, number, number]

colorToString(color: TColor) => string

isColor(value: any) => value is TColor
import { colorToString, isColor } from 'colorido'

const color = [255, 0, 0, 1]

console.log(
  colorToString(color)
)
// "rgba(255, 0, 0, 1)"

console.log(
  isColor(color)
)
// true

Readme

Keywords

none

Package Sidebar

Install

npm i colorido

Weekly Downloads

6

Version

2.1.0

License

MIT

Unpacked Size

4.96 kB

Total Files

9

Last publish

Collaborators

  • julia.spehrer
  • ijigg
  • deepsweet
  • xaviervia
  • psxcode
  • irminakacz
  • fosimus
  • atilaz
  • moria.am
  • gideon.gur