[Editor] Add the possibility to change line opacity in Ink editor

This commit is contained in:
Calixte Denizet 2022-07-24 22:19:09 +02:00
parent 45b9e8417d
commit 7831a100b3
10 changed files with 215 additions and 19 deletions

View file

@ -585,6 +585,14 @@ function getRGB(color) {
.map(x => parseInt(x));
}
if (color.startsWith("rgba(")) {
return color
.slice(/* "rgba(".length */ 5, -1) // Strip out "rgba(" and ")".
.split(",")
.map(x => parseInt(x))
.slice(0, 3);
}
warn(`Not a valid color format: "${color}"`);
return [0, 0, 0];
}