new Style(fg, bg)
- Source:
Creates an instance of Style
Example
// creates a style
const { Effect, Parallax, Style } = require('lucid-dream');
const style = new Style([ new Effect('foo') ], [ new Parallax() ]);
Parameters:
Name | Type | Description |
---|---|---|
fg |
Array | An Array of foreground Apply, Effect, and Parallax instances. |
bg |
Array | An Array of background Apply, Effect, and Parallax instances. |
Methods
toDict() → {Object}
- Source:
Encode a style into a dictionary
Example
// returns encoded style dictionary
const { Effect, Parallax, Style } = require('lucid-dream');
const style = new Style([ new Effect('foo') ], [ new Parallax() ]);
style.toDict();
Returns:
An object containing the encoded style dicitonary
- Type
- Object