/// <summary> /// Gets the Color for a particular TQ defined color /// </summary> /// <param name="color">TQ color enumeration</param> /// <returns>System.Drawing.Color for the particular TQ color</returns> public static Color Color(this TQColor color) { switch (color) { case TQColor.Aqua: return(System.Drawing.Color.FromArgb(0, 255, 255)); case TQColor.Blue: return(System.Drawing.Color.FromArgb(0, 163, 255)); case TQColor.DarkGray: return(System.Drawing.Color.FromArgb(153, 153, 153)); case TQColor.Fuschia: return(System.Drawing.Color.FromArgb(255, 0, 255)); case TQColor.Green: return(System.Drawing.Color.FromArgb(64, 255, 64)); case TQColor.Indigo: return(System.Drawing.Color.FromArgb(75, 0, 130)); case TQColor.Khaki: return(System.Drawing.Color.FromArgb(195, 176, 145)); case TQColor.LightCyan: return(System.Drawing.Color.FromArgb(224, 255, 255)); case TQColor.Maroon: return(System.Drawing.Color.FromArgb(128, 0, 0)); case TQColor.Orange: return(System.Drawing.Color.FromArgb(255, 173, 0)); case TQColor.Purple: return(System.Drawing.Color.FromArgb(217, 5, 255)); case TQColor.Red: return(System.Drawing.Color.FromArgb(255, 0, 0)); case TQColor.Silver: return(System.Drawing.Color.FromArgb(224, 224, 224)); case TQColor.Turquoise: return(System.Drawing.Color.FromArgb(0, 255, 209)); case TQColor.White: return(System.Drawing.Color.FromArgb(255, 255, 255)); case TQColor.Yellow: return(System.Drawing.Color.FromArgb(255, 245, 43)); case TQColor.YellowGreen: return(System.Drawing.Color.FromArgb(145, 203, 0)); default: return(System.Drawing.Color.White); } }
/// <summary> /// Return color tag identifier from color /// </summary> /// <param name="color"></param> /// <returns></returns> public static char TagIdentifier(this TQColor color) { switch (color) { case TQColor.Aqua: return('A'); case TQColor.Blue: return('B'); case TQColor.LightCyan: return('C'); case TQColor.DarkGray: return('D'); case TQColor.Fuschia: return('F'); case TQColor.Green: return('G'); case TQColor.Indigo: return('I'); case TQColor.Khaki: return('K'); case TQColor.YellowGreen: return('L'); case TQColor.Maroon: return('M'); case TQColor.Orange: return('O'); case TQColor.Purple: return('P'); case TQColor.Red: return('R'); case TQColor.Silver: return('S'); case TQColor.Turquoise: return('T'); case TQColor.Yellow: return('Y'); case TQColor.White: default: return('W'); } }
public Result(string container, string containerName, int sackNumber, SackType sackType, ToFriendlyNameResult fnames) { this.Container = container ?? throw new ArgumentNullException(nameof(container)); this.ContainerName = containerName ?? throw new ArgumentNullException(nameof(containerName)); this.SackNumber = sackNumber; this.SackType = sackType; this.FriendlyNames = fnames ?? throw new ArgumentNullException(nameof(fnames)); this.ItemName = fnames.FullNameClean; this.ItemStyle = fnames.Item.ItemStyle; this.TQColor = fnames.Item.ItemStyle.TQColor(); this.RequiredLevel = GetRequirement(fnames.RequirementVariables.Values, "levelRequirement"); }
/// <summary> /// Get color tag from <see cref="TQColor"/>. /// </summary> /// <param name="color"></param> /// <param name="fourCharFormat"></param> /// <returns></returns> public static string ColorTag(this TQColor color, bool fourCharFormat = true) => fourCharFormat ? $"{{^{color.TagIdentifier()}}}" : $"^{color.TagIdentifier()}";