Hello @jiyinyiyong,
While there are no formal guidelines for selecting colors, there are certain conventions you can follow. The colors you use will depend on the visual language of the product you are designing and who you it is for.
General advice:
• Ensure there is enough contrast between text (foreground) and background
• Use color to distinguish interactive elements like links from body text
• Make sure colors match overall visual language of the brand/product and;
• Look at color psychology charts, and the conventional meanings of colors (eg. red means danger, so use this color to show error states, etc.)
Resources: