public static void CheckCompatibleColors(BaseColor c1, BaseColor c2)
{
int type1 = ExtendedColor.GetType(c1);
int type2 = ExtendedColor.GetType(c2);
if (type1 != type2)
throw new ArgumentException(MessageLocalization.GetComposedMessage("both.colors.must.be.of.the.same.type"));
if (type1 == ExtendedColor.TYPE_SEPARATION && ((SpotColor)c1).PdfSpotColor != ((SpotColor)c2).PdfSpotColor)
throw new ArgumentException(MessageLocalization.GetComposedMessage("the.spot.color.must.be.the.same.only.the.tint.can.vary"));
if (type1 == ExtendedColor.TYPE_PATTERN || type1 == ExtendedColor.TYPE_SHADING)
ThrowColorSpaceError();
}