chore: Fixes colour override.
This commit is contained in:
parent
328536473e
commit
35beede550
1 changed files with 7 additions and 6 deletions
|
@ -44,19 +44,20 @@ let accentsProperties: IGenericObject<IAccentCustomProperty> = {
|
||||||
* @param {*} config
|
* @param {*} config
|
||||||
*/
|
*/
|
||||||
function assignColorCustomizations(colour: string, config: any): void {
|
function assignColorCustomizations(colour: string, config: any): void {
|
||||||
|
if (!isValidColour(colour)) {
|
||||||
|
colour = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
Object.keys(accentsProperties).forEach(propertyName => {
|
Object.keys(accentsProperties).forEach(propertyName => {
|
||||||
let accent: IAccentCustomProperty = accentsProperties[propertyName];
|
let accent: IAccentCustomProperty = accentsProperties[propertyName];
|
||||||
|
let _colour = colour;
|
||||||
if (!isValidColour(colour)) {
|
|
||||||
colour = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (colour && accent.alpha < 100) {
|
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) {
|
if (accent) {
|
||||||
config[propertyName] = colour;
|
config[propertyName] = _colour;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue