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