I assume this is the article you have referenced? It is pretty comprehensive.
Copy the file to overrides and modify it there. The json file will not change when you change settings on the UI settings page. The JSON file contains defaults and extra information such as palettes etc.
I suspect the problem that you are having is that the old JSON file is cached when you view the UI settings page. Clear your browser cache before visiting the UI settings page and you should by able to select your custom theme/palettes.