I realized after implementing this that #69 achieves pretty much the same as this PR, so feel free to choose that one if it is preferred. The main difference (apart from the algorithm) is that this PR uses a minor mode (pdf-view-recolor-hue-minor-mode) to toggle the new :render/recolor-hue epdfinfo option.
This uses the algorithm from zathura/render.c to preserve hue when recoloring the PDF. How it looks can be seen in https://github.com/politza/pdf-tools/issues/608 for example.
I realized after implementing this that #69 achieves pretty much the same as this PR, so feel free to choose that one if it is preferred. The main difference (apart from the algorithm) is that this PR uses a minor mode (
pdf-view-recolor-hue-minor-mode
) to toggle the new:render/recolor-hue
epdfinfo option.