/** * Tests if this RtfColor is equal to another RtfColor. * * @param obj another RtfColor * @return <code>True</code> if red, green and blue values of the two colours match, * <code>false</code> otherwise. */ public override bool Equals(Object obj) { if (!(obj is RtfColor)) { return(false); } RtfColor color = (RtfColor)obj; return(this.red == color.GetRed() && this.green == color.GetGreen() && this.blue == color.GetBlue()); }
/** * Constructs a RtfColor as a clone of an existing RtfColor * * @param doc The RtfDocument this RtfColor belongs to * @param col The RtfColor to use as a base */ public RtfColor(RtfDocument doc, RtfColor col) : base(doc) { if (col != null) { this.red = col.GetRed(); this.green = col.GetGreen(); this.blue = col.GetBlue(); } if (this.document != null) { this.colorNumber = this.document.GetDocumentHeader().GetColorNumber(this); } }