OPF
DocsObject referenceView source

Color Variable

A named color. Content color fields reference it as 'var:<id>'. Colors resolve at render time through the ordinary color-reference path, so a color variable keeps working as before.

Metadata

Definition
#/$defs/ColorVariable
Type
object
Source
spec/schemas/opf.schema.json

Field index

FieldTypeReq.Description
typeconstyesVariable kind. One of color, text, number, date, image, url or list.
valueref:HexColor—Hex color this variable resolves to.
requiredboolean—Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot: an unfilled optional variable resolves to empty text (inline…
labelstring—Optional short human label for forms and fill panels.
descriptionstring—Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents.
exampleref:HexColor—Illustrative color shown in fill forms and used when a template is previewed with examples. Never written to output.

type

typeconstrequiredyesdefault—

Variable kind. One of color, text, number, date, image, url or list.

type.json
{
  "type": "color"
}

value

typeref:HexColorrequirednodefault—

Hex color this variable resolves to.

value.json
{
  "value": "value-value"
}

required

typebooleanrequirednodefaulttrue

Whether the variable must be filled. Defaults to true: a variable with no 'value' is unfilled, and an unfilled required variable is an error in a normal deck and expected in a template. Set false for an optional slot: an unfilled optional variable resolves to empty text (inline…

required.json
{
  "required": true
}

label

typestringrequirednodefault—

Optional short human label for forms and fill panels.

label.json
{
  "label": "label-value"
}

description

typestringrequirednodefault—

Optional prose describing what the variable is for, surfaced by pickers, fill forms and agents.

description.json
{
  "description": "description-value"
}

example

typeref:HexColorrequirednodefault—

Illustrative color shown in fill forms and used when a template is previewed with examples. Never written to output.

example.json
{
  "example": "example-value"
}