Color.toStringDelAlpha

Syntax

toStringDelAplha()

Description

The toStringDelAlpha method returns the string with the color value, considering opacity, in the hexadecimal format with the grid value in the beginning.

Comments

The method returns value of the color visible by the user considering transparency.

Example

To execute the example, open any page with the connected PP.js. script. Create a new color and get its string value in the hexadecimal format:

// Create a new color
c1 = new PP.Color;
// Set color transparency
c1.setA(100);
c1.setR(200);
c1.setG(200);
c1.setB(150);
// Get color as an object in the console
console.debug(c1);
// Get standard string value
console.debug(c1.toString(true));
// Get string value considering transparency
console.debug(c1.toStringDelAlpha());

After executing the example three different views of one color are obtained.

As a JSON object:

PP.Color {_A: 100, _R: 200, _G: 200, _B: 150}

In the standard string value with separately recorded transparency:

"#64C8C896"

In the string value considering transparency:

"#E9E9D6"

See also:

Color