decord/stable/source/modules/messages/BurstReactionEffectUtils.tsx
github-actions e2bc0408ee chore: update source for stable 346.13
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-22 22:11:40 +00:00

34 lines
1.3 KiB
TypeScript

// Module ID: 7924
// Function ID: 7925
// Name: BurstReactionEffectUtils
// Dependencies: [4486, 12, 2]
// Exports: replaceAnimationColors
// Module 7924 (BurstReactionEffectUtils)
import ColorUtils from "ColorUtils" /* 4486 */;
import apply from "module_12" /* 12 */;
import size from "module_2" /* 2 */;
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 complimentaryPaletteForColor = ColorUtils.getComplimentaryPaletteForColor(items, 2);
return str.replace(/(\[1,0,0,)/g, "[" + complimentaryPaletteForColor[0][0] / 255 + "," + complimentaryPaletteForColor[0][1] / 255 + "," + complimentaryPaletteForColor[0][2] / 255 + ",").replace(/\[0,0,1,/g, "[" + complimentaryPaletteForColor[1][0] / 255 + "," + complimentaryPaletteForColor[1][1] / 255 + "," + complimentaryPaletteForColor[1][2] / 255 + ",");
};
export const getBurstAnimationHash = apply.memoize((str) => {
let length;
let num = 0;
let num2 = 0;
let num3 = 0;
if (0 < str.length) {
do {
num2 = (num2 << 5) - num2 + str.charCodeAt(num);
num = num + 1;
num3 = num2;
length = str.length;
} while (num < length);
}
return Math.abs(num3);
});