SolidColorBrush.toCSSFormat

Syntax

toCSSFormat();

Description

The toCSSFormat method returns the string in the CSS format with settings of solid 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 solid 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 solid fill brush
var brush = new PP.SolidColorBrush({   
    Color: "Yellow",
    Opacity: 0.2        
});
// Set background fill for the div element
divElem.style.cssText += brush.toCSSFormat();

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

SolidColorBrush