Show / Hide Table of Contents

# Class ColorPt

ColorPt is an array of colorants (or tint values) representing a color point in an associated color space.

##### Inheritance

object
ColorPt

##### Implements

IDisposable

##### Inherited Members

object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()

###### Namespace: pdftron.PDF

###### Assembly: PDFTronDotNet.dll

##### Syntax

    public class ColorPt : IDisposable

### Constructors

#### ColorPt()

Instantiates a new `ColorPt` object.

##### Declaration

    public ColorPt()

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### ColorPt(double)

Instantiates a new `ColorPt` object.

##### Declaration

    public ColorPt(double x)

##### Parameters

Type | Name | Description
--- | --- | ---
double | x | the x

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### ColorPt(double, double)

Instantiates a new `ColorPt` object.

##### Declaration

    public ColorPt(double x, double y)

##### Parameters

Type | Name | Description
--- | --- | ---
double | x | the x
double | y | the y

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### ColorPt(double, double, double)

Instantiates a new `ColorPt` object.

##### Declaration

    public ColorPt(double x, double y, double z)

##### Parameters

Type | Name | Description
--- | --- | ---
double | x | the x
double | y | the y
double | z | the z

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### ColorPt(double, double, double, double)

Instantiates a new `ColorPt` object.

##### Declaration

    public ColorPt(double x, double y, double z, double w)

##### Parameters

Type | Name | Description
--- | --- | ---
double | x | the x
double | y | the y
double | z | the z
double | w | the w

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

### Methods

#### Destroy()

##### Declaration

    public void Destroy()

#### Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

##### Declaration

    public void Dispose()

#### Dispose(bool)

##### Declaration

    protected virtual void Dispose(bool disposing)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | disposing |

#### ~ColorPt()

Releases all resources used by the ColorPt

##### Declaration

    protected ~ColorPt()

#### Get(int)

Gets the tint value at a given colorant index.

##### Declaration

    public double Get(int colorant_index)

##### Parameters

Type | Name | Description
--- | --- | ---
int | colorant_index | the colorant_index

##### Returns

Type | Description
--- | ---
double | the tint value at the specified colorant index.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Set(double)

Sets the first value x of the ColorPt.

##### Declaration

    public void Set(double x)

##### Parameters

Type | Name | Description
--- | --- | ---
double | x | the x

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Set(double, double)

Sets the first two values x and y of the ColorPt.

##### Declaration

    public void Set(double x, double y)

##### Parameters

Type | Name | Description
--- | --- | ---
double | x | the x
double | y | the y

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Set(double, double, double)

Sets the first three values x, y, and z of the ColorPt.

##### Declaration

    public void Set(double x, double y, double z)

##### Parameters

Type | Name | Description
--- | --- | ---
double | x | the x
double | y | the y
double | z | the z

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Set(double, double, double, double)

A utility method to set the first 4 tint values. For example, color.Set(red, green, blue) will initialize the ColorPt to given tint values.

##### Declaration

    public void Set(double x, double y, double z, double w)

##### Parameters

Type | Name | Description
--- | --- | ---
double | x | the x
double | y | the y
double | z | the z
double | w | the w

##### Remarks

All colorants should be in the range [0..1].

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Set(int, double)

Sets the colorant index and value.

##### Declaration

    public void Set(int colorant_index, double colorant_value)

##### Parameters

Type | Name | Description
--- | --- | ---
int | colorant_index | the colorant_index. For example, for a color point associated with a Gray color space the only allowed value for index is 0. For a color point associated with a CMYK color space, the color_index can range from 0 (cyan) to 4 (black).
double | colorant_value | the colorant_value The new tint value.

##### Remarks

If a color point has more than 4 colorants, SetColorantNum(num_colorants) must be called before getting or setting tint values.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Set(ColorPt)

Sets value to the given `ColorPt` object

##### Declaration

    public void Set(ColorPt p)

##### Parameters

Type | Name | Description
--- | --- | ---
ColorPt | p | given `ColorPt` object

#### SetColorantNum(int)

Sets the colorant number.

##### Declaration

    public void SetColorantNum(int num)

##### Parameters

Type | Name | Description
--- | --- | ---
int | num | the new colorant number

##### Remarks

If a color point has more than 4 colorants, SetColorantNum(num_colorants) must be called before getting or setting tint values. The number of colorants depends on the associated color space. To find how many colorant are associated with a given color space use color_space.GetComponentNum().

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### op_Assign(ColorPt)

Assignment operator

##### Declaration

    public ColorPt op_Assign(ColorPt r)

##### Parameters

Type | Name | Description
--- | --- | ---
ColorPt | r | object at the right of the operator

##### Returns

Type | Description
--- | ---
ColorPt | object equals to the given object

### Implements

IDisposable