I am trying to create a logarithmically decreasing output from a linearly increasing input. Say that I have two graphs, one representing the input and the other representing the output, I have a linear one (the input) that starts at zero and increases linearly to $255$, while the other one (the output) will need to start at $255$ and decrease fast before evening out and ending at zero.
This is to be used for filtering joystick controller input. I am looking for a function that looks something like this: $f(x) = 255 - Kx$, where $K$ is the value that I'm struggling to find.
I have been scratching my head for a while and would appreciate some guidance.
What do you think about $f(x) = 255 - a \cdot \log(x+1)$ where $a = 255/\log(256) \approx 46$?