UNPKG

907 BSource Map (JSON)View Raw
1{"version":3,"file":"updateRGB.js","sourceRoot":"../src/","sources":["utilities/color/updateRGB.ts"],"names":[],"mappings":";;;AAAA,uDAAsD;AAGtD;;;GAGG;AACH,SAAgB,SAAS,CAAC,KAAa,EAAE,SAAqB,EAAE,KAAa;;IAC3E,OAAO,mCAAgB;YACrB,CAAC,EAAE,KAAK,CAAC,CAAC;YACV,CAAC,EAAE,KAAK,CAAC,CAAC;YACV,CAAC,EAAE,KAAK,CAAC,CAAC;YACV,CAAC,EAAE,KAAK,CAAC,CAAC;;QACV,GAAC,SAAS,IAAG,KAAK;YAClB,CAAC;AACL,CAAC;AARD,8BAQC","sourcesContent":["import { getColorFromRGBA } from './getColorFromRGBA';\nimport type { IColor, IRGB } from './interfaces';\n\n/**\n * Gets a color with a single RGBA component updated to a new value.\n * Does not modify the original `color`. Alpha defaults to 100 if not set.\n */\nexport function updateRGB(color: IColor, component: keyof IRGB, value: number): IColor {\n return getColorFromRGBA({\n r: color.r,\n g: color.g,\n b: color.b,\n a: color.a,\n [component]: value,\n });\n}\n"]}
\No newline at end of file