Do not use colour to convey information on its own. It is preferable to use other ways apart from colour or a comparable method. This applies to text, and images, and rich content.
In the first example, the information in the pie chart can only be understood by associating a colour with the corresponding segment of the pie chart. The second version can be understood even if the colours are removed.