in src/canvastools/ts/CanvasTools/Region/Point/TagsElement.ts [78:159]
protected initStyleMaps(tags: TagsDescriptor) {
if (tags !== null) {
if (tags.primary !== null) {
this.styleMap = [
{
rule: `.${this.styleId} .primaryTagPointStyle`,
style: `fill: ${tags.primary.colorAccent};`,
},
{
rule: `.regionStyle.${this.styleId}:hover .primaryTagPointStyle`,
style: `fill: ${tags.primary.colorHighlight};
stroke: #fff;`,
},
{
rule: `.regionStyle.selected.${this.styleId} .primaryTagPointStyle`,
style: `fill: ${tags.primary.colorAccent};
stroke:${tags.primary.colorHighlight};`,
},
];
this.styleLightMap = [
{
rule: `.${this.styleId} .primaryTagPointStyle`,
style: `fill: ${tags.primary.colorNoColor};
stroke:${tags.primary.colorAccent};
stroke-width: 1px;`,
},
{
rule: `.regionStyle.${this.styleId}:hover .primaryTagPointStyle`,
style: `stroke:${tags.primary.colorAccent};`,
},
{
rule: `.regionStyle.selected.${this.styleId} .primaryTagPointStyle`,
style: `fill: ${tags.primary.colorHighlight};
stroke:${tags.primary.colorAccent};`,
},
{
rule: `.regionStyle.${this.styleId} .secondaryTagStyle`,
style: `opacity:0.25;`,
},
{
rule: `.regionStyle.${this.styleId} .dragPointStyle`,
style: `opacity:0.25;`,
},
{
rule: `.regionStyle.selected.${this.styleId} .dragPointStyle`,
style: `opacity:0.5;`,
},
];
} else {
this.styleMap = [];
this.styleLightMap = [
{
rule: `.${this.styleId} .primaryTagPointStyle`,
style: `fill: var(--default-color-transparent);
stroke: var(--default-color-pure);
stroke-width: 1px;`,
},
{
rule: `.regionStyle.${this.styleId} .dragPointStyle`,
style: `opacity:0.25;`,
},
{
rule: `.regionStyle.selected.${this.styleId} .dragPointStyle`,
style: `opacity:0.5;`,
},
];
}
if (tags.secondary !== null && tags.secondary !== undefined) {
tags.secondary.forEach((tag) => {
const rule = {
rule: `.secondaryTagStyle.secondaryTag-${tag.name}`,
style: `fill: ${tag.colorAccent};`,
};
this.styleMap.push(rule);
this.styleLightMap.push(rule);
});
}
}
}