darktable.gui.mimic

function(
  widget_type : string,
  name : string,
  callback : function
)

Provides a virtual widget that can be assigned to a shortcut.

  • widget_type - string - The type of widget to mimic, one of: button, slider, dropdown.
  • name - string - The name of the virtual widget that a shortcut can be assigned to.
  • callback - function - A function containing darktable.gui.action calls to execute.

🔗Example

local dt = require "darktable"

dt.gui.mimic("slider", "multi-contrast",
  function(action, element, effect, size)
      if dt.gui.action("iop/filmicrgb", "focus") == 1 then
        which = "iop/filmicrgb/contrast"
      else
        which = "iop/colorbalancergb/contrast"
      end
      return dt.gui.action(which, element, effect, size)
    end
)