@fantasy-color/rgb-to-srgb
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

@fantasy-color/rgb-to-srgb

Transform a RGB color object from the RGB space in 0-255 to the sRGB color space. The object output type is still RGB

type rgbToSrgb = (color: RGB) => RGB

Example usage:

import rgbToSrgb from '@fantasy-color/rgb-to-srgb'

rgbToSrgb({
  red: 78,
  green: 63,
  blue: 22,
})
// { red: 0.07618538148130785, green: 0.04970656598412723, blue: 0.008023192985384994 }

Readme

Keywords

none

Package Sidebar

Install

npm i @fantasy-color/rgb-to-srgb

Weekly Downloads

51

Version

2.1.0

License

MIT

Unpacked Size

6.93 kB

Total Files

9

Last publish

Collaborators

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