So, first, the colour palette "sort of" resets when you exit the game, as has been mentioned by others. I say "sort of" because your custom colours don't reset, just the displayed colour samples reset. If you know where your edited colours are, they still work - its just that they don't look like your edited colours in the sample screen.
Another bug tied to the top point, when the displayed colour samples don't match the actual edited colours, as soon as you edit any one of the colours, then ALL the colours reset back to default and they all have to be re-edited.
When you edit the colour values numerically, the numbers seem to stay but the actual displayed colour does not change.