FoxitPDFSDKforWeb v10.0.0
Foxit PDF SDK for Web
Color Class Reference

Class for processing color-related algorithms such as conversions. More...

Public Member Functions

 asArray ()
 Convert this Color instance into an array with four channel values R,G,B,A. More...
 
 clone ()
 Clones an identical object. More...
 
 isSameAs (other:Color)
 Check if this color is the same as another color instance. More...
 
 toCMYK ()
 Convert R,G,B values to CMYK representation model. More...
 
 toHSL ()
 Convert R,G,B values to HSL representation model. More...
 
 toHSV ()
 Convert into HSV representation model. More...
 

Static Public Member Functions

static fromARGB (argb:number)
 Create Color instance from ARGB values (such as: 0xFFFFFF). More...
 
static fromHSLA (h:number, s:number, l:number, a:number)
 Create Color instance using HSL representation model. More...
 
static fromRGB (rgb:number)
 Create Color instance from RGB values (such as: 0xFFFFFF). More...
 
static fromRGBA (rgb:number, a:number)
 Create Color instance from RGB values (such as: 0xFFFFFF) and separately specified alpha values. More...
 

Detailed Description

Class for processing color-related algorithms such as conversions.

Since
9.0.0

Member Function Documentation

◆ asArray()

Color::asArray ( )
inline

Convert this Color instance into an array with four channel values R,G,B,A.

Returns
[number,number,number,number] - An array includes the R, G, B, A channels
Since
9.0.0

◆ clone()

Color::clone ( )
inline

Clones an identical object.

Returns
Color -
Since
9.0.0

◆ fromARGB()

static Color::fromARGB (   argb:number)
inlinestatic

Create Color instance from ARGB values (such as: 0xFFFFFF).

Parameters
argbnumber - ARGB values, pattern: 0xAARRGGBB.
Returns
Color -
Since
9.0.0

◆ fromHSLA()

static Color::fromHSLA (   h:number,
  s:number,
  l:number,
  a:number 
)
inlinestatic

Create Color instance using HSL representation model.

Parameters
hnumber - The hue channel, the value is between 0 and 360 (inclusive).
snumber - The saturation channel, the value is between 0 and 100 (inclusive).
lnumber - The lightness channel, the value is between 0 and 100 (inclusive).
anumber - The alpha channel, the value is between 0 and 255 (inclusive).
Returns
Color -
Since
9.0.0

◆ fromRGB()

static Color::fromRGB (   rgb:number)
inlinestatic

Create Color instance from RGB values (such as: 0xFFFFFF).

Parameters
rgbnumber - RGB values, pattern: 0xRRGGBB.
Returns
Color -
Since
9.0.0

◆ fromRGBA()

static Color::fromRGBA (   rgb:number,
  a:number 
)
inlinestatic

Create Color instance from RGB values (such as: 0xFFFFFF) and separately specified alpha values.

Parameters
rgbnumber - RGB values, pattern: 0xRRGGBB.
anumber - The alpha channel, the value is between 0 and 255 (inclusive).
Returns
Color

◆ isSameAs()

Color::isSameAs (   other:Color)
inline

Check if this color is the same as another color instance.

Parameters
otherColor - Another Color instance to detected.
Returns
boolean - true if the same, false otherwise
Since
9.0.0

◆ toCMYK()

Color::toCMYK ( )
inline

Convert R,G,B values to CMYK representation model.

Returns
{c:number;m:number;y:number;k:number} - An object with four channel values of C, M, Y, K.
Since
9.0.0

◆ toHSL()

Color::toHSL ( )
inline

Convert R,G,B values to HSL representation model.

Returns
{h:number;s:number;l:number} - An object with three channel values of H, S, L.
Since
9.0.0

◆ toHSV()

Color::toHSV ( )
inline

Convert into HSV representation model.

Returns
{h:number;s:number;v:number} -
Since
9.0.0

Foxit Software Corporation Logo
@2024 Foxit Software Incorporated. All rights reserved.