AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
DataZoomTheme.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 float m_BorderWidth;
17  [SerializeField] protected float m_DataLineWidth;
18  [SerializeField] protected Color32 m_FillerColor;
19  [SerializeField] protected Color32 m_BorderColor;
20  [SerializeField] protected Color32 m_DataLineColor;
21  [SerializeField] protected Color32 m_DataAreaColor;
22  [SerializeField] protected Color32 m_BackgroundColor;
23 
28  public float borderWidth
29  {
30  get { return m_BorderWidth; }
31  set { if (PropertyUtil.SetStruct(ref m_BorderWidth, value)) SetVerticesDirty(); }
32  }
37  public float dataLineWidth
38  {
39  get { return m_DataLineWidth; }
40  set { if (PropertyUtil.SetStruct(ref m_DataLineWidth, value)) SetVerticesDirty(); }
41  }
46  public Color32 fillerColor
47  {
48  get { return m_FillerColor; }
49  set { if (PropertyUtil.SetColor(ref m_FillerColor, value)) SetVerticesDirty(); }
50  }
51 
56  public Color32 borderColor
57  {
58  get { return m_BorderColor; }
59  set { if (PropertyUtil.SetColor(ref m_BorderColor, value)) SetComponentDirty(); }
60  }
65  public Color32 dataLineColor
66  {
67  get { return m_DataLineColor; }
68  set { if (PropertyUtil.SetColor(ref m_DataLineColor, value)) SetComponentDirty(); }
69  }
74  public Color32 dataAreaColor
75  {
76  get { return m_DataAreaColor; }
77  set { if (PropertyUtil.SetColor(ref m_DataAreaColor, value)) SetComponentDirty(); }
78  }
83  public Color32 backgroundColor
84  {
85  get { return m_BackgroundColor; }
86  set { if (PropertyUtil.SetColor(ref m_BackgroundColor, value)) SetComponentDirty(); }
87  }
88 
89  public DataZoomTheme(Theme theme) : base(theme)
90  {
91  m_BorderWidth = XChartsSettings.dataZoomBorderWidth;
92  m_DataLineWidth = XChartsSettings.dataZoomDataLineWidth;
93  m_BackgroundColor = Color.clear;
94  switch (theme)
95  {
96  case Theme.Default:
97  m_TextColor = ColorUtil.GetColor("#333");
98  m_FillerColor = new Color32(167, 183, 204, 110);
99  m_BorderColor = ColorUtil.GetColor("#ddd");
100  m_DataLineColor = ColorUtil.GetColor("#2f4554");
101  m_DataAreaColor = new Color32(47, 69, 84, 85);
102  break;
103  case Theme.Light:
104  m_TextColor = ColorUtil.GetColor("#333");
105  m_FillerColor = new Color32(167, 183, 204, 110);
106  m_BorderColor = ColorUtil.GetColor("#ddd");
107  m_DataLineColor = ColorUtil.GetColor("#2f4554");
108  m_DataAreaColor = new Color32(47, 69, 84, 85);
109  break;
110  case Theme.Dark:
111  m_TextColor = ColorUtil.GetColor("#B9B8CE");
112  m_FillerColor = new Color32(135, 163, 206, (byte)(0.2f * 255));
113  m_BorderColor = ColorUtil.GetColor("#71708A");
114  m_DataLineColor = ColorUtil.GetColor("#71708A");
115  m_DataAreaColor = ColorUtil.GetColor("#71708A");
116  break;
117  }
118  }
119 
120  public void Copy(DataZoomTheme theme)
121  {
122  base.Copy(theme);
123  m_BorderWidth = theme.borderWidth;
124  m_DataLineWidth = theme.dataLineWidth;
125  m_FillerColor = theme.fillerColor;
126  m_BorderColor = theme.borderColor;
127  m_DataLineColor = theme.dataLineColor;
128  m_DataAreaColor = theme.dataAreaColor;
129  m_BackgroundColor = theme.backgroundColor;
130  }
131  }
132 }
XCharts.Theme
Theme
主题
Definition: ChartTheme.cs:21
XCharts.DataZoomTheme.dataLineColor
Color32 dataLineColor
the color of data area line. 数据阴影的线条颜色。
Definition: DataZoomTheme.cs:66
XCharts.DataZoomTheme.dataLineWidth
float dataLineWidth
the width of data line. 数据阴影线宽。
Definition: DataZoomTheme.cs:38
XCharts.DataZoomTheme.borderWidth
float borderWidth
the width of border line. 边框线宽。
Definition: DataZoomTheme.cs:29
XCharts
Definition: RewardChart.cs:14
XCharts.DataZoomTheme.fillerColor
Color32 fillerColor
the color of dataZoom data area. 数据区域颜色。
Definition: DataZoomTheme.cs:47
XCharts.DataZoomTheme
Definition: DataZoomTheme.cs:14
XCharts.DataZoomTheme.dataAreaColor
Color32 dataAreaColor
the color of data area line. 数据阴影的填充颜色。
Definition: DataZoomTheme.cs:75
XCharts.DataZoomTheme.borderColor
Color32 borderColor
the color of dataZoom border. 边框颜色。
Definition: DataZoomTheme.cs:57
XCharts.DataZoomTheme.backgroundColor
Color32 backgroundColor
the background color of datazoom. 背景颜色。
Definition: DataZoomTheme.cs:84
XCharts.ComponentTheme
Definition: ComponentTheme.cs:17
XCharts.XChartsSettings
Definition: XChartsSettings.cs:25