swhitty / SwiftDraw

Swift library and command line tool to convert SVGs into SFSymbol, PNG, PDF and Swift source code.
zlib License
325 stars 41 forks source link

How to utilize `currentColor`? #46

Open Eric0625 opened 3 days ago

Eric0625 commented 3 days ago

Thanks for sharing such an amazing repo. I've been using it well; however, I couldn't figure out a way to paint currentColor with colours, especially colours with opacity not equal to one. I found this property seems supported in your repo but haven't succeeded in assigning the correct colour value to it.

Eric0625 commented 3 days ago

Follow up: I changed the code in LayerTree.Builder.swift, at line 47 to

var state = State()
state.color = .keyword(.aqua)
let l = makeLayer(from: svg, inheriting: state)

The color was then successfully applied to currentColor.