This is actually a pretty solid way to do the palette swapping and really close to how I did it in my game. You could also render your scene to a viewport and then use a viewport texture that you then apply the shader to, that might get around your mouse event problem.