There are lots of ways to do it. You can add this to the end of the _set_layer3 function:
if self._user_layer is 0:
self._send_midi(tuple([240, 0, 1, 97, 12, 61, ......, 247])) #this changes the fader colors....you need to replace the "....." with a list of 9 numbers, each representing the color for one of the faders.
self._send_midi(tuple([240, 0, 1, 97, 12, 41, ......., 247])) #this changes the pad sensitivity...you need to replace the "...." with a list of 32 numbers, each representing the sensitivity for one of the pads.
for pad in self._pad:
pad.send_value(..., True) #this will change the color of each pad for the layer...replace "...." with a single integer representing the color you want for this layer.
elif self._user_layer is 1:
some code you want.....
elif self._user_layer is 2:
some code you want.....
elif self._user_layer is 3:
some code you want.....
I thought that was what the online editor allowed you to do that.
No, the online editor is useful for some things (e.g. making global changes to the controller's settings, or customizing settings for using without a script or other applications). The script accesses the same functions of the controller that the editor does, but does so dynamically so that controller can accommodate the different settings needed by the script/Live.
Hope this helps!