Creating Widget Presets
You can optionally create user-selectable theme presets. Any setting available in the Hologram UI can be specified as a preset.
Presets are defined in the presets[]
array in your widget.config file.
"presets": [
{
"label": "Auto",
"name": "auto",
"resetOtherSettings": true,
"settings": {
"backgroundColor": "muted",
"borderColor": "vibrant",
"textColor": "lightvibrant",
"shadowColor": "darkmuted"
}
},
{
"label": "Black & White",
"name": "blackWhite",
"resetOtherSettings": true,
"settings": {
"backgroundColor": "#000000",
"borderColor": "#666666",
"textColor": "#ffffff",
"shadowColor": "00000033"
}
}
]
Notes: The "resetOtherSettings" boolean instructs Hologram whether or not to reset other settings, such as shadow, etc. when selecting that preset.
Default Preset
If you want a particular preset to be called when the widget is loaded you can add the defaultPreset
object to the root of the widget.json
file:
{
"name": "My Widget",
"id": "my-widget",
"author": "Your Name",
"version": "1.0.0",
"description": "",
"aspectRatio": "auto-height",
"defaultPreset": "presetName",
etc....