drawingSvgCompileIcon(pIconName) always BLACK

Mark Waddingham mark at livecode.com
Wed Apr 6 13:28:00 EDT 2022


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.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps



More information about the use-livecode mailing list