use_brand
use_brand(template=None, colors=None, fonts=None, quiet=False)Adopt an organisation brand from a PowerPoint or Word template.
Reads the colour and font theme out of your organisation’s .pptx / .docx template and makes it the session default for everything ezrsurvey produces: charts pick up the brand accent colours and body font, and the template file itself becomes the default reference document for report_new(), report_deck() and scaffold_report().
Extraction reads the theme part inside the template: accent colours 1-6 become brand_colors (first accent = brand_color_primary, the default fill of plot_bars()), and the minor (body) typeface becomes the default font of theme_ezrsurvey(), but only when that font is installed on this machine. Set ezrsurvey_options(brand_fonts_enabled=False) to keep brand colours but ignore brand fonts. Everything lands in ordinary ezrsurvey_options() (brand_* keys), so you can equally set the values by hand or persist them in a profile. Semantic palettes (pal_rating, pal_nps) keep their meaning-carrying colours. Use clear_brand() to return to the neutral look.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| template | str | Path to a .pptx or .docx file, registered as the default reference document for reports of that format. None to set colours and fonts directly without a template. | None |
| colors | str or list of str | Hex colours overriding the extracted accents. A single colour sets only the primary; a list sets the full accent palette (first entry = primary). Invalid entries are dropped with a warning. | None |
| fonts | str or dict | Typefaces overriding the extracted ones: a single body font, or {"major": ..., "minor": ...}. |
None |
| quiet | bool | If True, do not print the confirmation. | False |
Returns
| Name | Type | Description |
|---|---|---|
| EzrsurveyBrand | The active brand (see brand_info()). |
See Also
brand_info, clear_brand, pal_brand, scale_fill_brand, report_new
Examples
>>> use_brand(colors=["#0B5394", "#E69138"], fonts="Georgia", quiet=True)
>>> clear_brand()