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

///|
fn default_init(t : Theme) -> Unit raise @color.ColorError {
  t.set("background", str("#f4f4f4"))
  t.set("primaryColor", str("#ECECFF"))
  t.set("secondaryColor", adjust(t.get("primaryColor"), h=num(120.0)))
  t.set("secondaryColor", str("#ffffde"))
  t.set("tertiaryColor", adjust(t.get("primaryColor"), h=num(-160.0)))
  t.set(
    "primaryBorderColor",
    mk_border(t.get("primaryColor"), t.get("darkMode")),
  )
  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("background", str("white"))
  t.set("mainBkg", str("#ECECFF"))
  t.set("secondBkg", str("#ffffde"))
  t.set("lineColor", str("#333333"))
  t.set("border1", str("#9370DB"))
  t.set(
    "primaryBorderColor",
    mk_border(t.get("primaryColor"), t.get("darkMode")),
  )
  t.set("border2", str("#aaaa33"))
  t.set("arrowheadColor", str("#333333"))
  t.set("fontFamily", str("\"trebuchet ms\", verdana, arial, sans-serif"))
  t.set("fontSize", str("16px"))
  t.set("labelBackground", str("rgba(232,232,232, 0.8)"))
  t.set("textColor", str("#333"))
  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("calculated"))
  t.set("edgeLabelBackground", str("calculated"))
  t.set("actorBorder", str("calculated"))
  t.set("actorBkg", str("calculated"))
  t.set("actorTextColor", str("black"))
  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("#666"))
  t.set("activationBkgColor", str("#f4f4f4"))
  t.set("sequenceNumberColor", str("white"))
  t.set("clusterBkg", str("#FBFBFF"))
  t.set("sectionBkgColor", str("calculated"))
  t.set("altSectionBkgColor", str("calculated"))
  t.set("sectionBkgColor2", str("calculated"))
  t.set("excludeBkgColor", str("#eeeeee"))
  t.set("taskBorderColor", str("calculated"))
  t.set("taskBkgColor", str("calculated"))
  t.set("taskTextLightColor", str("calculated"))
  t.set("taskTextColor", t.get("taskTextLightColor"))
  t.set("taskTextDarkColor", str("calculated"))
  t.set("taskTextOutsideColor", t.get("taskTextDarkColor"))
  t.set("taskTextClickableColor", str("calculated"))
  t.set("activeTaskBorderColor", str("calculated"))
  t.set("activeTaskBkgColor", str("calculated"))
  t.set("gridColor", str("calculated"))
  t.set("doneTaskBkgColor", str("calculated"))
  t.set("doneTaskBorderColor", str("calculated"))
  t.set("critBorderColor", str("calculated"))
  t.set("critBkgColor", str("calculated"))
  t.set("todayLineColor", str("calculated"))
  t.set("vertLineColor", str("calculated"))
  t.set("sectionBkgColor", rgba(num(102.0), num(102.0), num(255.0), num(0.49)))
  t.set("altSectionBkgColor", str("white"))
  t.set("sectionBkgColor2", str("#fff400"))
  t.set("taskBorderColor", str("#534fbc"))
  t.set("taskBkgColor", str("#8a90dd"))
  t.set("taskTextLightColor", str("white"))
  t.set("taskTextColor", str("calculated"))
  t.set("taskTextDarkColor", str("black"))
  t.set("taskTextOutsideColor", str("calculated"))
  t.set("taskTextClickableColor", str("#003163"))
  t.set("activeTaskBorderColor", str("#534fbc"))
  t.set("activeTaskBkgColor", str("#bfc7ff"))
  t.set("gridColor", str("lightgrey"))
  t.set("doneTaskBkgColor", str("lightgrey"))
  t.set("doneTaskBorderColor", str("grey"))
  t.set("critBorderColor", str("#ff8888"))
  t.set("critBkgColor", str("red"))
  t.set("todayLineColor", str("red"))
  t.set("vertLineColor", str("navy"))
  t.set("noteFontWeight", or_else(t.get("noteFontWeight"), () => str("normal")))
  t.set("fontWeight", or_else(t.get("fontWeight"), () => str("normal")))
  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", str("calculated"))
  t.set("rowEven", str("calculated"))
  t.set("labelColor", str("black"))
  t.set("errorBkgColor", str("#552222"))
  t.set("errorTextColor", str("#552222"))
  t.set("useGradient", boolean(false))
  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))"))
  default_update_colors(t)
}

///|
fn default_update_colors(t : Theme) -> Unit raise @color.ColorError {
  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))),
  )
  t.set(
    to_string(add(str("cScalePeer"), num(1.0))),
    or_else(t.get(to_string(add(str("cScalePeer"), num(1.0)))), () => {
      darken(t.get("secondaryColor"), num(45.0))
    }),
  )
  t.set(
    to_string(add(str("cScalePeer"), num(2.0))),
    or_else(t.get(to_string(add(str("cScalePeer"), num(2.0)))), () => {
      darken(t.get("tertiaryColor"), num(40.0))
    }),
  )
  for i_ in to_int(num(0.0)).. {
        darken(t.get(to_string(add(str("cScale"), i))), num(25.0))
      }),
    )
  }
  for i_ in to_int(num(0.0)).. {
        adjust(t.get(to_string(add(str("cScale"), i))), h=num(180.0))
      }),
    )
  }
  for i_ in to_int(num(0.0)).. {
        adjust(
          t.get("mainBkg"),
          h=num(30.0),
          l=neg(add(num(5.0), mul(i, num(5.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),
          l=neg(add(num(7.0), mul(i, num(5.0)))),
        )
      }),
    )
  }
  t.set(
    "scaleLabelColor",
    if truthy(
        and_then(boolean(t.get("scaleLabelColor") != str("calculated")), () => {
          t.get("scaleLabelColor")
        }),
      ) {
      t.get("scaleLabelColor")
    } else {
      t.get("labelTextColor")
    },
  )
  if truthy(boolean(t.get("labelTextColor") != str("calculated"))) {
    t.set(
      "cScaleLabel0",
      or_else(t.get("cScaleLabel0"), () => invert(t.get("labelTextColor"))),
    )
    t.set(
      "cScaleLabel3",
      or_else(t.get("cScaleLabel3"), () => invert(t.get("labelTextColor"))),
    )
    for i_ in to_int(num(0.0)).. {
          t.get("labelTextColor")
        }),
      )
    }
  }
  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("titleColor", t.get("textColor"))
  t.set("edgeLabelBackground", t.get("labelBackground"))
  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("labelBoxBkgColor", t.get("actorBkg"))
  t.set("signalColor", t.get("textColor"))
  t.set("signalTextColor", t.get("textColor"))
  t.set("labelBoxBorderColor", t.get("actorBorder"))
  t.set("labelTextColor", t.get("actorTextColor"))
  t.set("loopTextColor", t.get("actorTextColor"))
  t.set("noteBorderColor", t.get("border2"))
  t.set("noteTextColor", t.get("actorTextColor"))
  t.set("actorLineColor", t.get("actorBorder"))
  t.set(
    "rectBkgColor",
    or_else(t.get("rectBkgColor"), () => t.get("tertiaryColor")),
  )
  t.set("taskTextColor", t.get("taskTextLightColor"))
  t.set("taskTextOutsideColor", t.get("taskTextDarkColor"))
  t.set("archEdgeColor", t.get("lineColor"))
  t.set("archEdgeArrowColor", t.get("lineColor"))
  t.set(
    "rowOdd",
    or_else(
      or_else(t.get("rowOdd"), () => lighten(t.get("primaryColor"), num(75.0))),
      () => str("#ffffff"),
    ),
  )
  t.set(
    "rowEven",
    or_else(t.get("rowEven"), () => lighten(t.get("primaryColor"), num(1.0))),
  )
  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("#f0f0f0")))
  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("nodeBorder"))
  t.set("specialStateColor", t.get("lineColor"))
  t.set(
    "errorBkgColor",
    or_else(t.get("errorBkgColor"), () => t.get("tertiaryColor")),
  )
  t.set(
    "errorTextColor",
    or_else(t.get("errorTextColor"), () => t.get("tertiaryTextColor")),
  )
  t.set(
    "transitionColor",
    or_else(t.get("transitionColor"), () => t.get("lineColor")),
  )
  t.set("classText", t.get("primaryTextColor"))
  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("pie1", or_else(t.get("pie1"), () => t.get("primaryColor")))
  t.set("pie2", or_else(t.get("pie2"), () => t.get("secondaryColor")))
  t.set(
    "pie3",
    or_else(t.get("pie3"), () => adjust(t.get("tertiaryColor"), l=num(-40.0))),
  )
  t.set(
    "pie4",
    or_else(t.get("pie4"), () => adjust(t.get("primaryColor"), l=num(-10.0))),
  )
  t.set(
    "pie5",
    or_else(t.get("pie5"), () => adjust(t.get("secondaryColor"), l=num(-30.0))),
  )
  t.set(
    "pie6",
    or_else(t.get("pie6"), () => adjust(t.get("tertiaryColor"), l=num(-20.0))),
  )
  t.set(
    "pie7",
    or_else(t.get("pie7"), () => {
      adjust(t.get("primaryColor"), h=num(60.0), l=num(-20.0))
    }),
  )
  t.set(
    "pie8",
    or_else(t.get("pie8"), () => {
      adjust(t.get("primaryColor"), h=num(-60.0), l=num(-40.0))
    }),
  )
  t.set(
    "pie9",
    or_else(t.get("pie9"), () => {
      adjust(t.get("primaryColor"), h=num(120.0), l=num(-40.0))
    }),
  )
  t.set(
    "pie10",
    or_else(t.get("pie10"), () => {
      adjust(t.get("primaryColor"), h=num(60.0), l=num(-40.0))
    }),
  )
  t.set(
    "pie11",
    or_else(t.get("pie11"), () => {
      adjust(t.get("primaryColor"), h=num(-90.0), l=num(-40.0))
    }),
  )
  t.set(
    "pie12",
    or_else(t.get("pie12"), () => {
      adjust(t.get("primaryColor"), h=num(120.0), l=num(-30.0))
    }),
  )
  t.set(
    "pieTitleTextSize",
    or_else(t.get("pieTitleTextSize"), () => str("25px")),
  )
  t.set(
    "pieTitleTextColor",
    or_else(t.get("pieTitleTextColor"), () => t.get("taskTextDarkColor")),
  )
  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("taskTextDarkColor")),
  )
  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")))
  t.set(
    "venn1",
    nullish(t.get("venn1"), () => adjust(t.get("primaryColor"), l=num(-30.0))),
  )
  t.set(
    "venn2",
    nullish(t.get("venn2"), () => adjust(t.get("secondaryColor"), l=num(-30.0))),
  )
  t.set(
    "venn3",
    nullish(t.get("venn3"), () => adjust(t.get("tertiaryColor"), l=num(-40.0))),
  )
  t.set(
    "venn4",
    nullish(t.get("venn4"), () => {
      adjust(t.get("primaryColor"), h=num(60.0), l=num(-30.0))
    }),
  )
  t.set(
    "venn5",
    nullish(t.get("venn5"), () => {
      adjust(t.get("primaryColor"), h=num(-60.0), l=num(-30.0))
    }),
  )
  t.set(
    "venn6",
    nullish(t.get("venn6"), () => {
      adjust(t.get("secondaryColor"), h=num(60.0), l=num(-30.0))
    }),
  )
  t.set(
    "venn7",
    nullish(t.get("venn7"), () => {
      adjust(t.get("primaryColor"), h=num(120.0), l=num(-30.0))
    }),
  )
  t.set(
    "venn8",
    nullish(t.get("venn8"), () => {
      adjust(t.get("secondaryColor"), h=num(120.0), l=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("#8B0000")
      }),
      "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("#E8F5E9")
      }),
      "complicatedBg": or_else(field(t.get("cynefin"), "complicatedBg"), () => {
        str("#E3F2FD")
      }),
      "chaoticBg": or_else(field(t.get("cynefin"), "chaoticBg"), () => {
        str("#FBE9E7")
      }),
      "clearBg": or_else(field(t.get("cynefin"), "clearBg"), () => {
        str("#FFF8E1")
      }),
      "confusionBg": or_else(field(t.get("cynefin"), "confusionBg"), () => {
        str("#F3E5F5")
      }),
      "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(
    "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("#dc3545")),
  )
  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("background")
      }),
      "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("background")
      }),
    }),
  )
  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(
          "#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3",
        )
      }),
    }),
  )
  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"), () => t.get("labelBackground")),
  )
  t.set(
    "relationLabelColor",
    or_else(t.get("relationLabelColor"), () => t.get("actorTextColor")),
  )
  t.set("git0", or_else(t.get("git0"), () => t.get("primaryColor")))
  t.set("git1", or_else(t.get("git1"), () => t.get("secondaryColor")))
  t.set("git2", or_else(t.get("git2"), () => t.get("tertiaryColor")))
  t.set(
    "git3",
    or_else(t.get("git3"), () => adjust(t.get("primaryColor"), h=num(-30.0))),
  )
  t.set(
    "git4",
    or_else(t.get("git4"), () => adjust(t.get("primaryColor"), h=num(-60.0))),
  )
  t.set(
    "git5",
    or_else(t.get("git5"), () => adjust(t.get("primaryColor"), h=num(-90.0))),
  )
  t.set(
    "git6",
    or_else(t.get("git6"), () => adjust(t.get("primaryColor"), h=num(60.0))),
  )
  t.set(
    "git7",
    or_else(t.get("git7"), () => adjust(t.get("primaryColor"), h=num(120.0))),
  )
  if truthy(t.get("darkMode")) {
    t.set("git0", lighten(t.get("git0"), num(25.0)))
    t.set("git1", lighten(t.get("git1"), num(25.0)))
    t.set("git2", lighten(t.get("git2"), num(25.0)))
    t.set("git3", lighten(t.get("git3"), num(25.0)))
    t.set("git4", lighten(t.get("git4"), num(25.0)))
    t.set("git5", lighten(t.get("git5"), num(25.0)))
    t.set("git6", lighten(t.get("git6"), num(25.0)))
    t.set("git7", lighten(t.get("git7"), num(25.0)))
  } else {
    t.set("git0", darken(t.get("git0"), num(25.0)))
    t.set("git1", darken(t.get("git1"), num(25.0)))
    t.set("git2", darken(t.get("git2"), num(25.0)))
    t.set("git3", darken(t.get("git3"), num(25.0)))
    t.set("git4", darken(t.get("git4"), num(25.0)))
    t.set("git5", darken(t.get("git5"), num(25.0)))
    t.set("git6", darken(t.get("git6"), num(25.0)))
    t.set("git7", darken(t.get("git7"), num(25.0)))
  }
  t.set(
    "gitInv0",
    or_else(t.get("gitInv0"), () => darken(invert(t.get("git0")), num(25.0))),
  )
  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("white")))
  t.set("emUiStroke", or_else(t.get("emUiStroke"), () => str("#dbdada")))
  t.set(
    "emProcessorFill",
    or_else(t.get("emProcessorFill"), () => str("#edb3f6")),
  )
  t.set(
    "emProcessorStroke",
    or_else(t.get("emProcessorStroke"), () => str("#b88cbf")),
  )
  t.set(
    "emReadModelFill",
    or_else(t.get("emReadModelFill"), () => str("#d3f1a2")),
  )
  t.set(
    "emReadModelStroke",
    or_else(t.get("emReadModelStroke"), () => str("#a3b732")),
  )
  t.set("emCommandFill", or_else(t.get("emCommandFill"), () => str("#bcd6fe")))
  t.set(
    "emCommandStroke",
    or_else(t.get("emCommandStroke"), () => str("#679ac3")),
  )
  t.set("emEventFill", or_else(t.get("emEventFill"), () => str("#ffb778")))
  t.set("emEventStroke", or_else(t.get("emEventStroke"), () => str("#c19a0f")))
  t.set(
    "emSwimlaneBackgroundOdd",
    or_else(t.get("emSwimlaneBackgroundOdd"), () => str("rgb(250,250,250)")),
  )
  t.set(
    "emSwimlaneBackgroundStroke",
    or_else(t.get("emSwimlaneBackgroundStroke"), () => str("rgb(240,240,240)")),
  )
  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"), () => str("#ffffff")),
  )
  t.set(
    "attributeBackgroundColorEven",
    or_else(t.get("attributeBackgroundColorEven"), () => str("#f2f2f2")),
  )
}