drawingSvgCompileIcon(pIconName) always BLACK
Brian Milby
brian at milby7.com
Tue Oct 24 20:44:31 EDT 2023
Well, it sure took me a while to get around to this. I guess better late
than never though. Not sure where the best place to put it, so I just
added it to my lc-misc repo on GitHub. You can find the code here:
https://github.com/bwmilby/lc-misc/tree/master/IconDrawingLibrary
Thanks,
Brian
On Wed, Apr 6, 2022 at 3:20 PM Klaus major-k via use-livecode <
use-livecode at lists.runrev.com> wrote:
> Hi Brian,
>
> > Am 06.04.2022 um 21:18 schrieb Brian Milby via use-livecode <
> use-livecode at lists.runrev.com>:
> >
> > I guess I need to make an update to this library :)
>
> yo, that would be cool! :-)
>
> > Sent from my iPhone
> >
> >> On Apr 6, 2022, at 1:28 PM, Mark Waddingham via use-livecode <
> use-livecode at lists.runrev.com> wrote:
> >>
> >> On 2022-04-06 18:16, Klaus major-k via use-livecode wrote:
> >>> Hi all,
> >>> so sorry, looks like I completely f..... up here.
> >>> Sorry for the confusion, not may day...
> >>> See:
> >>> <https://quality.livecode.com/show_bug.cgi?id=23665>
> >>
> >> Hehe - no worries.
> >>
> >> So in answer to your original query about wanting to be able to color
> the icons - the drawing library supports the 'currentColor' attribute in
> SVG - and this is tied to the 'backgroundColor' property of the image
> object the drawing is set on.
> >>
> >> It would only take a small tweak to Brian's extension to make this work
> - adding `fill="currentColor"` to the path node it generates.
> >>
> >> Brian's extension works by fetching the path data from the IconSVG
> library, wrapping it in the necessary SVG XML, and then compiling it with
> drawingSvgCompile.
> >>
> >> Irksomely, there does not seem to be any support for marking colors in
> SVGs as 'currentColor' in any SVG editor we've come across (unless its
> deeply buried in it). So one strategy there is making sure the colors you
> want to be configurable in the SVG are set to a known unlikely random color
> (e.g. #ABCDEF), exporting as SVG XML from the editor and then just doing a
> global find/replace of (e.g.) #ABCDEF with currentColor.
> >>
> >> Warmest Regards,
> >>
> >> Mark.
>
> Best
>
> Klaus
>
> --
> Klaus Major
> https://www.major-k.de
> https://www.major-k.de/bass
> klaus at major-k.de
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list