What do I need to add in order to have something like a “Foreground to Background” or other named/custom gradient loaded into the created filter layer?
from krita import *
# work on current document
activeDoc=Krita.instance().activeDocument()
# define filter properties
configParameters=InfoObject()
configParameters.setProperties({
'colorize': False,
'compatibilityMode': False,
'type': 1,
'h': 0,
's': -30,
'v': 25
})
# create filter
filter=Filter()
filter.setName('gradientmap')
filter.setConfiguration(configParameters)
# define selection on which filter will be applied (here all document area)
selection=Selection()
selection.select(0,0,activeDoc.width(), activeDoc.height(), 255)
# create filter layer
filterLayer=activeDoc.createFilterLayer("New filter layer", filter, selection)
# add it to document
activeDoc.rootNode().addChildNode(filterLayer, None)