Foxit PDF SDK
 All Classes Namespaces Functions Enumerations Enumerator Properties Pages
foxit.common.Color Class Reference
Inheritance diagram for foxit.common.Color:
foxit.common.Base

Public Member Functions

 Color ()
 Construct an empty color.
 
 Color (ColorSpace color_space)
 Constructor, with a color space object. More...
 
 Color (Color other)
 Constructor, with another color object. More...
 
Color ConvertToCMYK (ColorSpace.RenderingIntent intent)
 Convert to a CMYK color. More...
 
Color ConvertToRGB (ColorSpace.RenderingIntent intent)
 Convert to a RGB color. More...
 
ColorSpace GetColorSpace ()
 Get the color space that current color belongs to. More...
 
FloatArray GetValue ()
 Get component value array. More...
 
bool IsEmpty ()
 Check whether current object is empty or not. More...
 
void SetValue (FloatArray component_array)
 Set component value array. More...
 

Detailed Description

This class represents a color.

Constructor & Destructor Documentation

foxit.common.Color.Color ( ColorSpace  color_space)
inline

Constructor, with a color space object.

Parameters
[in]color_spaceA valid color space object.
foxit.common.Color.Color ( Color  other)
inline

Constructor, with another color object.

Parameters
[in]otherAnother Color object.

Member Function Documentation

Color foxit.common.Color.ConvertToCMYK ( ColorSpace.RenderingIntent  intent)
inline

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.
Color foxit.common.Color.ConvertToRGB ( ColorSpace.RenderingIntent  intent)
inline

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.
ColorSpace foxit.common.Color.GetColorSpace ( )
inline

Get the color space that current color belongs to.

Returns
Color space object.
FloatArray foxit.common.Color.GetValue ( )
inline

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.
bool foxit.common.Color.IsEmpty ( )
inline

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.
void foxit.common.Color.SetValue ( FloatArray  component_array)
inline

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_arrayA 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.