BPS Script API  2.24.4
bps::Color Class Reference

A wrapper for QColor. More...

Public Member Functions

 Color ()
 Default constructor.
 
 Color (Number aRed, Number aGreen, Number aBlue, Number aAlpha=255)
 Initializing constructor. More...
 
Number rgb () const
 
void setRgb (Number aRed, Number aGreen, Number aBlue, Number aAlpha=255)
 Set new RGBA values. More...
 
String toString () const
 

Properties

Number alpha
 The alpha transparency value in range 0...255. More...
 
Number blue
 The blue value in range 0...255. More...
 
Number green
 The green value in range 0...255. More...
 
Number red
 The red value in range 0...255. More...
 

Detailed Description

A wrapper for QColor.

Example use within a report:

// change simple text color
setion.item('myText').color = new bps.Color(50,100,150,128);
A wrapper for QColor.
Definition: bps.Color.js:13
The bps extension is a namespace assembling general BPS properties and functions.
Definition: bps.AsyncIO.js:1

Constructor & Destructor Documentation

◆ Color()

bps::Color::Color ( Number  aRed,
Number  aGreen,
Number  aBlue,
Number  aAlpha = 255 
)

Initializing constructor.

Parameters
aRedThe red value in range 0...255.
aGreenThe green value in range 0...255.
aBlueThe blue value in range 0...255.
aAlphaThe alpha transparency value in range 0...255.

Member Function Documentation

◆ rgb()

Number bps::Color::rgb ( ) const
Returns
A RGBA quadruplet on the format AARRGGBB, equivalent to an unsigned int.

◆ setRgb()

void bps::Color::setRgb ( Number  aRed,
Number  aGreen,
Number  aBlue,
Number  aAlpha = 255 
)

Set new RGBA values.

Parameters
aRedThe red value in range 0...255.
aGreenThe green value in range 0...255.
aBlueThe blue value in range 0...255.
aAlphaThe alpha transparency value in range 0...255.

◆ toString()

String bps::Color::toString ( ) const
Returns
Returns "Color(r,g,b,a)"

Property Documentation

◆ alpha

Number bps::Color::alpha
readwrite

The alpha transparency value in range 0...255.

 

◆ blue

Number bps::Color::blue
readwrite

The blue value in range 0...255.

 

◆ green

Number bps::Color::green
readwrite

The green value in range 0...255.

 

◆ red

Number bps::Color::red
readwrite

The red value in range 0...255.

 


The documentation for this class was generated from the following file: