SetColor

Overview

SetColor is a class in Aspose.PDF FOSS for .NET. Inherits from: SetColorOperator.

sc — Set color in current color space (non-stroking).

This class declares 11 methods for SetColor objects in .NET programs. Available methods include: Accept, IsTextShowOperator, SetColor, ToPdf, ToString, ValueEquals, getColor. Public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: B, C, Color, CommandName, G, Index, and 4 more.

Properties

NameTypeAccessDescription
Colordouble[]ReadGets the fill color components, interpreted in the current fill color space.
RdoubleRead/WriteGets or sets the red component (the first of three); reads 0 unless the color has at least three components.
GdoubleRead/WriteGets or sets the green component (the second of three), or the gray level when the color has a single component; reads 0 otherwise.
BdoubleRead/WriteGets or sets the blue component (the third of three); reads 0 unless the color has at least three components.
CdoubleRead/WriteGets or sets the cyan component (the first of four); reads 0 unless the color has exactly four components.
MdoubleRead/WriteGets or sets the magenta component (the second of four); reads 0 unless the color has exactly four components.
YdoubleRead/WriteGets or sets the yellow component (the third of four); reads 0 unless the color has exactly four components.
KdoubleRead/WriteGets or sets the black component (the fourth of four); reads 0 unless the color has exactly four components.
CommandNamestringReadThe PDF command name (last token of the serialised form, e.g.
IndexintRead/Write1-based position of this operator within its containing OperatorCollection.

Methods

SignatureDescription
SetColor()Creates an sc operator with no color components.
SetColor(g: double)Creates an sc operator with one component, such as a gray level.
SetColor(r: double, g: double, b: double)Creates an sc operator with three components, such as red, green and blue.
SetColor(c: double, m: double, y: double, k: double)Creates an sc operator with four components, such as cyan, magenta, yellow and black.
SetColor(color: double[])Creates an sc operator with the given components; a null array gives no components.
ToPdf()Calls ToPdf on this SetColor instance.
ToString()Calls ToString on this SetColor instance.
Accept(visitor: IOperatorSelector)Calls Accept(visitor) on this SetColor instance.
getColor()Calls getColor on this SetColor instance.
IsTextShowOperator(op: Operator)True when op is a text-showing operator (Tj / TJ / ’ / " — concrete subclasses of TextShowOperator).
ValueEquals(op: Operator)True when this operator’s serialised PDF form equals op’s.

See Also

 English