How to set up a color palette in Blender?
I found an answer: Create a 5x5 pixel image, and fill each pixel with a color you want to use.
Then open the shader editor.
Then, Shift+A, S for search, then type image texture.
Connect the image texture 'color' output to the 'base color' input of the Principled BSDF node.
Then, open the UV editor, and in the dropdown select your palette image.
Scroll up to zoom in to your image.
Then, tab into edit mode on your object, hover over the UV editor, then press A, S, 0.
Now, your faces should be tiny in the UV editor.
When you want to change the color of a face or multiple faces, you can select any faces in the 3D view, hover over the UV editor, and press 'G' to grab the faces and move them onto any of the colors in your palette.
Source