2734: Fix regex to enable alpha transparency hex codes (8 digits)

This commit is contained in:
Jack Stupple 2022-01-27 18:21:17 +00:00
parent 07fe3c1906
commit 2942ca500b

@ -28,7 +28,7 @@ export function NetscriptUserInterface(
setTheme: function (newTheme: UserInterfaceTheme): void { setTheme: function (newTheme: UserInterfaceTheme): void {
helper.updateDynamicRam("setTheme", getRamCost(player, "ui", "setTheme")); 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 currentTheme = {...Settings.theme}
const errors: string[] = []; const errors: string[] = [];
for (const key of Object.keys(newTheme)) { for (const key of Object.keys(newTheme)) {