Add the color changes in the annotation storage

This commit is contained in:
Calixte Denizet 2023-07-29 18:15:23 +02:00
parent 7ae5a0fef7
commit d16d1f0d23
4 changed files with 57 additions and 12 deletions

View file

@ -331,9 +331,13 @@ class AnnotationElement {
get _commonActions() {
const setColor = (jsName, styleName, event) => {
const color = event.detail[jsName];
event.target.style[styleName] = ColorConverters[`${color[0]}_HTML`](
color.slice(1)
);
const colorType = color[0];
const colorArray = color.slice(1);
event.target.style[styleName] =
ColorConverters[`${colorType}_HTML`](colorArray);
this.annotationStorage.setValue(this.data.id, {
[styleName]: ColorConverters[`${colorType}_rgb`](colorArray),
});
};
return shadow(this, "_commonActions", {