Merge pull request #2739 from surdaft/bugfix/2734-theme-apply-fails

WIP: 2734: Fix regex to enable alpha transparency hex codes (8 digits)
This commit is contained in:
hydroflame 2022-03-20 21:14:50 -04:00 committed by GitHub
commit 27603e7a66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,7 +28,7 @@ export function NetscriptUserInterface(
setTheme: function (newTheme: UserInterfaceTheme): void {
helper.updateDynamicRam("setTheme", getRamCost(player, "ui", "setTheme"));
const hex = /^(#)((?:[A-Fa-f0-9]{3}){1,2})$/;
const hex = /^(#)((?:[A-Fa-f0-9]{2}){3,4}|(?:[A-Fa-f0-9]{3}))$/;
const currentTheme = {...Settings.theme}
const errors: string[] = [];
for (const key of Object.keys(newTheme)) {