Nonlinear color scales

I have a dataset which spans [-40,40] (in some units), and there are important features in the 40 magnitude range and also in the < 1 magnitude range. I would like to use a nonlinear color scale, based on tanh() to visualize all the features (small and large).

From what I understand, makecpt only supports linear color scales. Is there an easy way to build a color scale using something like tanh(z) so I can visualize both small and large features in my data?

Different log-scale are also supported. From what I remember, it has to go in -J parameter

We do linear and log10 but clearly tang etc needs to be built with coordinates via gmt math (TANH) and splice into the cpt in stead of the values there.