AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
VisualMapTheme.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 Color32 m_BorderColor;
18  [SerializeField] protected Color32 m_BackgroundColor;
19  [SerializeField] [Range(10, 50)] protected float m_TriangeLen = 20f;
20 
25  public float borderWidth
26  {
27  get { return m_BorderWidth; }
28  set { if (PropertyUtil.SetStruct(ref m_BorderWidth, value)) SetVerticesDirty(); }
29  }
34  public Color32 borderColor
35  {
36  get { return m_BorderColor; }
37  set { if (PropertyUtil.SetColor(ref m_BorderColor, value)) SetComponentDirty(); }
38  }
39 
44  public Color32 backgroundColor
45  {
46  get { return m_BackgroundColor; }
47  set { if (PropertyUtil.SetColor(ref m_BackgroundColor, value)) SetComponentDirty(); }
48  }
53  public float triangeLen
54  {
55  get { return m_TriangeLen; }
56  set { if (PropertyUtil.SetStruct(ref m_TriangeLen, value < 0 ? 1f : value)) SetVerticesDirty(); }
57  }
58 
59  public VisualMapTheme(Theme theme) : base(theme)
60  {
61  m_BorderWidth = XChartsSettings.visualMapBorderWidth;
62  m_TriangeLen = XChartsSettings.visualMapTriangeLen;
63  m_FontSize = XChartsSettings.fontSizeLv4;
64  switch (theme)
65  {
66  case Theme.Default:
67  m_TextColor = ColorUtil.GetColor("#333");
68  m_BorderColor = ColorUtil.GetColor("#ccc");
69  m_BackgroundColor = ColorUtil.clearColor32;
70  break;
71  case Theme.Light:
72  m_TextColor = ColorUtil.GetColor("#333");
73  m_BorderColor = ColorUtil.GetColor("#ccc");
74  m_BackgroundColor = ColorUtil.clearColor32;
75  break;
76  case Theme.Dark:
77  m_TextColor = ColorUtil.GetColor("#B9B8CE");
78  m_BorderColor = ColorUtil.GetColor("#ccc");
79  m_BackgroundColor = ColorUtil.clearColor32;
80  break;
81  }
82  }
83 
84  public void Copy(VisualMapTheme theme)
85  {
86  base.Copy(theme);
87  m_TriangeLen = theme.triangeLen;
88  m_BorderWidth = theme.borderWidth;
89  m_BorderColor = theme.borderColor;
90  m_BackgroundColor = theme.backgroundColor;
91  }
92  }
93 }
XCharts.VisualMapTheme.backgroundColor
Color32 backgroundColor
the background color of visualmap. 背景颜色。
Definition: VisualMapTheme.cs:45
XCharts.Theme
Theme
主题
Definition: ChartTheme.cs:21
XCharts.VisualMapTheme
Definition: VisualMapTheme.cs:14
XCharts.VisualMapTheme.borderWidth
float borderWidth
the width of border. 边框线宽。
Definition: VisualMapTheme.cs:26
XCharts.VisualMapTheme.triangeLen
float? triangeLen
可视化组件的调节三角形边长。
Definition: VisualMapTheme.cs:54
XCharts
Definition: RewardChart.cs:14
XCharts.VisualMapTheme.borderColor
Color32 borderColor
the color of dataZoom border. 边框颜色。
Definition: VisualMapTheme.cs:35
XCharts.ComponentTheme
Definition: ComponentTheme.cs:17
XCharts.XChartsSettings
Definition: XChartsSettings.cs:25