Normally, I call several object modifiers .fill and .stroke to apply specific details to a path.
curObj.path(in: CGRect( origin: .zero, size: geometry.size ))
.fill(curObj.drawInfo.fillColor ?? .clear)
This is because most of my tools are simple such as circles, lines or squares. I’m starting to write some tools that could return multiple objects and those would already be colorized etc. I am reusing my Canvas in a sub dialog and trying to think of way to not override colorization & pen info created by these sub tools. I don’t want to create an if statement knows about 1/2 a dozen tools that shouldn’t be overridden. The only thought I have had is to initialize the Canvas with the flag called something like allowColorization and do something like this sudo code:
if allowColorization
curObj.path(in: CGRect( origin: .zero, size: geometry.size ))
.fill(curObj.drawInfo.fillColor ?? .clear)
else
curObj.path(in: CGRect( origin: .zero, size: geometry.size ))
Could there be a better way? Something I don’t know such as having a reserved color to have the system ignore the setting of the color?