fix(FakeProfileThemes): correct profile theme colors regex

This commit is contained in:
ryan-0324 2024-07-25 05:05:53 -04:00
parent cc58bcfdfe
commit d029582a82

View file

@ -43,8 +43,8 @@ function encode(primary: number, accent: number) {
// Courtesy of Cynthia. // Courtesy of Cynthia.
function decode(bio: string): ProfileThemeColors | null { function decode(bio: string): ProfileThemeColors | null {
// /[#([0-9A-Fa-f]{0,6}),#([0-9A-Fa-f]{0,6})]/u // /[#([0-9A-Fa-f]{1,6}),#([0-9A-Fa-f]{1,6})]/u
const match = bio.match(/\u{E005B}\u{E0023}([\u{E0030}-\u{E0039}\u{E0041}-\u{E0046}\u{E0061}-\u{E0066}]{0,6})\u{E002C}\u{E0023}([\u{E0030}-\u{E0039}\u{E0041}-\u{E0046}\u{E0061}-\u{E0066}]{0,6})\u{E005D}/u); const match = bio.match(/\u{E005B}\u{E0023}([\u{E0030}-\u{E0039}\u{E0041}-\u{E0046}\u{E0061}-\u{E0066}]{1,6})\u{E002C}\u{E0023}([\u{E0030}-\u{E0039}\u{E0041}-\u{E0046}\u{E0061}-\u{E0066}]{1,6})\u{E005D}/u);
if (match) { if (match) {
const [, primary, accent] = match; const [, primary, accent] = match;