| | |
| | | |
| | | public static readonly Color s_NavyBrown = new Color32(110, 76, 49, 255);//6e4c31 |
| | | public static readonly Color s_Black = new Color32(0, 0, 0, 255); |
| | | public static readonly Color s_NavyYellow = new Color32(255, 239, 71, 255); |
| | | public static readonly Color s_NavyYellow = new Color32(242, 238, 2, 255); //f2ee02 |
| | | public static readonly Color s_LightGreen = new Color32(42, 227, 55, 255);//2ae337 |
| | | public static readonly Color s_LightWhite = new Color32(245, 246, 230, 255); //f5f6e6 |
| | | public static readonly Color s_Gray = new Color32(187, 187, 187, 255); //bbbbbb |
| | | public static readonly Color s_Gray = new Color32(132, 121, 123, 255); //84797b |
| | | public static readonly Color s_Gold = new Color32(255, 239, 71, 255);//ffef47 |
| | | public static readonly Color s_EarthYellow = new Color32(248, 152, 59, 255);//f8983b |
| | | |
| | |
| | | case TextColType.White: |
| | | return bright ? s_BrightWhiteColor : s_DarkWhiteColor; // s_BrightWhiteColor 是亮底灰色 |
| | | case TextColType.titleSelectColor: |
| | | return new Color32(114, 157, 228, 255); |
| | | case TextColType.titleUnSelectColor: |
| | | return new Color32(127, 65, 57, 255); |
| | | case TextColType.titleUnSelectColor: |
| | | return new Color32(110, 92, 96, 255); |
| | | case TextColType.Red: |
| | | return bright ? s_BrightRedColor : s_DarkRedColor; |
| | | case TextColType.Pink: |
| | |
| | | return s_BrightGreenColor; |
| | | case TextColType.Black: |
| | | return s_Black; |
| | | case TextColType.lightYellow: //浅黄色 |
| | | return new Color32(252, 237, 185, 255); |
| | | case TextColType.NavyYellow: |
| | | return s_NavyYellow; |
| | | case TextColType.LightGreen: |
| | |
| | | |
| | | public static string AppendColor(TextColType type, string msg, bool bright = false) |
| | | { |
| | | if (m_TextColorRegex.IsMatch(msg) && msg.ToLower().StartsWith("<color=#") |
| | | && msg.ToLower().EndsWith("</color>")) |
| | | { |
| | | Match match = m_TextColorRegex.Match(msg); |
| | | msg = match.Groups[1].Value; |
| | | } |
| | | // if (m_TextColorRegex.IsMatch(msg) && msg.ToLower().StartsWith("<color=#") |
| | | // && msg.ToLower().EndsWith("</color>")) |
| | | // { |
| | | // Match match = m_TextColorRegex.Match(msg); |
| | | // msg = match.Groups[1].Value; |
| | | // } |
| | | switch (type) |
| | | { |
| | | case TextColType.None: |
| | |
| | | case TextColType.LightGreen: |
| | | return StringUtility.Contact("<color=#", "8ddc11", ">", msg, "</color>"); |
| | | case TextColType.Gray: |
| | | return StringUtility.Contact("<color=#", "686868", ">", msg, "</color>"); |
| | | return StringUtility.Contact("<color=#", "84797b", ">", msg, "</color>"); |
| | | case TextColType.lightYellow: |
| | | return StringUtility.Contact("<color=#", "fcedb9", ">", msg, "</color>"); |
| | | case TextColType.NavyYellow: |
| | | return StringUtility.Contact("<color=#", "f2ee02", ">", msg, "</color>"); |
| | | } |
| | | return msg; |
| | | } |