Ability to specify hex colors (#72)

This commit is contained in:
Simon J
2021-11-04 14:33:37 +11:00
committed by GitHub
parent 9d76c92e69
commit 602cb6b820
2 changed files with 24 additions and 9 deletions

View File

@@ -3,6 +3,7 @@ import logger from "./logger";
import url from "./url_builder";
export const WORD = /^\w+$/;
export const COLOR = /^#?\w+$/;
type EnvVarOpts = {
default: string | undefined;
@@ -64,10 +65,10 @@ export default function () {
secret: bnbEnvVar("SECRET", { default: "bonob" })!,
icons: {
foregroundColor: bnbEnvVar("ICON_FOREGROUND_COLOR", {
validationPattern: WORD,
validationPattern: COLOR,
}),
backgroundColor: bnbEnvVar("ICON_BACKGROUND_COLOR", {
validationPattern: WORD,
validationPattern: COLOR,
}),
},
sonos: {