Fix: throw an error for unparsable color
This commit is contained in:
parent
3c30bc3eb0
commit
9713c6a3be
|
@ -12,7 +12,11 @@ var metaParser = (() => {
|
|||
},
|
||||
color: state => {
|
||||
if (state.value !== null) {
|
||||
colorConverter.format(colorConverter.parse(state.value), 'rgb');
|
||||
const color = colorConverter.parse(state.value);
|
||||
if (!color) {
|
||||
throw new Error(`invalid color: ${state.value}`);
|
||||
}
|
||||
state.value = colorConverter.format(color, 'rgb');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user