UNPKG

961 BSource Map (JSON)View Raw
1{"version":3,"file":"updateT.js","sourceRoot":"../src/","sources":["utilities/color/updateT.ts"],"names":[],"mappings":";;;;AAAA,uDAAsD;AACtD,mCAA2C;AAG3C;;;GAGG;AACH,SAAgB,OAAO,CAAC,KAAa,EAAE,CAAS;IAC9C,IAAM,CAAC,GAAG,wBAAe,GAAG,CAAC,CAAC;IAC9B,6CACK,KAAK,KACR,CAAC,GAAA,EACD,CAAC,GAAA,EACD,GAAG,EAAE,mCAAgB,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,IAC9D;AACJ,CAAC;AARD,0BAQC","sourcesContent":["import { _rgbaOrHexString } from './_rgbaOrHexString';\nimport { MAX_COLOR_ALPHA } from './consts';\nimport type { IColor } from './interfaces';\n\n/**\n * Gets a color with the given transparency value and the same other components as `color`.\n * Does not modify the original color.\n */\nexport function updateT(color: IColor, t: number): IColor {\n const a = MAX_COLOR_ALPHA - t;\n return {\n ...color,\n t,\n a,\n str: _rgbaOrHexString(color.r, color.g, color.b, a, color.hex),\n };\n}\n"]}
\No newline at end of file