Though there aren’t any rules about the colours that should and shouldn’t be paired together, there are tools that can help you pick the best colours for the web and provide you with an easy way to match them with their corresponding hex codes (your developers will thank you).
Check out the colour picker from Find The Data, which provides lots of information on any given colour, such as in the example below:
Additional Resources