Example #1
0
 private void _verifyColorItemEntry(ColorEntry.ColorItemEntry expected, ColorEntry.ColorItemEntry actual)
 {
     Assert.AreEqual(expected.Brightness, actual.Brightness);
     Assert.AreEqual(expected.Contrast, actual.Contrast);
     Assert.AreEqual(expected.Hue, actual.Hue);
     Assert.AreEqual(expected.Saturation, actual.Saturation);
     Assert.AreEqual(expected.Lightness, actual.Lightness);
     Assert.AreEqual(expected.RGB, actual.RGB);
 }
 private ColorEntry.ColorItemEntry Parse(ColorItemType type, JObject jobject)
 {
     ColorEntry.ColorItemEntry item = new ColorEntry.ColorItemEntry();
     item.Type       = type;
     item.Hue        = (int)jobject["hue"];
     item.Saturation = (double)jobject["saturation"];
     item.Lightness  = (double)jobject["lightness"];
     item.Contrast   = (double)jobject["contrast"];
     item.Brightness = (int)jobject["brightness"];
     item.RGB        = Color.FromArgb((int)jobject["rgb"][0], (int)jobject["rgb"][1],
                                      (int)jobject["rgb"][2]);
     return(item);
 }