milsymbol icon indicating copy to clipboard operation
milsymbol copied to clipboard

monoColor

Open muby opened this issue 3 years ago • 2 comments

Hello,

I would to know there is a simple way to get MonoColor that can take a string like today or a ColorMode ?

Thanks a lot

muby avatar Feb 15 '22 23:02 muby

Hi,

You can override the built in color mode FrameColor.

https://github.com/spatialillusions/milsymbol/tree/master/docs#msgetcolormodemode

That should solve your problem.

/Måns

On 16 Feb 2022, at 00:06, Muby @.***> wrote:

 Hello,

I would to know there is a simple way to get MonoColor that can take a string like today or a ColorMode ?

Thanks a lot

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

spatialillusions avatar Feb 16 '22 17:02 spatialillusions

I think I was not clear or I don't understand you answer :)

What I want to do is to be able to assign ColorMode to monoColor.

For example : Working :

new ms.Symbol("SFGPEVAC--**--*", {
      }, {standard:"APP6",monoColor:"red",size:200}).asSVG()

or

Not Working

new ms.Symbol("SFGPEVAC--**--*", {
      }, {standard:"APP6",monoColor:ms.ColorMode("purple", "blue", "red", "green", "yellow"),size:200}).asSVG()
new ms.Symbol("SFGPEVAC--**--*", {
      }, {standard:"APP6",monoColor:ms.getColorMode("Light"),size:200}).asSVG()

muby avatar Feb 22 '22 09:02 muby

If you first override the frame colormode:

let fs = ms.getColorMode("FrameColor")
fs.Civilian = "purple"
fs.Friend = "blue"
fs.Hostile = "red"
fs.Neutral = "green"
fs.Unknown = "yellow"

// Not sure if you have to do this
ms.setColorMode("FrameColor", fs)

Then you will get your symbols as you want, if you request them unfilled:

new ms.Symbol("SFGPEVAC--**--*", {
      }, {standard:"APP6",fill:false,size:200}).asSVG()

spatialillusions avatar Jan 18 '23 19:01 spatialillusions