Add a new layer. Color can be added as individual rgb values or through color object.
local layers = mainWindow:layers()
layers:addLayer(layer1)
local layer1 = layers:addLayer("Layer1")
local layer1 = layers:addLayer("Layer1", 2)
local layer1 = layers:addLayer("Layer1", 255, 255, 255)
local layer1 = layers:addLayer("Layer1", lc.Color(1,1,1))
local layer1 = layers:addLayer("Layer1", 2, 255, 255, 255)
local layer1 = layers:addLayer("Layer1", 2, lc.Color(1,1,1))
—-
Remove layer by passing in the layer on or by passing in the the layer object.
layers:removeLayer("Layer1")
layers:removeLayer(layer1)
Find layer by label.
local layer1 = layers:layerByName("Layer1")
Rename the given layer to a new layer name.
layers:renameLayer("OldLayer", "NewLayer")
layers:renameLayer(oldLayer, "NewLayer")
Replace the given layer with the the new layer passed as the second argument.
layers:replaceLayer("OldLayer", newLayer)
layers:replaceLayer(oldLayer, newLayer)