public void TestTintRegex() { Dictionary <string, Color> data = new Dictionary <string, Color> { { "tint=6aa6cc", ColorTranslator.FromHtml("#" + "6aa6cc") }, { "tint=106,166,204,255", Color.FromArgb(255, 106, 166, 204) }, { "tint=fff", Color.FromArgb(255, 255, 255, 255) }, { "tint=white", Color.White } }; Processors.Tint tint = new Processors.Tint(); foreach (KeyValuePair <string, Color> item in data) { tint.MatchRegexIndex(item.Key); Color result = tint.Processor.DynamicParameter; Assert.AreEqual(item.Value.ToArgb(), result.ToArgb()); } }
public void TestTintRegex() { Dictionary<string, Color> data = new Dictionary<string, Color> { { "tint=6aa6cc", ColorTranslator.FromHtml("#" + "6aa6cc") }, { "tint=106,166,204,255", Color.FromArgb(255, 106, 166, 204) }, { "tint=fff", Color.FromArgb(255, 255, 255, 255) }, { "tint=white", Color.White } }; Processors.Tint tint = new Processors.Tint(); foreach (KeyValuePair<string, Color> item in data) { tint.MatchRegexIndex(item.Key); Color result = tint.Processor.DynamicParameter; Assert.AreEqual(item.Value.ToArgb(), result.ToArgb()); } }