public void GetSaturationTest() { ExtendedColors ec = ExtendedColors.FromKnownColor(KnownExtendedColors.MareaBaja); Color c = Color.FromArgb(unchecked ((int)0xFF2E5464)); Assert.AreEqual(Math.Round(c.GetSaturation(), MidpointRounding.AwayFromZero), Math.Round(ec.GetSaturation(), MidpointRounding.AwayFromZero)); }
private void AddColors() { string[] sitems = new string[] { "", "" }; int count = 0; foreach (KnownExtendedColors ec in EnumUtil.GetValues <KnownExtendedColors>()) { sitems[1] = ec.ToString(); ListViewItem lv = new ListViewItem(sitems); lv.SubItems[0].BackColor = ExtendedColors.FromKnownColor(ec); lvColorLst.Items.Add(lv); lvColorLst.Items[count].UseItemStyleForSubItems = false; count++; } }
public void ToStringTest() { ExtendedColors ec = ExtendedColors.FromKnownColor(KnownExtendedColors.MareaBaja); Assert.AreEqual("ExtendedColors [MareaBaja]", ec.ToString()); }
public void ToKnownColorTest() { ExtendedColors ec = ExtendedColors.FromKnownColor(KnownExtendedColors.MareaBaja); Assert.AreEqual(unchecked (KnownExtendedColors.MareaBaja), ec.ToKnownColor()); }
public void ToArgbTest() { ExtendedColors ec = ExtendedColors.FromKnownColor(KnownExtendedColors.MareaBaja); Assert.AreEqual(unchecked ((int)0xFF2E5464), ec.ToArgb()); }