add x-touch color calibration customisation

This commit is contained in:
dterrahe
2023-03-25 18:14:19 +00:00
committed by GitHub
parent 8e412c3eb3
commit 6bf3706455

View File

@@ -1,7 +1,7 @@
local dt = require "darktable"
local du = require "lib/dtutils"
du.check_min_api_version("9.1.0", "x-touch")
du.check_min_api_version("9.1.0", "x-touch")
function knob(action, element, effect, size)
k = tonumber(action:sub(-1))
@@ -11,16 +11,30 @@ function knob(action, element, effect, size)
which = "lib/masks/properties/" .. s[k]
elseif dt.gui.action("iop/colorzones", "focus") ~= 0 then
which = "iop/colorzones/graph"
local e = { "red", "orange", "yellow", "green", "aqua", "blue", "purple", "magenta" }
element = e[k]
which = "iop/colorzones/graph"
elseif dt.gui.action("iop/toneequal", "focus") ~= 0 then
which ="iop/toneequal/simple/"..(k-9).." EV"
elseif k == 4 and dt.gui.action("iop/colorbalancergb", "focus") ~= 0 then
elseif dt.gui.action("iop/colorbalancergb", "focus") ~= 0 and k == 4 then
which = "iop/colorbalancergb/contrast"
elseif dt.gui.action("iop/channelmixerrgb", "focus") ~= 0 and k >= 5 then
if k == 5 then
which = "iop/channelmixerrgb/page"
element = "CAT"
if effect == "up" then effect = "next"
elseif effect == "down" then effect = "previous"
else effect = "activate"
end
else
which = "iop/focus/sliders"
local e = { "1st", "2nd", "3rd" }
element = e[k - 5]
end
else
local s = { "iop/exposure/exposure",
"iop/filmicrgb/white relative exposure",
@@ -32,6 +46,7 @@ function knob(action, element, effect, size)
"iop/crop/bottom" }
which = s[k]
end
return dt.gui.action(which, element, effect, size)
end