Files
5etools-mirror-2.github.io/js/utils-brew/utils-brew-helpers.js
TheGiddyLimit 2eeeb0771b v1.209.0
2024-07-10 20:47:40 +01:00

8 lines
253 B
JavaScript

export class BrewUtilShared {
/** Prevent any injection shenanigans */
static getValidColor (color, {isExtended = false} = {}) {
if (isExtended) return color.replace(/[^-a-zA-Z\d]/g, "");
return color.replace(/[^a-fA-F\d]/g, "").slice(0, 8);
}
}