All colors used in your UI should serve a specific functionality. Do not use a color just because it looks nice in a particular situation. Consistency is key! There is a common language of what colors mean in any given culture. Try to leverage your user's existing expectations (e.g. green for success) whenever possible to ease onboarding. Finally, there should be sufficient contrast between the shades in your color palette to ensure that is
accessible for users with poor vision (and it'll help your SEO too).
The background color for your color palettes will be selected in Step 2.