Replicating black mist filters in darktable

I was thinking to a way to colorize the diffusion…

in this way the diffusion is bi-color red and cyan, red when a pixel become brighter but the diffusion is cyan when a pixel become darker

So I came up with this in gimp:

Let’s start with this image and what we want is a green diffusion

Duplicate two times the original image

the first step is to use the diffusion in the top layer on the green channel and set this layer to “lighten only” (the diffusion is green when a pixel becomes brighter)

the second step is to use the diffusion in the middle layer on the red and blu channels and set this layer to “darken only” (the diffusion is green when a pixel becomes darker)

and this is the resulting pure green diffusion

With this technique is possible to get directly red-green-blu-cyan-magenta and yellow diffusion.

Mixing red and yellow or red and green gives a nice warm diffusion filter