@classmethod
def for_tag(cls, value, validate=True):
    """
        Convert the colour name into a CSS class that can be added to a Tag
        component.

        Args:
            value: the colour.
            validate: check whether the colour is one of the pre-defined
                values. Defaults to True.

        Raises:
            ValueError: if validate is True and the colour is invalid.

        Returns:
            str: the CSS class used to set the tag colour.

        """
    if validate and not cls.is_valid(value):
        raise ValueError('Unexpected colour', value)
    return 'govuk-tag--%s' % value
