I want to convey in a heatmap how well are some correlations $[-1, 1]$ with its p-value $[0, 1]$. To normalize the plotting, the resulting numbers must be between $-1$ and $1$ and the sign must be the same as in the correlation in order to plot with a different color if the correlation is positive or negative. The higher the absolute value of a correlation is and the lowest the p-value, the higher must be the resulting number to be used for the heatmap.
How can I do that transformation to visualize easier the correlation and its p-value?
If $r = 0.8$ and $p = 0.04$, I want it with a value closer to $0$ than a correlation with $r = 0.8$ and $p = 0.03$. But a correlation with $r = -0.8$ and $p = 0.03$ must be minus the same number as for $r = 0.8$ and p-value $0.03$. Because usually low correlations tend to have high p-value (at least on my data) I would like to have the p-value and the correlation with the same influence on color.