spatialillusions / milsymbol

Military Symbols in JavaScript
www.spatialillusions.com/milsymbol
MIT License
557 stars 136 forks source link

Not able to change the frameColor #238

Closed YahavTheKing123 closed 4 years ago

YahavTheKing123 commented 4 years ago

Hi Mans,

I am trying to change the default black frame around the icon but it doesnt work for me. I am inserting the options obj the following:

var sym = new ms.Symbol('someSidc'); sym.setOptions({frameColor: '#b37eff'}); sym.asSVG();

But I see that the frameColor is not being changed :(

What do I missing here?

Thanks for your reply!

YahavTheKing123 commented 4 years ago

I found the solution. I inserted the color this way: options.frameColor= { Civilian: "red", Friend: "red", Hostile: "red", Neutral: "red", Unknown: "red", }

and it works.

Still I have one question: for the other modifiers, i can see that they are also being colored in the same color. Can i preseved the black color for the modifier while I am changging only the frame color?

Thanks in advance!

image

spatialillusions commented 4 years ago

Don't think that is possible at the moment, but it should be possible to hack the code to do this, you can use the API to replace the frame function with a custom function that uses the colors that you want.