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

2.1.0 • Public • Published

@fantasy-color/normalize-rgba

Turn an RGBA color value from 0-255 to take a value from 0-1

type normalizeRgba = (color: RGBA) => RGBA

Example usage:

import normalizeRgba from '@fantasy-color/normalize-rgba'

normalizeRgba({
  red: 255,
  green: 70,
  blue: 50,
  alpha: 0.3
})
// > { red: 1, green: 0.27450980392156865, blue: 0.19607843137254902, alpha: 0.3 }

Readme

Keywords

none

Package Sidebar

Install

npm i @fantasy-color/normalize-rgba

Weekly Downloads

2

Version

2.1.0

License

MIT

Unpacked Size

4.58 kB

Total Files

9

Last publish

Collaborators

  • ijigg
  • moria.am
  • atilaz
  • gideon.gur
  • irminakacz
  • fernando.3
  • xaviervia
  • psxcode
  • deepsweet