iText 8.0.5 API
iText.Kernel.Colors.Color Class Reference

Represents a color More...

Inheritance diagram for iText.Kernel.Colors.Color:
iText.Kernel.Colors.CalGray iText.Kernel.Colors.CalRgb iText.Kernel.Colors.DeviceCmyk iText.Kernel.Colors.DeviceGray iText.Kernel.Colors.DeviceN iText.Kernel.Colors.DeviceRgb iText.Kernel.Colors.IccBased iText.Kernel.Colors.Indexed iText.Kernel.Colors.Lab iText.Kernel.Colors.PatternColor iText.Kernel.Colors.Separation

Public Member Functions

virtual int  GetNumberOfComponents ()
  Returns the number of color value components More...
 
virtual PdfColorSpace  GetColorSpace ()
  Returns the color space to which the color is related. More...
 
virtual float[]  GetColorValue ()
  Returns the color value of the color More...
 
virtual void  SetColorValue (float[] value)
  Sets the color value of the color More...
 
override int  GetHashCode ()
 
override bool  Equals (Object o)
  Indicates whether the color is equal to the given color. More...
 

Static Public Member Functions

static iText.Kernel.Colors.Color  MakeColor (PdfColorSpace colorSpace)
  Makes a Color of certain color space. More...
 
static iText.Kernel.Colors.Color  MakeColor (PdfColorSpace colorSpace, float[] colorValue)
  Makes a Color of certain color space and color value. More...
 
static DeviceRgb  ConvertCmykToRgb (DeviceCmyk cmykColor)
  Converts DeviceCmyk color to DeviceRgb color More...
 
static DeviceCmyk  ConvertRgbToCmyk (DeviceRgb rgbColor)
  Converts DeviceRgb color to DeviceCmyk color More...
 
static iText.Kernel.Colors.Color  CreateColorWithColorSpace (float[] colorValue)
  Creates a color object based on the passed through values. More...
 

Package Functions

  Color (PdfColorSpace colorSpace, float[] colorValue)
  Creates a Color of certain color space and color value. More...
 

Package Attributes

PdfColorSpace  colorSpace
  The color space of the color More...
 
float[]  colorValue
  The color value of the color More...
 

Detailed Description

Represents a color

Constructor & Destructor Documentation

◆ Color()

iText.Kernel.Colors.Color.Color ( PdfColorSpace  colorSpace,
float[]  colorValue 
)
inlinepackage

Creates a Color of certain color space and color value.

Creates a Color of certain color space and color value. If color value is set in null, all value components will be initialised with zeroes.

Parameters
colorSpace the color space to which the created Color object relates
colorValue the color value of the created Color object

Member Function Documentation

◆ ConvertCmykToRgb()

static DeviceRgb iText.Kernel.Colors.Color.ConvertCmykToRgb ( DeviceCmyk  cmykColor )
inlinestatic

Converts DeviceCmyk color to DeviceRgb color

Parameters
cmykColor the DeviceCmyk color which will be converted to DeviceRgb color
Returns
converted color

◆ ConvertRgbToCmyk()

static DeviceCmyk iText.Kernel.Colors.Color.ConvertRgbToCmyk ( DeviceRgb  rgbColor )
inlinestatic

Converts DeviceRgb color to DeviceCmyk color

Parameters
rgbColor the DeviceRgb color which will be converted to DeviceCmyk color
Returns
converted color

◆ CreateColorWithColorSpace()

static iText.Kernel.Colors.Color iText.Kernel.Colors.Color.CreateColorWithColorSpace ( float[]  colorValue )
inlinestatic

Creates a color object based on the passed through values.

Creates a color object based on the passed through values.

Parameters
colorValue the float array with the values

The number of array elements determines the colour space in which the colour shall be defined: 0 - No colour; transparent 1 - DeviceGray 3 - DeviceRGB 4 - DeviceCMYK

Returns
Color the color or null if it's invalid

◆ Equals()

override bool iText.Kernel.Colors.Color.Equals ( Object  o )
inline

Indicates whether the color is equal to the given color.

Indicates whether the color is equal to the given color. The color space and color value are considered during the comparison.

◆ GetColorSpace()

virtual PdfColorSpace iText.Kernel.Colors.Color.GetColorSpace ( )
inlinevirtual

Returns the color space to which the color is related.

Returns
the color space of the color

◆ GetColorValue()

virtual float [] iText.Kernel.Colors.Color.GetColorValue ( )
inlinevirtual

Returns the color value of the color

Returns
the color value

◆ GetHashCode()

override int iText.Kernel.Colors.Color.GetHashCode ( )
inline

◆ GetNumberOfComponents()

virtual int iText.Kernel.Colors.Color.GetNumberOfComponents ( )
inlinevirtual

Returns the number of color value components

Returns
the number of color value components

◆ MakeColor() [1/2]

static iText.Kernel.Colors.Color iText.Kernel.Colors.Color.MakeColor ( PdfColorSpace  colorSpace )
inlinestatic

Makes a Color of certain color space.

Makes a Color of certain color space. All color value components will be initialised with zeroes.

Parameters
colorSpace the color space to which the returned Color object relates
Returns
the created Color object.

◆ MakeColor() [2/2]

static iText.Kernel.Colors.Color iText.Kernel.Colors.Color.MakeColor ( PdfColorSpace  colorSpace,
float[]  colorValue 
)
inlinestatic

Makes a Color of certain color space and color value.

Makes a Color of certain color space and color value. If color value is set in null, all value components will be initialised with zeroes.

Parameters
colorSpace the color space to which the returned Color object relates
colorValue the color value of the returned Color object
Returns
the created Color object.

◆ SetColorValue()

virtual void iText.Kernel.Colors.Color.SetColorValue ( float[]  value )
inlinevirtual

Sets the color value of the color

Parameters
value new color value

Reimplemented in iText.Kernel.Colors.PatternColor.

Member Data Documentation

◆ colorSpace

PdfColorSpace iText.Kernel.Colors.Color.colorSpace
package

The color space of the color

◆ colorValue

float [] iText.Kernel.Colors.Color.colorValue
package

The color value of the color