mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-19 06:50:18 +00:00
修复serie系列数超过调色盘颜色数时获取的颜色异常的问题
This commit is contained in:
@@ -244,14 +244,14 @@ namespace XCharts
|
||||
public Color32 GetColor(int index)
|
||||
{
|
||||
if (index < 0) index = 0;
|
||||
var customIndex = index >= m_CustomColorPalette.Count ? index : index % m_CustomColorPalette.Count;
|
||||
var customIndex = index < m_CustomColorPalette.Count ? index : index % m_CustomColorPalette.Count;
|
||||
if (customIndex < m_CustomColorPalette.Count && m_CustomColorPalette[customIndex] != Color.clear)
|
||||
{
|
||||
return m_CustomColorPalette[customIndex];
|
||||
}
|
||||
else
|
||||
{
|
||||
var newIndex = index >= m_ColorPalette.Length ? index : index % m_ColorPalette.Length;
|
||||
var newIndex = index < m_ColorPalette.Length ? index : index % m_ColorPalette.Length;
|
||||
if (newIndex < m_ColorPalette.Length)
|
||||
return m_ColorPalette[newIndex];
|
||||
else return Color.clear;
|
||||
|
||||
Reference in New Issue
Block a user