mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-22 08:33:50 +00:00
优化Legend的颜色可自动匹配ItemStyle的自定义颜色#89
This commit is contained in:
@@ -18,12 +18,14 @@ namespace XCharts
|
||||
else return (Color)themeInfo.legendUnableColor;
|
||||
}
|
||||
|
||||
public static Color GetIconColor(Legend legend, int readIndex, ThemeInfo themeInfo, bool active)
|
||||
public static Color GetIconColor(Legend legend, int readIndex, ThemeInfo themeInfo, Series series, string legendName, bool active)
|
||||
{
|
||||
if (active)
|
||||
{
|
||||
if (legend.itemAutoColor || legend.GetIcon(readIndex) == null)
|
||||
return (Color)themeInfo.GetColor(readIndex);
|
||||
{
|
||||
return SeriesHelper.GetNameColor(series, readIndex, legendName, themeInfo);
|
||||
}
|
||||
else
|
||||
return Color.white;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user