Domain color plot with Makie

Is there a canonical way for domain colour plots in Makie?

I tried using Image, but it doesn’t have an option for me to specify the axes. heatmap! doesn’t seem to work for complex numbers either.

I found a way that works with heatmap. The trick is to use a function that can output colour directly. heatmap doesn’t like functions that output complex numbers.

using Colors

function domain_color(z::Complex)::HSL
    luminance = (atan(log(abs(z) ^ 0.6)) + pi/2) / pi
    hue = angle(z) / pi * 180
    HSL(hue, 1, luminance)
end

...

heatmap!(ax, xs, ys, (x, y) -> domain_color(Complex(f(x + im * y))))

Note that there is a package, DomainColoring.jl, that uses Makie for this.