@d-healey that is absolutely true, I could make a separate local LAF object for each item I want to style. But I was thinking more in the spirit of data driven programming.
Lets image I'm making a toolbar of 20 buttons and I want each to have two separate SVG paths for the on and the off state for each of my buttons, 40 different SVGs.
LAF method: Make 20 local LAF objects, overwrite drawToggleButton
20 times, copy paste the same code only to change 2 variables in each function. Apply the LAF object to 20 Buttons.
Method 2: Make one LAF object, register one LAF function. Create a list of objects that contains the name of the button and both the SVG data variables needed for the button. Loop through the list of buttons, create paths from the variables, slap them to the data
object and add the LAF object to the button in loop.
One is more verbose than other. Sure you can extract the functionality of your LAF function to a different function you pass the SVG data into as separate function parameters, but you would still have to write laf.registerFunction()
20 times.
Non coders would find it easier to come into a project, having only to edit a list that has a pretty straight forward structure, I would argue to it would be more of a learning curve to explain to them, find these functions, and change these two function parameters here.