| | |
| | | return msg; |
| | | } |
| | | |
| | | public static string AppendColor(Color color, string msg) |
| | | { |
| | | return StringUtility.Contact("<color=#", ColorToHexWithHash(color), ">", msg, "</color>"); |
| | | } |
| | | |
| | | |
| | | public static string ColorToHexWithHash(Color color, bool includeAlpha = false) |
| | | { |
| | | int r = Mathf.RoundToInt(color.r * 255); |
| | | int g = Mathf.RoundToInt(color.g * 255); |
| | | int b = Mathf.RoundToInt(color.b * 255); |
| | | if (includeAlpha) |
| | | { |
| | | int a = Mathf.RoundToInt(color.a * 255); |
| | | return string.Format("{0:X2}{1:X2}{2:X2}{3:X2}", r, g, b, a); |
| | | } |
| | | else |
| | | { |
| | | return string.Format("{0:X2}{1:X2}{2:X2}", r, g, b); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //needName 指官职0是否需要名称 |
| | | public static string GetRealmName(int realmLv, bool bright = true, bool needName = false) |
| | | { |
| | |
| | | /// <param name="itemColor"></param> |
| | | /// <param name="msg"></param> |
| | | /// <param name="bright"></param> |
| | | /// <param name="colorGroupType"></param> |
| | | /// <param name="colorGroupType">0 通用功能品质分组精良到神话</param> |
| | | /// <returns></returns> |
| | | public static string AppendColor(int itemColor, string msg, bool bright = true, int colorGroupType = 0) |
| | | { |