OPF

Search docs

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

    Color Transform

    A ColorRef made lighter or darker, as PowerPoint's theme color tints and shades: 'lighten' moves the color's HSL luminance that share of the way to white (lumMod 1 - lighten, lumOff lighten), 'darken' that share of the way to black (lumMod 1 - darken). Exactly one of the two. PPTX export writes a:lumMod and a:lumOff on the base color, a scheme color where the base names one, so re-theming the deck keeps the tint.

    Metadata

    Definition
    #/$defs/ColorTransform
    Form
    2 alternative forms (oneOf)
    Source
    spec/schemas/opf.schema.json

    Field index

    FieldTypeReq.Description
    colorref:ColorRefyesThe base color: any ColorRef.
    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"
    lightennumber—Share of the way to white, 0 to 1. 0.4 is PowerPoint's "Lighter 40%".
    darkennumber—Share of the way to black, 0 to 1. 0.25 is PowerPoint's "Darker 25%".

    color

    typeref:ColorRefrequiredyesdefault—

    The base color: any ColorRef.

    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"

    lighten

    typenumberrequirednodefault—

    Share of the way to white, 0 to 1. 0.4 is PowerPoint's "Lighter 40%".

    darken

    typenumberrequirednodefault—

    Share of the way to black, 0 to 1. 0.25 is PowerPoint's "Darker 25%".

    oneOf 1 · object

    Exact constraints for oneOf 1
    oneOf 1 schema
    {
      "required": [
        "lighten"
      ]
    }

    oneOf 2 · object

    Exact constraints for oneOf 2
    oneOf 2 schema
    {
      "required": [
        "darken"
      ]
    }
    Complete definition constraints
    Schema constraints
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "color"
      ],
      "description": "A ColorRef made lighter or darker, as PowerPoint's theme color tints and shades: 'lighten' moves the color's HSL luminance that share of the way to white (lumMod 1 - lighten, lumOff lighten), 'darken' that share of the way to black (lumMod 1 - darken). Exactly one of the two. PPTX export writes a:lumMod and a:lumOff on the base color, a scheme color where the base names one, so re-theming the deck keeps the tint.",
      "properties": {
        "color": {
          "$ref": "#/$defs/ColorRef",
          "description": "The base color: any ColorRef."
        },
        "lighten": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Share of the way to white, 0 to 1. 0.4 is PowerPoint's \"Lighter 40%\"."
        },
        "darken": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Share of the way to black, 0 to 1. 0.25 is PowerPoint's \"Darker 25%\"."
        }
      },
      "oneOf": [
        {
          "required": [
            "lighten"
          ]
        },
        {
          "required": [
            "darken"
          ]
        }
      ],
      "examples": [
        {
          "color": "accent1",
          "lighten": 0.4
        },
        {
          "color": "#0F4C81",
          "darken": 0.25
        }
      ]
    }