cadrumo.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 by the Google Sheets apply adapter.
Centralising the design
here is what makes uniform application structural rather than coincidental.
The adapter imports WORKBOOK_FONT_FAMILY and ROLE_STYLES and
translates the declarative RoleStyle into its 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.
- STYLED_RANGE_VERTICAL_ALIGN: Final[str]¶
Vertical alignment applied to every role-styled range.
Unlike the horizontal alignment this is uniform across roles, which is why it belongs here rather than on
RoleStyle.
- 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 the renderer resolves 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: