Pick colors from imported texture

Hi want to be able to switch sprite colors. I can do this randomly. is there a way to say import a simple say 3x3 color palette and pick colors from that?

You need to learn on texture atlas for UV coord manipulation. I dont have the math for that. Alternatively, the easiest way would be to use linear curve and put all your colors within 0-0.9. You can call upon the linear curve by using curve atlas in the material by assigning an alpha value. (0-0.9).