add image-utils, add color-utils (#766)

This commit is contained in:
prism 2026-02-13 23:32:10 +01:00 • committed by GitHub
parent 353590a811
commit 80938f4c6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -190,6 +190,28 @@ export const PinActions = findByPropsLazy("pinMessage", "unpinMessage");
export const IconUtils: t.IconUtils = findByPropsLazy("getGuildBannerURL", "getUserAvatarURL");
export const ColorUtils = mapMangledModuleLazy("Invalid hex color format", {
rgbToHex: filters.byCode(".toString(16).slice(1)"),
hexToRgba: filters.byCode("rgba(", "??"),
hexToRgb: filters.byCode(".rgb();return"),
rgbToHsl: filters.byCode("saturation:", "lightness:"),
mixColors: filters.byCode(".substring(1,3),16)"),
hexWithAlpha: filters.byCode("Invalid hex color format"),
getDominantColor: filters.byCode("hex:", "hsv:"),
generatePalette: filters.byCode("360/("),
});
export const ImageUtils = mapMangledModuleLazy("Input data is not a valid image.", {
extractColors: filters.byCode('"number"==typeof'),
fileToDataURL: filters.byCode("Result must be a string"),
dataURLToBlob: filters.byCode("new Uint8Array("),
dataURLToFile: filters.byCode("new File(["),
fitDimensions: filters.byCode("minWidth:", "minHeight:"),
loadImage: filters.byCode('addEventListener("load"'),
isAnimatedPNG: filters.byCode("File is not a PNG"),
base64Size: filters.byCode("Input data is not a valid image."),
});
export const ReadStateUtils = mapMangledModuleLazy('type:"ENABLE_AUTOMATIC_ACK",', {
ackChannel: filters.byCode(".isForumLikeChannel(")
});