background([background])
Class: Shape.
Description:
Sets or gets the background of the shape.
The background value can be a string that contains a mixture of background color, image path (relative or absolute), base64 encoded image string, linear-gradient, radial-gradient, like in CSS in web browsers. Some features may not be supported though.
Background settings like position, image stretching or repeating, opacity and more are supported.
See examples below.
Parameters:
| Name | Type | Description |
|---|---|---|
|
|
string |
Background string. If omitted, returns the current value. |
Returns:
If called without parameters, returns this shape instance; otherwise returns current background.
Type: this | string
Examples:
shape.background("#FF000055 url(images/bg.png) center no-repeat opacity=0.6 10px 15px linear-gradient(#DDDDDD55, #F8F8F855 10%) / auto);
panel.background("url(data:image/png;base64,As8fE4fdt1r.....)")); // supports base64 encoded image string
