AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
TooltipTheme.cs
1 /************************************************/
2 /* */
3 /* Copyright (c) 2018 - 2021 monitor1394 */
4 /* https://github.com/monitor1394 */
5 /* */
6 /************************************************/
7 
8 using System;
9 using UnityEngine;
10 
11 namespace XCharts
12 {
13  [Serializable]
15  {
16  [SerializeField] protected LineStyle.Type m_LineType = LineStyle.Type.Solid;
17  [SerializeField] protected float m_LineWidth = 1f;
18  [SerializeField] protected Color32 m_LineColor;
19  [SerializeField] protected Color32 m_AreaColor;
20  [SerializeField] protected Color32 m_LabelTextColor;
21  [SerializeField] protected Color32 m_LabelBackgroundColor;
22 
27  public LineStyle.Type lineType
28  {
29  get { return m_LineType; }
30  set { if (PropertyUtil.SetStruct(ref m_LineType, value)) SetVerticesDirty(); }
31  }
36  public float lineWidth
37  {
38  get { return m_LineWidth; }
39  set { if (PropertyUtil.SetStruct(ref m_LineWidth, value)) SetVerticesDirty(); }
40  }
45  public Color32 lineColor
46  {
47  get { return m_LineColor; }
48  set { if (PropertyUtil.SetColor(ref m_LineColor, value)) SetVerticesDirty(); }
49  }
54  public Color32 areaColor
55  {
56  get { return m_AreaColor; }
57  set { if (PropertyUtil.SetColor(ref m_AreaColor, value)) SetVerticesDirty(); }
58  }
63  public Color32 labelTextColor
64  {
65  get { return m_LabelTextColor; }
66  set { if (PropertyUtil.SetColor(ref m_LabelTextColor, value)) SetComponentDirty(); }
67  }
68 
73  public Color32 labelBackgroundColor
74  {
75  get { return m_LabelBackgroundColor; }
76  set { if (PropertyUtil.SetColor(ref m_LabelBackgroundColor, value)) SetComponentDirty(); }
77  }
78 
79  public TooltipTheme(Theme theme) : base(theme)
80  {
81  m_LineType = LineStyle.Type.Solid;
82  m_LineWidth = XChartsSettings.tootipLineWidth;
83  switch (theme)
84  {
85  case Theme.Default:
86  m_TextBackgroundColor = ColorUtil.GetColor("#515151C8");
87  m_TextColor = ColorUtil.GetColor("#FFFFFFFF");
88  m_AreaColor = ColorUtil.GetColor("#51515120");
89  m_LabelTextColor = ColorUtil.GetColor("#FFFFFFFF");
90  m_LabelBackgroundColor = ColorUtil.GetColor("#292929FF");
91  m_LineColor = ColorUtil.GetColor("#29292964");
92  break;
93  case Theme.Light:
94  m_TextBackgroundColor = ColorUtil.GetColor("#515151C8");
95  m_TextColor = ColorUtil.GetColor("#FFFFFFFF");
96  m_AreaColor = ColorUtil.GetColor("#51515120");
97  m_LabelTextColor = ColorUtil.GetColor("#FFFFFFFF");
98  m_LabelBackgroundColor = ColorUtil.GetColor("#292929FF");
99  m_LineColor = ColorUtil.GetColor("#29292964");
100  break;
101  case Theme.Dark:
102  m_TextBackgroundColor = ColorUtil.GetColor("#515151C8");
103  m_TextColor = ColorUtil.GetColor("#FFFFFFFF");
104  m_AreaColor = ColorUtil.GetColor("#51515120");
105  m_LabelTextColor = ColorUtil.GetColor("#FFFFFFFF");
106  m_LabelBackgroundColor = ColorUtil.GetColor("#A7A7A7FF");
107  m_LineColor = ColorUtil.GetColor("#eee");
108  break;
109  }
110  }
111 
112  public void Copy(TooltipTheme theme)
113  {
114  base.Copy(theme);
115  m_LineType = theme.lineType;
116  m_LineWidth = theme.lineWidth;
117  m_LineColor = theme.lineColor;
118  m_AreaColor = theme.areaColor;
119  m_LabelTextColor = theme.labelTextColor;
120  m_LabelBackgroundColor = theme.labelBackgroundColor;
121  }
122  }
123 }
XCharts.TooltipTheme.lineType
LineStyle.Type lineType
the type of line. 坐标轴线类型。
Definition: TooltipTheme.cs:28
XCharts.TooltipTheme.areaColor
Color32 areaColor
the color of line. 区域指示的颜色。
Definition: TooltipTheme.cs:55
XCharts.Theme
Theme
主题
Definition: ChartTheme.cs:21
XCharts.LineStyle.Type
Type
线的类型。
Definition: LineStyle.cs:25
XCharts.TooltipTheme.lineWidth
float lineWidth
the width of line. 指示线线宽。
Definition: TooltipTheme.cs:37
XCharts
Definition: RewardChart.cs:14
XCharts.TooltipTheme.labelBackgroundColor
Color32 labelBackgroundColor
the background color of tooltip cross indicator's axis label. 十字指示器坐标轴标签的背景颜色。
Definition: TooltipTheme.cs:74
XCharts.LineStyle
The style of line. 线条样式。 注: 修改 lineStyle 中的颜色不会影响图例颜色,如果需要图例颜色和折线图颜色一致,需修改 itemStyle....
Definition: LineStyle.cs:20
XCharts.TooltipTheme
Definition: TooltipTheme.cs:14
XCharts.TooltipTheme.labelTextColor
Color32 labelTextColor
the text color of tooltip cross indicator's axis label. 十字指示器坐标轴标签的文本颜色。
Definition: TooltipTheme.cs:64
XCharts.TooltipTheme.lineColor
Color32 lineColor
the color of line. 指示线颜色。
Definition: TooltipTheme.cs:46
XCharts.ComponentTheme
Definition: ComponentTheme.cs:17
XCharts.XChartsSettings
Definition: XChartsSettings.cs:25