ailon/markerjs2

Specific color selection for specific markers

Closed this issue · 1 comments

Hey,

is it possible that for the HighlightMarker only the color yellow is available and for the TextMarker only the color black and white?
I tried it in the markercreating event, but the toolbox at the bottom is not switched until the next marker.

This is how I tried it:

  this.marker.addEventListener("markercreating", (ev) => {
            if (ev.marker?.typeName === "HighlightMarker") {
                this.marker.settings.defaultColorSet = ["yellow"];
                this.marker.settings.defaultColor = "yellow";
            } else if (ev.marker?.typeName === "TextMarker") {
                this.marker.settings.defaultColorSet = ["white", "black"];
                this.marker.settings.defaultColor = "white";
            }
        });

Many greetings
Benny

ailon commented

Hi Benny.

There's no support for custom colors per marker type in this version, unfortunately. I have this in the to-do list for v3 though.

Alan.