增加Check warning检测功能

This commit is contained in:
monitor1394
2020-04-11 15:18:34 +08:00
parent 80a946d0c6
commit c5b810df8b
8 changed files with 261 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
/******************************************/
using System.Text;
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
@@ -292,6 +293,28 @@ namespace XCharts
else return Color.clear;
}
public void CheckWarning(StringBuilder sb)
{
if (m_Font == null && m_CustomFont == null)
{
sb.AppendFormat("warning:theme->font is null");
}
if (m_ColorPalette.Length == 0 && m_CustomColorPalette.Count == 0)
{
sb.AppendFormat("warning:theme->colorPalette is empty");
}
for (int i = 0; i < m_ColorPalette.Length; i++)
{
if (m_ColorPalette[i] != Color.clear && m_ColorPalette[i].a == 0)
sb.AppendFormat("warning:theme->colorPalette[{0}] alpha = 0\n", i);
}
for (int i = 0; i < m_CustomColorPalette.Count; i++)
{
if (m_CustomColorPalette[i] != Color.clear && m_CustomColorPalette[i].a == 0)
sb.AppendFormat("warning:theme->colorPalette[{0}] alpha = 0\n", i);
}
}
Dictionary<int, string> _colorDic = new Dictionary<int, string>();
/// <summary>
/// Gets the hexadecimal color string of the specified index from the palette.