Simplier colors detection (using css vars).

This commit is contained in:
John Livingston
2021-11-22 13:30:55 +01:00
parent 8999133dcc
commit ede36695cd
2 changed files with 15 additions and 36 deletions

View File

@ -41,7 +41,8 @@ function areAutoColorsValid (autocolors: AutoColors): true | string[] {
if (
!/^rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\)$/.test(color) &&
!/^rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*(1|0|0?.\d+)\)$/.test(color) &&
!/^#[0-9a-fA-F]{3,6}$/.test(color)
!/^#[0-9a-fA-F]{3,6}$/.test(color) &&
!/^[a-z]+$/
) {
errors.push(color)
}