JSignage:SolidColor
From SpinetiX Support Wiki
.solidColor()
$.solidColor( color, opacity );
Returns: jSignage Object
Description
Creates a solidColor element that can be referenced later on in the fill or stroke attribute of geometric shapes or in the color for text, frame decoration or layer background. To use the color, specify a reference to it (obtained by .ref() function) as the attribute value for 'fill', 'stroke', 'backColor' or 'frameColor'.
Notes:
- Solid colors must be added to the document in ordered to be referenced. It does not matter where the solidColor element is added.
- The color and opacity of the solid color can be animated using respectively animateColor and animateOpacity.
Parameters
-
color
- Type: Color. Default: black.
-
opacity
- Type: Number. Default: 1.
- The opacity of the color. The accepted values are between 0.0 (fully transparent) and 1.0 (fully opaque).
Example
Text area background
// create a background color element and add it to the document
var bColor = $.solidColor( 'red', 0.5 ).addTo( 'svg' );
// create a text area and use the background color reference for its frame attribute
$.textArea( {
width: '90%', height: '15%', top: '75%', left: '5%', fontSize: 32,
frame: { backColor: bColor.ref() }
} ).text( 'Red background !' ).addTo( 'svg' );