首先要确保Test组件色RichText是开启的 

把颜色转换为16进制字符串,然后添加到富文本,最后显示到Text组件

    public static string AddColor(string str, Color color)
    {
        return string.Format("<color=#{0}>{1}</color>", ColorUtility.ToHtmlStringRGBA(color), str);
    }