By and large the colours proposed by default in the graphic charter should not be modified, in order to retain visual consistency throughout the website or application. You can often just let the publishing software handle the styles that are automatically applied to content when pages are displayed.
Nevertheless, it is sometimes useful to define customized colours directly in the content. In these circumstances, you need to make sure that there is an optimal contrast between the text colour and the background colour.
Moreover, text that is included in images or rich content such as animations must also be sufficiently contrasted from the background.