2020-03-23 07:58:09 +08:00
|
|
|
/******************************************/
|
|
|
|
|
/* */
|
|
|
|
|
/* Copyright (c) 2018 monitor1394 */
|
|
|
|
|
/* https://github.com/monitor1394 */
|
|
|
|
|
/* */
|
|
|
|
|
/******************************************/
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
namespace XCharts
|
|
|
|
|
{
|
|
|
|
|
internal static class TitleHelper
|
|
|
|
|
{
|
|
|
|
|
public static Font GetTextFont(Title title, ThemeInfo themeInfo)
|
|
|
|
|
{
|
|
|
|
|
return (title.textStyle.font != null) ? title.textStyle.font : themeInfo.font;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Color GetTextColor(Title title, ThemeInfo themeInfo)
|
|
|
|
|
{
|
2020-05-13 09:54:40 +08:00
|
|
|
return !ChartHelper.IsClearColor(title.textStyle.color) ? title.textStyle.color : (Color)themeInfo.titleTextColor;
|
2020-03-23 07:58:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Font GetSubTextFont(Title title, ThemeInfo themeInfo)
|
|
|
|
|
{
|
|
|
|
|
return (title.subTextStyle.font != null) ? title.subTextStyle.font : themeInfo.font;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Color GetSubTextColor(Title title, ThemeInfo themeInfo)
|
|
|
|
|
{
|
2020-05-13 09:54:40 +08:00
|
|
|
return !ChartHelper.IsClearColor(title.subTextStyle.color) ? title.subTextStyle.color : (Color)themeInfo.titleSubTextColor;
|
2020-03-23 07:58:09 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|