Foxit PDF RDK

Public Member Functions | List of all members
Color Class Reference
Inheritance diagram for Color:

## Public Member Functions
| constructor ()
| Construct an empty color.
| constructor (color_space)
| Constructor, with a color space object. More...
| ConvertToCMYK (intent)
| Convert to a CMYK color. More...
| ConvertToRGB (intent)
| Convert to a RGB color. More...
| GetColorSpace ()
| Get the color space that current color belongs to. More...
| GetValue ()
| Get component value array. More...
| IsEmpty ()
| Check whether current object is empty or not. More...
| SetValue (component_array)
| Set component value array. More...
Public Member Functions inherited from NativeObjectWrapper
| constructor (r)
| GetPointerAsNumber ()

## Detailed Description

This class represents a color.

Examples
  /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.

## Member Function Documentation

## ◆ constructor()

Color.constructor | ( | color_space |  | ) |

Constructor, with a color space object.

Parameters

  [in] | color_space | A valid color space object.

## ◆ ConvertToCMYK()

Color.ConvertToCMYK | ( | intent |  | ) |

Convert to a CMYK color.

Parameters

  [in] | intent | (Reserved) Rendering intent used for color conversion.

Returns
  Converted color. If the return value of function Color.IsEmpty for the returned color is true, that means the conversion failed.

## ◆ ConvertToRGB()

Color.ConvertToRGB | ( | intent |  | ) |

Convert to a RGB color.

Parameters

  [in] | intent | (Reserved) Rendering intent used for color conversion.

Returns
  Converted color. If the return value of function Color.IsEmpty for the returned color is true, that means the conversion failed.

## ◆ GetColorSpace()

Color.GetColorSpace | ( |  | ) |

Get the color space that current color belongs to.

Returns
  Color space object.

## ◆ GetValue()

Color.GetValue | ( |  | ) |

Get component value array.

The count of components depends on the color space that current color belongs to. User can get the color space object by function Color.GetColorSpace, and then get the count of componets by function ColorSpace.GetComponentCount.

Returns
  A component value array. Each component value would be in the range from 0.0 to 1.0.

## ◆ IsEmpty()

Color.IsEmpty | ( |  | ) |

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
  true means current object is empty, while false means not.

## ◆ SetValue()

Color.SetValue | ( | component_array |  | ) |

Set component value array.

The count of components depends on the color space that current color belongs to. User can get the color space object by function Color.GetColorSpace, and then get the count of componets by function ColorSpace.GetComponentCount.

Parameters

  [in] | component_array | A component value array. The count of components in this array should match the count of components of the color space that current color belongs to. Valid range of each component value: from 0.0 to 1.0.

Returns
  None.