Skip to content

Commit 6bf3706

Browse files
authored
add x-touch color calibration customisation
1 parent 8e412c3 commit 6bf3706

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

‎examples/x-touch.lua‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
local dt = require "darktable"
22
local du = require "lib/dtutils"
33

4-
du.check_min_api_version("9.1.0", "x-touch")
4+
du.check_min_api_version("9.1.0", "x-touch")
55

66
function knob(action, element, effect, size)
77
k = tonumber(action:sub(-1))
@@ -11,16 +11,30 @@ function knob(action, element, effect, size)
1111
which = "lib/masks/properties/" .. s[k]
1212

1313
elseif dt.gui.action("iop/colorzones", "focus") ~= 0 then
14+
which = "iop/colorzones/graph"
1415
local e = { "red", "orange", "yellow", "green", "aqua", "blue", "purple", "magenta" }
1516
element = e[k]
16-
which = "iop/colorzones/graph"
1717

1818
elseif dt.gui.action("iop/toneequal", "focus") ~= 0 then
1919
which ="iop/toneequal/simple/"..(k-9).." EV"
2020

21-
elseif k == 4 and dt.gui.action("iop/colorbalancergb", "focus") ~= 0 then
21+
elseif dt.gui.action("iop/colorbalancergb", "focus") ~= 0 and k == 4 then
2222
which = "iop/colorbalancergb/contrast"
2323

24+
elseif dt.gui.action("iop/channelmixerrgb", "focus") ~= 0 and k >= 5 then
25+
if k == 5 then
26+
which = "iop/channelmixerrgb/page"
27+
element = "CAT"
28+
if effect == "up" then effect = "next"
29+
elseif effect == "down" then effect = "previous"
30+
else effect = "activate"
31+
end
32+
else
33+
which = "iop/focus/sliders"
34+
local e = { "1st", "2nd", "3rd" }
35+
element = e[k - 5]
36+
end
37+
2438
else
2539
local s = { "iop/exposure/exposure",
2640
"iop/filmicrgb/white relative exposure",
@@ -32,6 +46,7 @@ function knob(action, element, effect, size)
3246
"iop/crop/bottom" }
3347
which = s[k]
3448
end
49+
3550
return dt.gui.action(which, element, effect, size)
3651
end
3752

0 commit comments

Comments
 (0)