I need a function (for a heatmap algorithm) that takes a percentage difference between two values, and returns a number between 0 and 1.
The output will be used in coloring parts of the screen. The output will be passed to an alpha channel.
The catch is, most of the time the percentage value I want to plot will be small and it will be hard to discern the difference between the colors.
That's why I want to magnify small values and compress the large ones.
The output should be something like this:
f(0) = 0
f(1) = 1
f(0.001) = 0.1
f(0.002) = 0.2
f(0.7) = 0.75
f(0.8) = 0.78
...
Do you see the pattern?
I've tried log, but I need the function to be defined at f(0). I've also tried x^a where a < 1, but in order to get the magnification I need I need to use a << 1 and that makes all the output so small it can't be discerned or the resolution is so small that the graphics assume it's the same color.