Enough people have asked for this so I just integrated @mikkel 's solution into the Official FalseColor component:
I also tweaked it a bit so that it can handle the edge case of the legend being larger than the original image.
This was definitely a lot easier with your code to start from, @mikkel . Thanks for doing the initial hard part!