Make sure that the color hex codes match exactly. If the issue is hard to recreate it could also be a caching issue, in which case you should Clean the project with the brush icon at the top.