decord/alpha/source/modules/messages/BurstReactionEffectUtils.tsx

38 lines
1.4 KiB
TypeScript
Raw Permalink Normal View History

2026-10-12 06:59:38 +00:00
// Module ID: 7964
// Function ID: 7965
// Name: BurstReactionEffectUtils
2026-10-10 08:08:14 +00:00
// Dependencies: [4967, 12, 2]
2026-07-20 16:05:17 +00:00
// Exports: replaceAnimationColors
2026-10-12 06:59:38 +00:00
// Module 7964 (BurstReactionEffectUtils)
2026-10-10 08:08:14 +00:00
import ColorUtils from "ColorUtils" /* 4967 */;
2026-10-03 08:58:59 +00:00
import module_12 from "module_12" /* 12 */;
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
const memoizeResult = module_12.memoize((str) => {
2026-07-20 16:05:17 +00:00
let length;
let num = 0;
let num2 = 0;
let num3 = 0;
if (0 < str.length) {
do {
2026-07-29 08:29:29 +00:00
num2 = (num2 << 5) - num2 + str.charCodeAt(num);
num = num + 1;
num3 = num2;
2026-07-20 16:05:17 +00:00
length = str.length;
2026-07-29 08:29:29 +00:00
} while (num < length);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return Math.abs(num3);
2026-07-20 16:05:17 +00:00
});
2026-10-03 08:58:59 +00:00
const result = size.fileFinishedImporting("modules/messages/BurstReactionEffectUtils.tsx");
export const replaceAnimationColors = function replaceAnimationColors(str, arg1) {
const items = [, , ];
({ r: arr[0], g: arr[1], b: arr[2] } = arg1);
const obj = ColorUtils;
const complimentaryPaletteForColor = obj.getComplimentaryPaletteForColor(items, 2);
str = str.replace(/(\[1,0,0,)/g, "[" + complimentaryPaletteForColor[0][0] / 255 + "," + complimentaryPaletteForColor[0][1] / 255 + "," + complimentaryPaletteForColor[0][2] / 255 + ",");
return str.replace(/\[0,0,1,/g, "[" + complimentaryPaletteForColor[1][0] / 255 + "," + complimentaryPaletteForColor[1][1] / 255 + "," + complimentaryPaletteForColor[1][2] / 255 + ",");
};
export const getBurstAnimationHash = memoizeResult;