diff --git a/src/resources/filters/quarto-post/typst-brand-yaml.lua b/src/resources/filters/quarto-post/typst-brand-yaml.lua index 51e78f993cb..01c4cbf86ae 100644 --- a/src/resources/filters/quarto-post/typst-brand-yaml.lua +++ b/src/resources/filters/quarto-post/typst-brand-yaml.lua @@ -65,11 +65,6 @@ function render_typst_brand_yaml() end local decl = '#let brand-color = ' .. to_typst_dict_indent(colors) quarto.doc.include_text('in-header', decl) - local BACKGROUND_OPACITY = 0.1 - local themebk = {} - for name, _ in pairs(brandColor) do - themebk[name] = _quarto.modules.brand.get_background_color(name, BACKGROUND_OPACITY) - end if brandColor.background then quarto.doc.include_text('in-header', '#set page(fill: brand-color.background)') end @@ -79,7 +74,11 @@ function render_typst_brand_yaml() quarto.doc.include_text('in-header', '#set line(stroke: (paint: brand-color.foreground))') end - local decl = '// theme colors at opacity ' .. BACKGROUND_OPACITY .. '\n#let brand-color-background = ' .. to_typst_dict_indent(themebk) + local themebk = {} + for name, _ in pairs(brandColor) do + themebk[name] = 'brand-color.' .. name .. '.lighten(85%)' + end + local decl = '#let brand-color-background = ' .. to_typst_dict_indent(themebk) quarto.doc.include_text('in-header', decl) end local function quote_string(value) diff --git a/tests/docs/smoke-all/typst/brand-yaml/color/posit/brand-color.qmd b/tests/docs/smoke-all/typst/brand-yaml/color/posit/brand-color.qmd index 14388e2f8d8..68426bb5772 100644 --- a/tests/docs/smoke-all/typst/brand-yaml/color/posit/brand-color.qmd +++ b/tests/docs/smoke-all/typst/brand-yaml/color/posit/brand-color.qmd @@ -10,7 +10,7 @@ _quarto: - - 'burgundy: rgb\("#9a4665"\),' - 'primary: rgb\("#447099"\),' - - 'primary: rgb\("#44709919"\),' # background + - 'primary: brand-color\.primary\.lighten\(85%\),' - 'title: (\r\n?|\n)\[(\r\n?|\n)Note(\r\n?|\n)\](\r\n?|\n), (\r\n?|\n)background_color: (\r\n?|\n)brand-color-background.primary' - 'title: (\r\n?|\n)\[(\r\n?|\n)Warning(\r\n?|\n)\](\r\n?|\n), (\r\n?|\n)background_color: (\r\n?|\n)brand-color-background.warning' -