OPF

Search docs

Loading documentation…
    OpenPresentation/opf
    Browse docs
    On this page
    View source

    Line

    A plain line: its color, width and dash, or 'none' for no line. Shared by table cell borders and chart reference lines. A shape's outline is a Stroke, which adds what only an outline has (gradient, caps, joins, compound lines, arrowheads, sketch). Every part is optional and falls back to the default of the place the line is used.

    Metadata

    Definition
    #/$defs/Line
    Form
    2 inclusive forms (anyOf)
    Source
    spec/schemas/opf.schema.json

    Field index

    This definition uses the forms or value constraints below.

    anyOf 1 · const

    No line.

    Exact constraints for anyOf 1
    anyOf 1 schema
    {
      "const": "none",
      "description": "No line."
    }

    anyOf 2 · object

    FieldTypeReq.DefaultDescription
    colorref:ColorRef——Line color: any ColorRef (eight-digit hex keeps its alpha).
    color · Named choices (see schema for other values and constraints)
    "accent1""accent2""accent3""accent4""accent5""accent6""dark1""dark2""light1""light2""hyperlink""followedHyperlink""primary""secondary""accent""background""surface""surfaceAlt""text""textSecondary"
    widthnumber——Line width in reference pixels at a 720-pixel short edge. 0 draws no line, the same as 'none'.
    dashenum——Dash pattern, by the names Stroke.dash uses.
    dash · Allowed values
    "solid""dash""dot"

    color

    typeref:ColorRefrequirednodefault—

    Line color: any ColorRef (eight-digit hex keeps its alpha).

    Named choices are not exhaustive. See the schema for other values and constraints.
    color, color (anyOf 4).color · Named choices
    "accent1", "accent2", "accent3", "accent4", "accent5", "accent6", "dark1", "dark2", "light1", "light2", "hyperlink", "followedHyperlink", "primary", "secondary", "accent", "background", "surface", "surfaceAlt", "text", "textSecondary"

    width

    typenumberrequirednodefault—

    Line width in reference pixels at a 720-pixel short edge. 0 draws no line, the same as 'none'.

    dash

    typeenumrequirednodefault—

    Dash pattern, by the names Stroke.dash uses.

    dash · Allowed values
    "solid""dash""dot"
    dash.json
    {
      "dash": "solid"
    }
    Exact constraints for anyOf 2
    anyOf 2 schema
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "color": {
          "$ref": "#/$defs/ColorRef",
          "description": "Line color: any ColorRef (eight-digit hex keeps its alpha)."
        },
        "width": {
          "type": "number",
          "minimum": 0,
          "maximum": 64,
          "description": "Line width in reference pixels at a 720-pixel short edge. 0 draws no line, the same as 'none'."
        },
        "dash": {
          "type": "string",
          "enum": [
            "solid",
            "dash",
            "dot"
          ],
          "description": "Dash pattern, by the names Stroke.dash uses."
        }
      }
    }
    Complete definition constraints
    Schema constraints
    {
      "description": "A plain line: its color, width and dash, or 'none' for no line. Shared by table cell borders and chart reference lines. A shape's outline is a Stroke, which adds what only an outline has (gradient, caps, joins, compound lines, arrowheads, sketch). Every part is optional and falls back to the default of the place the line is used.",
      "anyOf": [
        {
          "const": "none",
          "description": "No line."
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "color": {
              "$ref": "#/$defs/ColorRef",
              "description": "Line color: any ColorRef (eight-digit hex keeps its alpha)."
            },
            "width": {
              "type": "number",
              "minimum": 0,
              "maximum": 64,
              "description": "Line width in reference pixels at a 720-pixel short edge. 0 draws no line, the same as 'none'."
            },
            "dash": {
              "type": "string",
              "enum": [
                "solid",
                "dash",
                "dot"
              ],
              "description": "Dash pattern, by the names Stroke.dash uses."
            }
          }
        }
      ],
      "examples": [
        "none",
        {
          "width": 2
        },
        {
          "color": "accent2",
          "width": 2,
          "dash": "dash"
        }
      ]
    }
    value · Named choices (see schema for other values and constraints)
    "none"