本文整理匯總了C#中iTextSharp.text.BaseColor.Equals方法的典型用法代碼示例。如果您正苦於以下問題:C# BaseColor.Equals方法的具體用法?C# BaseColor.Equals怎麽用?C# BaseColor.Equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.BaseColor
的用法示例。
在下文中一共展示了BaseColor.Equals方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GoodColorTests
public virtual void GoodColorTests() {
String[] colors = {
"#00FF00", "00FF00", "#0F0", "0F0", "LIme",
"rgb(0,255,0 )"
};
// TODO webColor creates colors with a zero alpha channel (save
// "transparent"), BaseColor's 3-param constructor creates them with a
// 0xFF alpha channel. Which is right?!
BaseColor testCol = new BaseColor(0, 255, 0);
foreach (String colStr in colors) {
BaseColor curCol = WebColors.GetRGBColor(colStr);
Assert.IsTrue(testCol.Equals(curCol), DumpColor(testCol) + "!=" + DumpColor(curCol));
}
}
示例2: CompareColors
private bool CompareColors(BaseColor c1, BaseColor c2)
{
if (c1 == null && c2 == null)
return true;
if (c1 == null || c2 == null)
return false;
if (c1 is ExtendedColor)
return c1.Equals(c2);
return c2.Equals(c1);
}