using UnityEngine;
namespace Mx.Helper
{
public class ColorHelper
{
/// <summary>将16进制转换成颜色</summary>
public static Color HexToColor(string hexColorCode)
{
Color color;
if (ColorUtility.TryParseHtmlString(hexColorCode, out color))
{
return color;
}
else
{
Debug.LogError("无法解析颜色代码:" + hexColorCode);
return Color.white;
}
}
}
}