aeat.application.storage.calc_sheets._theme module¶
Shared visual design system for modelo workbook exports.
This module is the single source of truth for the export look — the font
family and the role→style palette — consumed identically by both transports
(the offline openpyxl materializer in _workbook_export and the online
Google-Sheets apply adapter in _calc_sheets_apply). Centralising the design
here is what makes “uniform application across all exports” structural rather
than coincidental: neither transport hard-codes a colour or a font; both import
WORKBOOK_FONT_FAMILY and ROLE_STYLES and translate the same
declarative RoleStyle into their respective formatting API. The palette
mirrors the calm, boxed look of the official AEAT paper modelo: a slate header
band, light blue-grey section banners, pale-yellow operator-input boxes,
light-grey computed/protected cells, and a green-accented final result.
The colours are stored as plain RRGGBB hex; hex_to_rgb_floats()
converts to the 0..1 channel floats the Sheets API wants, and openpyxl consumes
the hex directly (prefixed with the opaque alpha FF).
- class StyleRole(*values)[source]¶
Bases:
StrEnumThe closed set of presentation roles a styled range can carry.
Each role maps to exactly one
RoleStyleinROLE_STYLES; the engine tags ranges with a role and both transports resolve the role to concrete fill / font / alignment through this module.- HEADER¶
- SECTION_BANNER¶
- INPUT¶
- COMPUTED¶
- RESULT¶
- TITLE¶
- BODY¶
- class RoleStyle(fill_hex, font_hex, bold, align, wrap=False)[source]¶
Bases:
objectA declarative cell style independent of any rendering backend.
fill_hex/font_hexareRRGGBB(orNonefor “no fill” / “default ink”);boldtoggles weight;alignis the horizontal alignment;wraprequests text wrapping (the renderer auto-grows row height to fit).- Parameters: