You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 41e20f-wedding-table-seating-planner/components/tsp.gts
+45-2Lines changed: 45 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3677,16 +3677,59 @@ export class TableSeatingPlannerIsolated extends Component<
3677
3677
// (cardInfo.theme) so the generated artwork follows the same palette and mood
3678
3678
// as the rest of the planner. Falls back to a tasteful neutral style when no
3679
3679
// theme is linked.
3680
+
// The linked theme's concrete colour values, keyed by CSS variable name
3681
+
// (without the leading `--`), parsed from the same computed `:root { … }`
3682
+
// block that skins the planner itself. Empty when no theme is linked.
3683
+
private themeColors():Record<string, string> {
3684
+
let css = (this.args.modelasany)?.cardInfo?.theme?.cssVariables;
3685
+
if (!css) return {};
3686
+
let block =String(css).match(/:root\s*\{([\s\S]*?)\}/)?.[1] ??'';
3687
+
let out:Record<string, string> = {};
3688
+
let re =/--([\w-]+)\s*:\s*([^;]+);/g;
3689
+
let m:RegExpExecArray|null;
3690
+
while ((m=re.exec(block))) out[m[1]] =m[2].trim();
3691
+
returnout;
3692
+
}
3693
+
3680
3694
privateget posterThemeStyle():string {
3681
3695
let theme = (this.args.modelasany)?.cardInfo?.theme;
3682
3696
let name = (theme?.title||theme?.cardInfo?.name||'').trim();
3683
3697
let desc = (theme?.description||theme?.cardInfo?.summary||'').trim();
3684
-
if (name||desc) {
3698
+
let c =this.themeColors();
3699
+
// The poster ground is the theme's signature colour (its primary / chrome
3700
+
// hue) so the artwork reads as the theme at a glance — e.g. a red theme
3701
+
// yields a red poster. Lettering uses the theme's own on-primary contrast
3702
+
// colour; decorative motifs use the accent (metallic) hue.
3703
+
let bg =c['primary'] ||c['navy'] ||c['ink-2'];
3704
+
let fg =
3705
+
c['primary-foreground'] ||
3706
+
c['gold-soft'] ||
3707
+
c['navy-ink'] ||
3708
+
c['paper'] ||
3709
+
c['background'];
3710
+
let accent =c['accent'] ||c['gold'] ||c['acc'];
3711
+
if (name||desc||bg) {
3685
3712
let intro =name
3686
3713
?`follow the “${name}” theme`
3687
3714
:'follow the linked theme';
3688
3715
let body =desc?` — ${desc}`:'';
3689
-
return`Visual style: ${intro}${body}. Let this palette and mood govern the whole poster — the background tone, the decorative motifs behind the text, and the lettering colours all come from this theme.`;
3716
+
let colorParts:string[] = [];
3717
+
if (bg)
3718
+
colorParts.push(
3719
+
`the poster background MUST be exactly ${bg} — this is the theme's signature colour; fill every pixel edge to edge with it (or a subtle richer/darker tonal variation of it), and never fall back to plain white or cream unless ${bg} itself is that light`,
3720
+
);
3721
+
if (fg)
3722
+
colorParts.push(
3723
+
`lettering colour ${fg}, chosen to stay legible on that background`,
3724
+
);
3725
+
if (accent)
3726
+
colorParts.push(`decorative motif and accent colour ${accent}`);
3727
+
let colorLine =colorParts.length
3728
+
?` Use this EXACT colour palette, do not substitute other colours: ${colorParts.join(
3729
+
'; ',
3730
+
)}.`
3731
+
:'';
3732
+
return`Visual style: ${intro}${body}. Let this palette and mood govern the whole poster — the saturated background ground, the decorative motifs behind the text, and the lettering colours all come from this theme.${colorLine}`;
3690
3733
}
3691
3734
return'Background: warm white — a soft, warm-toned white like fine letterpress stationery, with a delicate faded decorative motif behind the text (light watercolor florals or fine line-art) in muted, low-contrast tones so the lettering stays crisp and dominant.';
0 commit comments