RadialGradientBrush.toCSSFormat

Syntax

toCSSFormat();

Description

The toCSSFormat method returns a string in the CSS format with settings of radial gradient fill brush.

Example

To execute the example, the HTML page must contain links to the jquery.js, PP.js scenario files, and the PP.css styles file. Create a div element and set background gradient fill for it:

// Create a div element
var divElem = PP.createElement(document.body);
// Set up styles for this element
divElem.style.cssText = "width: 200px; height: 100px; border: 1px solid rgb(102, 102, 102);";
// Create a radial gradient fill brush
var gradient = new PP.RadialGradientBrush({
    Center: new PP.Point(0.5, 0.5),
    GradientStops: {
        GradientStop: [{
            Offset: 0,
            Color: "#ff000000"
        }, {
            Offset: 1,
            Color: "#ffffffdd"
        }]
    }
});
// Set background fill for the div element
divElem.style.cssText += gradient.toCSSFormat();

After executing the example a div element is created in the document, for which radial gradient fill was applied:

RadialGradientBrush