Colorbar shows colors backwards

I think that the colors in the colorbar are shown upside down. I saw this in my own code, but looking at the linked example, it is also happening there: the blueish should be at the bottom (close to zero) and the orange-red should be at the top (close to 1.5).

Hopefully my description makes sense.
Thanks

1 Like

This should be fixed in the next release. lq.colorbar has it colors inverted on pdf export, but not on the preview · Issue #85 · lilaq-project/lilaq · GitHub

Yes I can confirm that this has been fixed on main. It’s due to a bug in the Typst compiler but beginning with the next version of Lilaq, an internal workaround will fix the issue :)

It usually happens because the y-axis in Typst (and many graphics packages) defaults to pointing downwards. You can usually fix this by just reversing the direction of your color map or adding a reverse: true (if the package supports it) to the colorbar function. Alternatively, check if flipping the y limits helps!