From 35beede55003999f36d05678d5f12ccf51ba15f3 Mon Sep 17 00:00:00 2001 From: OctoD Date: Thu, 8 Jun 2017 10:08:46 +0200 Subject: [PATCH] chore: Fixes colour override. --- extensions/accents-setter/index.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/extensions/accents-setter/index.ts b/extensions/accents-setter/index.ts index 8e8cc89..7f53f83 100644 --- a/extensions/accents-setter/index.ts +++ b/extensions/accents-setter/index.ts @@ -44,19 +44,20 @@ let accentsProperties: IGenericObject = { * @param {*} config */ function assignColorCustomizations(colour: string, config: any): void { + if (!isValidColour(colour)) { + colour = undefined; + } + Object.keys(accentsProperties).forEach(propertyName => { let accent: IAccentCustomProperty = accentsProperties[propertyName]; - - if (!isValidColour(colour)) { - colour = undefined; - } + let _colour = colour; if (colour && accent.alpha < 100) { - colour = `${ colour }${ accent.alpha > 10 ? accent.alpha : `0${ accent.alpha }` }`; + _colour = `${ colour }${ accent.alpha > 10 ? accent.alpha : `0${ accent.alpha }` }`; } if (accent) { - config[propertyName] = colour; + config[propertyName] = _colour; } }); }