// Generated by scripts/gen_themes.py from mermaid's theme-dark.js.
// Do not edit by hand.

///|
fn dark_init(t : Theme) -> Unit raise @color.ColorError {
  t.set("background", str("#333"))
  t.set("primaryColor", str("#1f2020"))
  t.set("secondaryColor", lighten(t.get("primaryColor"), num(16.0)))
  t.set("tertiaryColor", adjust(t.get("primaryColor"), h=num(-160.0)))
  t.set("primaryBorderColor", invert(t.get("background")))
  t.set(
    "secondaryBorderColor",
    mk_border(t.get("secondaryColor"), t.get("darkMode")),
  )
  t.set(
    "tertiaryBorderColor",
    mk_border(t.get("tertiaryColor"), t.get("darkMode")),
  )
  t.set("primaryTextColor", invert(t.get("primaryColor")))
  t.set("secondaryTextColor", invert(t.get("secondaryColor")))
  t.set("tertiaryTextColor", invert(t.get("tertiaryColor")))
  t.set("lineColor", invert(t.get("background")))
  t.set("textColor", invert(t.get("background")))
  t.set("mainBkg", str("#1f2020"))
  t.set("secondBkg", str("calculated"))
  t.set("mainContrastColor", str("lightgrey"))
  t.set("darkTextColor", lighten(invert(str("#323D47")), num(10.0)))
  t.set("lineColor", str("calculated"))
  t.set("border1", str("#ccc"))
  t.set("border2", rgba(num(255.0), num(255.0), num(255.0), num(0.25)))
  t.set("arrowheadColor", str("calculated"))
  t.set("fontFamily", str("\"trebuchet ms\", verdana, arial, sans-serif"))
  t.set("fontSize", str("16px"))
  t.set("labelBackground", str("#181818"))
  t.set("textColor", str("#ccc"))
  t.set("THEME_COLOR_LIMIT", num(12.0))
  t.set("radius", num(5.0))
  t.set("strokeWidth", num(1.0))
  t.set("nodeBkg", str("calculated"))
  t.set("nodeBorder", str("calculated"))
  t.set("clusterBkg", str("calculated"))
  t.set("clusterBorder", str("calculated"))
  t.set("defaultLinkColor", str("calculated"))
  t.set("titleColor", str("#F9FFFE"))
  t.set("edgeLabelBackground", str("calculated"))
  t.set("actorBorder", str("calculated"))
  t.set("actorBkg", str("calculated"))
  t.set("actorTextColor", str("calculated"))
  t.set("actorLineColor", str("calculated"))
  t.set("signalColor", str("calculated"))
  t.set("signalTextColor", str("calculated"))
  t.set("labelBoxBkgColor", str("calculated"))
  t.set("labelBoxBorderColor", str("calculated"))
  t.set("labelTextColor", str("calculated"))
  t.set("loopTextColor", str("calculated"))
  t.set("noteBorderColor", str("calculated"))
  t.set("noteBkgColor", str("#fff5ad"))
  t.set("noteTextColor", str("calculated"))
  t.set("activationBorderColor", str("calculated"))
  t.set("activationBkgColor", str("calculated"))
  t.set("sequenceNumberColor", str("black"))
  t.set("clusterBkg", str("#302F3D"))
  t.set("sectionBkgColor", darken(str("#EAE8D9"), num(30.0)))
  t.set("altSectionBkgColor", str("calculated"))
  t.set("sectionBkgColor2", str("#EAE8D9"))
  t.set("excludeBkgColor", darken(t.get("sectionBkgColor"), num(10.0)))
  t.set("taskBorderColor", rgba(num(255.0), num(255.0), num(255.0), num(70.0)))
  t.set("taskBkgColor", str("calculated"))
  t.set("taskTextColor", str("calculated"))
  t.set("taskTextLightColor", str("calculated"))
  t.set("taskTextOutsideColor", str("calculated"))
  t.set("taskTextClickableColor", str("#003163"))
  t.set(
    "activeTaskBorderColor",
    rgba(num(255.0), num(255.0), num(255.0), num(50.0)),
  )
  t.set("activeTaskBkgColor", str("#81B1DB"))
  t.set("gridColor", str("calculated"))
  t.set("doneTaskBkgColor", str("calculated"))
  t.set("doneTaskBorderColor", str("grey"))
  t.set("critBorderColor", str("#E83737"))
  t.set("critBkgColor", str("#E83737"))
  t.set("taskTextDarkColor", str("calculated"))
  t.set("todayLineColor", str("#DB5757"))
  t.set("vertLineColor", str("#00BFFF"))
  t.set("personBorder", t.get("primaryBorderColor"))
  t.set("personBkg", t.get("mainBkg"))
  t.set("archEdgeColor", str("calculated"))
  t.set("archEdgeArrowColor", str("calculated"))
  t.set("archEdgeWidth", str("3"))
  t.set("archGroupBorderColor", t.get("primaryBorderColor"))
  t.set("archGroupBorderWidth", str("2px"))
  t.set(
    "rowOdd",
    or_else(
      or_else(t.get("rowOdd"), () => lighten(t.get("mainBkg"), num(5.0))),
      () => str("#ffffff"),
    ),
  )
  t.set(
    "rowEven",
    or_else(t.get("rowEven"), () => darken(t.get("mainBkg"), num(10.0))),
  )
  t.set("labelColor", str("calculated"))
  t.set("errorBkgColor", str("#a44141"))
  t.set("errorTextColor", str("#ddd"))
  t.set("useGradient", boolean(true))
  t.set("gradientStart", t.get("primaryBorderColor"))
  t.set("gradientStop", t.get("secondaryBorderColor"))
  t.set("dropShadow", str("drop-shadow( 1px 2px 2px rgba(185,185,185,1))"))
  t.set("noteFontWeight", or_else(t.get("noteFontWeight"), () => str("normal")))
  t.set("fontWeight", or_else(t.get("fontWeight"), () => str("normal")))
}

///|
fn dark_update_colors(t : Theme) -> Unit raise @color.ColorError {
  t.set("secondBkg", lighten(t.get("mainBkg"), num(16.0)))
  t.set("lineColor", t.get("mainContrastColor"))
  t.set("arrowheadColor", t.get("mainContrastColor"))
  t.set("nodeBkg", t.get("mainBkg"))
  t.set("nodeBorder", t.get("border1"))
  t.set("clusterBkg", t.get("secondBkg"))
  t.set("clusterBorder", t.get("border2"))
  t.set("defaultLinkColor", t.get("lineColor"))
  t.set("edgeLabelBackground", lighten(t.get("labelBackground"), num(25.0)))
  t.set(
    "flowContainerStroke",
    or_else(t.get("flowContainerStroke"), () => t.get("secondaryBorderColor")),
  )
  t.set("actorBorder", t.get("border1"))
  t.set("actorBkg", t.get("mainBkg"))
  t.set("actorTextColor", t.get("mainContrastColor"))
  t.set("actorLineColor", t.get("actorBorder"))
  t.set("signalColor", t.get("mainContrastColor"))
  t.set("signalTextColor", t.get("mainContrastColor"))
  t.set("labelBoxBkgColor", t.get("actorBkg"))
  t.set("labelBoxBorderColor", t.get("actorBorder"))
  t.set("labelTextColor", t.get("mainContrastColor"))
  t.set("loopTextColor", t.get("mainContrastColor"))
  t.set("noteBorderColor", t.get("secondaryBorderColor"))
  t.set("noteBkgColor", t.get("secondBkg"))
  t.set("noteTextColor", t.get("secondaryTextColor"))
  t.set("activationBorderColor", t.get("border1"))
  t.set("activationBkgColor", t.get("secondBkg"))
  t.set(
    "rectBkgColor",
    or_else(t.get("rectBkgColor"), () => t.get("tertiaryColor")),
  )
  t.set("altSectionBkgColor", t.get("background"))
  t.set("taskBkgColor", lighten(t.get("mainBkg"), num(23.0)))
  t.set("taskTextColor", t.get("darkTextColor"))
  t.set("taskTextLightColor", t.get("mainContrastColor"))
  t.set("taskTextOutsideColor", t.get("taskTextLightColor"))
  t.set("gridColor", t.get("mainContrastColor"))
  t.set("doneTaskBkgColor", t.get("mainContrastColor"))
  t.set("taskTextDarkColor", invert(t.get("doneTaskBkgColor")))
  t.set("archEdgeColor", t.get("lineColor"))
  t.set("archEdgeArrowColor", t.get("lineColor"))
  t.set(
    "transitionColor",
    or_else(t.get("transitionColor"), () => t.get("lineColor")),
  )
  t.set(
    "transitionLabelColor",
    or_else(t.get("transitionLabelColor"), () => t.get("textColor")),
  )
  t.set(
    "stateLabelColor",
    or_else(or_else(t.get("stateLabelColor"), () => t.get("stateBkg")), () => {
      t.get("primaryTextColor")
    }),
  )
  t.set("stateBkg", or_else(t.get("stateBkg"), () => t.get("mainBkg")))
  t.set(
    "labelBackgroundColor",
    or_else(t.get("labelBackgroundColor"), () => t.get("stateBkg")),
  )
  t.set(
    "compositeBackground",
    or_else(or_else(t.get("compositeBackground"), () => t.get("background")), () => {
      t.get("tertiaryColor")
    }),
  )
  t.set("altBackground", or_else(t.get("altBackground"), () => str("#555")))
  t.set(
    "compositeTitleBackground",
    or_else(t.get("compositeTitleBackground"), () => t.get("mainBkg")),
  )
  t.set(
    "compositeBorder",
    or_else(t.get("compositeBorder"), () => t.get("nodeBorder")),
  )
  t.set("innerEndBackground", t.get("primaryBorderColor"))
  t.set("specialStateColor", str("#f4f4f4"))
  t.set(
    "errorBkgColor",
    or_else(t.get("errorBkgColor"), () => t.get("tertiaryColor")),
  )
  t.set(
    "errorTextColor",
    or_else(t.get("errorTextColor"), () => t.get("tertiaryTextColor")),
  )
  t.set("fillType0", t.get("primaryColor"))
  t.set("fillType1", t.get("secondaryColor"))
  t.set("fillType2", adjust(t.get("primaryColor"), h=num(64.0)))
  t.set("fillType3", adjust(t.get("secondaryColor"), h=num(64.0)))
  t.set("fillType4", adjust(t.get("primaryColor"), h=num(-64.0)))
  t.set("fillType5", adjust(t.get("secondaryColor"), h=num(-64.0)))
  t.set("fillType6", adjust(t.get("primaryColor"), h=num(128.0)))
  t.set("fillType7", adjust(t.get("secondaryColor"), h=num(128.0)))
  t.set("cScale1", or_else(t.get("cScale1"), () => str("#0b0000")))
  t.set("cScale2", or_else(t.get("cScale2"), () => str("#4d1037")))
  t.set("cScale3", or_else(t.get("cScale3"), () => str("#3f5258")))
  t.set("cScale4", or_else(t.get("cScale4"), () => str("#4f2f1b")))
  t.set("cScale5", or_else(t.get("cScale5"), () => str("#6e0a0a")))
  t.set("cScale6", or_else(t.get("cScale6"), () => str("#3b0048")))
  t.set("cScale7", or_else(t.get("cScale7"), () => str("#995a01")))
  t.set("cScale8", or_else(t.get("cScale8"), () => str("#154706")))
  t.set("cScale9", or_else(t.get("cScale9"), () => str("#161722")))
  t.set("cScale10", or_else(t.get("cScale10"), () => str("#00296f")))
  t.set("cScale11", or_else(t.get("cScale11"), () => str("#01629c")))
  t.set("cScale12", or_else(t.get("cScale12"), () => str("#010029")))
  t.set("cScale0", or_else(t.get("cScale0"), () => t.get("primaryColor")))
  t.set("cScale1", or_else(t.get("cScale1"), () => t.get("secondaryColor")))
  t.set("cScale2", or_else(t.get("cScale2"), () => t.get("tertiaryColor")))
  t.set(
    "cScale3",
    or_else(t.get("cScale3"), () => adjust(t.get("primaryColor"), h=num(30.0))),
  )
  t.set(
    "cScale4",
    or_else(t.get("cScale4"), () => adjust(t.get("primaryColor"), h=num(60.0))),
  )
  t.set(
    "cScale5",
    or_else(t.get("cScale5"), () => adjust(t.get("primaryColor"), h=num(90.0))),
  )
  t.set(
    "cScale6",
    or_else(t.get("cScale6"), () => adjust(t.get("primaryColor"), h=num(120.0))),
  )
  t.set(
    "cScale7",
    or_else(t.get("cScale7"), () => adjust(t.get("primaryColor"), h=num(150.0))),
  )
  t.set(
    "cScale8",
    or_else(t.get("cScale8"), () => adjust(t.get("primaryColor"), h=num(210.0))),
  )
  t.set(
    "cScale9",
    or_else(t.get("cScale9"), () => adjust(t.get("primaryColor"), h=num(270.0))),
  )
  t.set(
    "cScale10",
    or_else(t.get("cScale10"), () => adjust(t.get("primaryColor"), h=num(300.0))),
  )
  t.set(
    "cScale11",
    or_else(t.get("cScale11"), () => adjust(t.get("primaryColor"), h=num(330.0))),
  )
  for i_ in to_int(num(0.0)).. {
        invert(t.get(to_string(add(str("cScale"), i))))
      }),
    )
  }
  for i_ in to_int(num(0.0)).. {
        lighten(t.get(to_string(add(str("cScale"), i))), num(10.0))
      }),
    )
  }
  for i_ in to_int(num(0.0)).. {
        adjust(
          t.get("mainBkg"),
          h=num(30.0),
          s=num(-30.0),
          l=neg(add(num(-10.0), mul(i, num(4.0)))),
        )
      }),
    )
    t.set(
      to_string(add(str("surfacePeer"), i)),
      or_else(t.get(to_string(add(str("surfacePeer"), i))), () => {
        adjust(
          t.get("mainBkg"),
          h=num(30.0),
          s=num(-30.0),
          l=neg(add(num(-7.0), mul(i, num(4.0)))),
        )
      }),
    )
  }
  t.set(
    "scaleLabelColor",
    or_else(t.get("scaleLabelColor"), () => {
      if truthy(t.get("darkMode")) {
        str("black")
      } else {
        t.get("labelTextColor")
      }
    }),
  )
  for i_ in to_int(num(0.0)).. {
        t.get("scaleLabelColor")
      }),
    )
  }
  for i_ in to_int(num(0.0)).. str("25px")),
  )
  t.set(
    "pieTitleTextColor",
    or_else(t.get("pieTitleTextColor"), () => t.get("mainContrastColor")),
  )
  t.set(
    "pieSectionTextSize",
    or_else(t.get("pieSectionTextSize"), () => str("17px")),
  )
  t.set(
    "pieSectionTextColor",
    or_else(t.get("pieSectionTextColor"), () => t.get("textColor")),
  )
  t.set(
    "pieLegendTextSize",
    or_else(t.get("pieLegendTextSize"), () => str("17px")),
  )
  t.set(
    "pieLegendTextColor",
    or_else(t.get("pieLegendTextColor"), () => t.get("mainContrastColor")),
  )
  t.set("pieStrokeColor", or_else(t.get("pieStrokeColor"), () => str("black")))
  t.set("pieStrokeWidth", or_else(t.get("pieStrokeWidth"), () => str("2px")))
  t.set(
    "pieOuterStrokeWidth",
    or_else(t.get("pieOuterStrokeWidth"), () => str("2px")),
  )
  t.set(
    "pieOuterStrokeColor",
    or_else(t.get("pieOuterStrokeColor"), () => str("black")),
  )
  t.set("pieOpacity", or_else(t.get("pieOpacity"), () => str("0.7")))
  for i_ in to_int(num(0.0)).. {
        lighten(t.get(to_string(add(str("cScale"), i))), num(30.0))
      }),
    )
  }
  t.set(
    "vennTitleTextColor",
    nullish(t.get("vennTitleTextColor"), () => t.get("titleColor")),
  )
  t.set(
    "vennSetTextColor",
    nullish(t.get("vennSetTextColor"), () => t.get("textColor")),
  )
  t.set(
    "cynefin",
    Json::object({
      "domainFontSize": or_else(field(t.get("cynefin"), "domainFontSize"), () => {
        num(16.0)
      }),
      "itemFontSize": or_else(field(t.get("cynefin"), "itemFontSize"), () => {
        num(12.0)
      }),
      "boundaryColor": or_else(field(t.get("cynefin"), "boundaryColor"), () => {
        t.get("lineColor")
      }),
      "boundaryWidth": or_else(field(t.get("cynefin"), "boundaryWidth"), () => {
        num(2.0)
      }),
      "cliffColor": or_else(field(t.get("cynefin"), "cliffColor"), () => {
        str("#FF6B6B")
      }),
      "cliffWidth": or_else(field(t.get("cynefin"), "cliffWidth"), () => {
        num(4.0)
      }),
      "arrowColor": or_else(field(t.get("cynefin"), "arrowColor"), () => {
        t.get("lineColor")
      }),
      "arrowWidth": or_else(field(t.get("cynefin"), "arrowWidth"), () => {
        num(2.0)
      }),
      "complexBg": or_else(field(t.get("cynefin"), "complexBg"), () => {
        str("#1B5E20")
      }),
      "complicatedBg": or_else(field(t.get("cynefin"), "complicatedBg"), () => {
        str("#0D47A1")
      }),
      "chaoticBg": or_else(field(t.get("cynefin"), "chaoticBg"), () => {
        str("#BF360C")
      }),
      "clearBg": or_else(field(t.get("cynefin"), "clearBg"), () => {
        str("#F57F17")
      }),
      "confusionBg": or_else(field(t.get("cynefin"), "confusionBg"), () => {
        str("#4A148C")
      }),
      "textColor": or_else(field(t.get("cynefin"), "textColor"), () => {
        t.get("textColor")
      }),
      "labelColor": or_else(field(t.get("cynefin"), "labelColor"), () => {
        t.get("primaryTextColor")
      }),
    }),
  )
  t.set(
    "quadrant1Fill",
    or_else(t.get("quadrant1Fill"), () => t.get("primaryColor")),
  )
  t.set(
    "quadrant2Fill",
    or_else(t.get("quadrant2Fill"), () => {
      adjust(t.get("primaryColor"), r=num(5.0), g=num(5.0), b=num(5.0))
    }),
  )
  t.set(
    "quadrant3Fill",
    or_else(t.get("quadrant3Fill"), () => {
      adjust(t.get("primaryColor"), r=num(10.0), g=num(10.0), b=num(10.0))
    }),
  )
  t.set(
    "quadrant4Fill",
    or_else(t.get("quadrant4Fill"), () => {
      adjust(t.get("primaryColor"), r=num(15.0), g=num(15.0), b=num(15.0))
    }),
  )
  t.set(
    "quadrant1TextFill",
    or_else(t.get("quadrant1TextFill"), () => t.get("primaryTextColor")),
  )
  t.set(
    "quadrant2TextFill",
    or_else(t.get("quadrant2TextFill"), () => {
      adjust(t.get("primaryTextColor"), r=num(-5.0), g=num(-5.0), b=num(-5.0))
    }),
  )
  t.set(
    "quadrant3TextFill",
    or_else(t.get("quadrant3TextFill"), () => {
      adjust(
        t.get("primaryTextColor"),
        r=num(-10.0),
        g=num(-10.0),
        b=num(-10.0),
      )
    }),
  )
  t.set(
    "quadrant4TextFill",
    or_else(t.get("quadrant4TextFill"), () => {
      adjust(
        t.get("primaryTextColor"),
        r=num(-15.0),
        g=num(-15.0),
        b=num(-15.0),
      )
    }),
  )
  t.set(
    "quadrantPointFill",
    if truthy(
        or_else(t.get("quadrantPointFill"), () => {
          is_dark(t.get("quadrant1Fill"))
        }),
      ) {
      lighten(t.get("quadrant1Fill"), Json::null())
    } else {
      darken(t.get("quadrant1Fill"), Json::null())
    },
  )
  t.set(
    "quadrantPointTextFill",
    or_else(t.get("quadrantPointTextFill"), () => t.get("primaryTextColor")),
  )
  t.set(
    "quadrantXAxisTextFill",
    or_else(t.get("quadrantXAxisTextFill"), () => t.get("primaryTextColor")),
  )
  t.set(
    "quadrantYAxisTextFill",
    or_else(t.get("quadrantYAxisTextFill"), () => t.get("primaryTextColor")),
  )
  t.set(
    "quadrantInternalBorderStrokeFill",
    or_else(t.get("quadrantInternalBorderStrokeFill"), () => {
      t.get("primaryBorderColor")
    }),
  )
  t.set(
    "quadrantExternalBorderStrokeFill",
    or_else(t.get("quadrantExternalBorderStrokeFill"), () => {
      t.get("primaryBorderColor")
    }),
  )
  t.set(
    "quadrantTitleFill",
    or_else(t.get("quadrantTitleFill"), () => t.get("primaryTextColor")),
  )
  t.set(
    "xyChart",
    Json::object({
      "backgroundColor": or_else(field(t.get("xyChart"), "backgroundColor"), () => {
        t.get("background")
      }),
      "titleColor": or_else(field(t.get("xyChart"), "titleColor"), () => {
        t.get("primaryTextColor")
      }),
      "dataLabelColor": or_else(field(t.get("xyChart"), "dataLabelColor"), () => {
        t.get("primaryTextColor")
      }),
      "legendTextColor": or_else(field(t.get("xyChart"), "legendTextColor"), () => {
        t.get("primaryTextColor")
      }),
      "xAxisTitleColor": or_else(field(t.get("xyChart"), "xAxisTitleColor"), () => {
        t.get("primaryTextColor")
      }),
      "xAxisLabelColor": or_else(field(t.get("xyChart"), "xAxisLabelColor"), () => {
        t.get("primaryTextColor")
      }),
      "xAxisTickColor": or_else(field(t.get("xyChart"), "xAxisTickColor"), () => {
        t.get("primaryTextColor")
      }),
      "xAxisLineColor": or_else(field(t.get("xyChart"), "xAxisLineColor"), () => {
        t.get("primaryTextColor")
      }),
      "yAxisTitleColor": or_else(field(t.get("xyChart"), "yAxisTitleColor"), () => {
        t.get("primaryTextColor")
      }),
      "yAxisLabelColor": or_else(field(t.get("xyChart"), "yAxisLabelColor"), () => {
        t.get("primaryTextColor")
      }),
      "yAxisTickColor": or_else(field(t.get("xyChart"), "yAxisTickColor"), () => {
        t.get("primaryTextColor")
      }),
      "yAxisLineColor": or_else(field(t.get("xyChart"), "yAxisLineColor"), () => {
        t.get("primaryTextColor")
      }),
      "plotColorPalette": or_else(field(t.get("xyChart"), "plotColorPalette"), () => {
        str(
          "#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22",
        )
      }),
    }),
  )
  t.set(
    "packet",
    Json::object({
      "startByteColor": t.get("primaryTextColor"),
      "endByteColor": t.get("primaryTextColor"),
      "labelColor": t.get("primaryTextColor"),
      "titleColor": t.get("primaryTextColor"),
      "blockStrokeColor": t.get("primaryTextColor"),
      "blockFillColor": t.get("background"),
    }),
  )
  t.set(
    "radar",
    Json::object({
      "axisColor": or_else(field(t.get("radar"), "axisColor"), () => {
        t.get("lineColor")
      }),
      "axisStrokeWidth": or_else(field(t.get("radar"), "axisStrokeWidth"), () => {
        num(2.0)
      }),
      "axisLabelFontSize": or_else(field(t.get("radar"), "axisLabelFontSize"), () => {
        num(12.0)
      }),
      "curveOpacity": or_else(field(t.get("radar"), "curveOpacity"), () => {
        num(0.5)
      }),
      "curveStrokeWidth": or_else(field(t.get("radar"), "curveStrokeWidth"), () => {
        num(2.0)
      }),
      "graticuleColor": or_else(field(t.get("radar"), "graticuleColor"), () => {
        str("#DEDEDE")
      }),
      "graticuleStrokeWidth": or_else(
        field(t.get("radar"), "graticuleStrokeWidth"),
        () => num(1.0),
      ),
      "graticuleOpacity": or_else(field(t.get("radar"), "graticuleOpacity"), () => {
        num(0.3)
      }),
      "legendBoxSize": or_else(field(t.get("radar"), "legendBoxSize"), () => {
        num(12.0)
      }),
      "legendFontSize": or_else(field(t.get("radar"), "legendFontSize"), () => {
        num(12.0)
      }),
    }),
  )
  t.set(
    "wardleyEvolutionColor",
    or_else(t.get("wardleyEvolutionColor"), () => str("#ff6b6b")),
  )
  t.set(
    "wardley",
    Json::object({
      "backgroundColor": or_else(field(t.get("wardley"), "backgroundColor"), () => {
        t.get("background")
      }),
      "axisColor": or_else(field(t.get("wardley"), "axisColor"), () => {
        t.get("lineColor")
      }),
      "axisTextColor": or_else(field(t.get("wardley"), "axisTextColor"), () => {
        t.get("primaryTextColor")
      }),
      "gridColor": or_else(field(t.get("wardley"), "gridColor"), () => {
        t.get("gridColor")
      }),
      "componentFill": or_else(field(t.get("wardley"), "componentFill"), () => {
        t.get("mainBkg")
      }),
      "componentStroke": or_else(field(t.get("wardley"), "componentStroke"), () => {
        t.get("lineColor")
      }),
      "componentLabelColor": or_else(
        field(t.get("wardley"), "componentLabelColor"),
        () => t.get("primaryTextColor"),
      ),
      "linkStroke": or_else(field(t.get("wardley"), "linkStroke"), () => {
        t.get("lineColor")
      }),
      "evolutionStroke": or_else(field(t.get("wardley"), "evolutionStroke"), () => {
        t.get("wardleyEvolutionColor")
      }),
      "annotationStroke": or_else(field(t.get("wardley"), "annotationStroke"), () => {
        t.get("lineColor")
      }),
      "annotationTextColor": or_else(
        field(t.get("wardley"), "annotationTextColor"),
        () => t.get("primaryTextColor"),
      ),
      "annotationFill": or_else(field(t.get("wardley"), "annotationFill"), () => {
        t.get("mainBkg")
      }),
    }),
  )
  t.set("classText", t.get("primaryTextColor"))
  t.set(
    "requirementBackground",
    or_else(t.get("requirementBackground"), () => t.get("primaryColor")),
  )
  t.set(
    "requirementBorderColor",
    or_else(t.get("requirementBorderColor"), () => t.get("primaryBorderColor")),
  )
  t.set(
    "requirementBorderSize",
    or_else(t.get("requirementBorderSize"), () => str("1")),
  )
  t.set(
    "requirementTextColor",
    or_else(t.get("requirementTextColor"), () => t.get("primaryTextColor")),
  )
  t.set(
    "relationColor",
    or_else(t.get("relationColor"), () => t.get("lineColor")),
  )
  t.set(
    "relationLabelBackground",
    or_else(t.get("relationLabelBackground"), () => {
      if truthy(t.get("darkMode")) {
        darken(t.get("secondaryColor"), num(30.0))
      } else {
        t.get("secondaryColor")
      }
    }),
  )
  t.set(
    "relationLabelColor",
    or_else(t.get("relationLabelColor"), () => t.get("actorTextColor")),
  )
  t.set("git0", lighten(t.get("secondaryColor"), num(20.0)))
  t.set(
    "git1",
    lighten(or_else(t.get("pie2"), () => t.get("secondaryColor")), num(20.0)),
  )
  t.set(
    "git2",
    lighten(or_else(t.get("pie3"), () => t.get("tertiaryColor")), num(20.0)),
  )
  t.set(
    "git3",
    lighten(
      or_else(t.get("pie4"), () => adjust(t.get("primaryColor"), h=num(-30.0))),
      num(20.0),
    ),
  )
  t.set(
    "git4",
    lighten(
      or_else(t.get("pie5"), () => adjust(t.get("primaryColor"), h=num(-60.0))),
      num(20.0),
    ),
  )
  t.set(
    "git5",
    lighten(
      or_else(t.get("pie6"), () => adjust(t.get("primaryColor"), h=num(-90.0))),
      num(10.0),
    ),
  )
  t.set(
    "git6",
    lighten(
      or_else(t.get("pie7"), () => adjust(t.get("primaryColor"), h=num(60.0))),
      num(10.0),
    ),
  )
  t.set(
    "git7",
    lighten(
      or_else(t.get("pie8"), () => adjust(t.get("primaryColor"), h=num(120.0))),
      num(20.0),
    ),
  )
  t.set("gitInv0", or_else(t.get("gitInv0"), () => invert(t.get("git0"))))
  t.set("gitInv1", or_else(t.get("gitInv1"), () => invert(t.get("git1"))))
  t.set("gitInv2", or_else(t.get("gitInv2"), () => invert(t.get("git2"))))
  t.set("gitInv3", or_else(t.get("gitInv3"), () => invert(t.get("git3"))))
  t.set("gitInv4", or_else(t.get("gitInv4"), () => invert(t.get("git4"))))
  t.set("gitInv5", or_else(t.get("gitInv5"), () => invert(t.get("git5"))))
  t.set("gitInv6", or_else(t.get("gitInv6"), () => invert(t.get("git6"))))
  t.set("gitInv7", or_else(t.get("gitInv7"), () => invert(t.get("git7"))))
  t.set(
    "gitBranchLabel0",
    or_else(t.get("gitBranchLabel0"), () => invert(t.get("labelTextColor"))),
  )
  t.set(
    "gitBranchLabel1",
    or_else(t.get("gitBranchLabel1"), () => t.get("labelTextColor")),
  )
  t.set(
    "gitBranchLabel2",
    or_else(t.get("gitBranchLabel2"), () => t.get("labelTextColor")),
  )
  t.set(
    "gitBranchLabel3",
    or_else(t.get("gitBranchLabel3"), () => invert(t.get("labelTextColor"))),
  )
  t.set(
    "gitBranchLabel4",
    or_else(t.get("gitBranchLabel4"), () => t.get("labelTextColor")),
  )
  t.set(
    "gitBranchLabel5",
    or_else(t.get("gitBranchLabel5"), () => t.get("labelTextColor")),
  )
  t.set(
    "gitBranchLabel6",
    or_else(t.get("gitBranchLabel6"), () => t.get("labelTextColor")),
  )
  t.set(
    "gitBranchLabel7",
    or_else(t.get("gitBranchLabel7"), () => t.get("labelTextColor")),
  )
  t.set(
    "tagLabelColor",
    or_else(t.get("tagLabelColor"), () => t.get("primaryTextColor")),
  )
  t.set(
    "tagLabelBackground",
    or_else(t.get("tagLabelBackground"), () => t.get("primaryColor")),
  )
  t.set(
    "tagLabelBorder",
    or_else(t.get("tagBorder"), () => t.get("primaryBorderColor")),
  )
  t.set(
    "tagLabelFontSize",
    or_else(t.get("tagLabelFontSize"), () => str("10px")),
  )
  t.set(
    "commitLabelColor",
    or_else(t.get("commitLabelColor"), () => t.get("secondaryTextColor")),
  )
  t.set(
    "commitLabelBackground",
    or_else(t.get("commitLabelBackground"), () => t.get("secondaryColor")),
  )
  t.set(
    "commitLabelFontSize",
    or_else(t.get("commitLabelFontSize"), () => str("10px")),
  )
  t.set("emUiFill", or_else(t.get("emUiFill"), () => str("#2d2d2d")))
  t.set("emUiStroke", or_else(t.get("emUiStroke"), () => str("#555")))
  t.set(
    "emProcessorFill",
    or_else(t.get("emProcessorFill"), () => lighten(str("#5a3d5c"), num(10.0))),
  )
  t.set(
    "emProcessorStroke",
    or_else(t.get("emProcessorStroke"), () => str("#8a6d8c")),
  )
  t.set(
    "emReadModelFill",
    or_else(t.get("emReadModelFill"), () => lighten(str("#3d5a2d"), num(10.0))),
  )
  t.set(
    "emReadModelStroke",
    or_else(t.get("emReadModelStroke"), () => str("#6d8c5c")),
  )
  t.set(
    "emCommandFill",
    or_else(t.get("emCommandFill"), () => lighten(str("#2d3d5a"), num(10.0))),
  )
  t.set(
    "emCommandStroke",
    or_else(t.get("emCommandStroke"), () => str("#5c6d8c")),
  )
  t.set(
    "emEventFill",
    or_else(t.get("emEventFill"), () => lighten(str("#5a452d"), num(10.0))),
  )
  t.set("emEventStroke", or_else(t.get("emEventStroke"), () => str("#8c755c")))
  t.set(
    "emSwimlaneBackgroundOdd",
    or_else(t.get("emSwimlaneBackgroundOdd"), () => {
      lighten(t.get("background"), num(5.0))
    }),
  )
  t.set(
    "emSwimlaneBackgroundStroke",
    or_else(t.get("emSwimlaneBackgroundStroke"), () => {
      lighten(t.get("background"), num(12.0))
    }),
  )
  t.set("emArrowhead", or_else(t.get("emArrowhead"), () => t.get("lineColor")))
  t.set(
    "emRelationStroke",
    or_else(t.get("emRelationStroke"), () => t.get("lineColor")),
  )
  t.set(
    "attributeBackgroundColorOdd",
    or_else(t.get("attributeBackgroundColorOdd"), () => {
      lighten(t.get("background"), num(12.0))
    }),
  )
  t.set(
    "attributeBackgroundColorEven",
    or_else(t.get("attributeBackgroundColorEven"), () => {
      lighten(t.get("background"), num(2.0))
    }),
  )
  t.set("nodeBorder", or_else(t.get("nodeBorder"), () => str("#999")))
}