Files
XCharts/Runtime/Utilities/ColorUtil.cs
monitor1394 bafe032bb9 3.0
2022-05-22 22:17:38 +08:00

22 lines
669 B
C#

using UnityEngine;
namespace XCharts.Runtime
{
public static class ColorUtil
{
public static readonly Color32 clearColor32 = new Color32(0, 0, 0, 0);
public static readonly Vector2 zeroVector2 = Vector2.zero;
/// <summary>
/// Convert the html string to color.
/// |将字符串颜色值转成Color。
/// </summary>
/// <param name="hexColorStr"></param>
/// <returns></returns>
public static Color32 GetColor(string hexColorStr)
{
Color color;
ColorUtility.TryParseHtmlString(hexColorStr, out color);
return (Color32) color;
}
}
}