Skip to content

Commit cce1588

Browse files
author
Miriad
committed
fix: stronger black bg enforcement in Gemini image prompts
V5b showed 2/4 infographic frames with gray/off-white backgrounds despite the color rule saying 'Use ONLY black'. Restructured as numbered rules with explicit rejection language. Background rule is now #1 priority.
1 parent 889d31a commit cce1588

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/services/gemini-infographics.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,13 @@ async function generateWithGeminiContent(
107107
const ai = getAI();
108108

109109
// Enforce brand colors by prepending strict color instruction
110-
const colorEnforcedPrompt = `CRITICAL COLOR RULE: Use ONLY purple (#7c3aed) for all highlighted elements, fills, accents, and glows. Use ONLY white (#FFFFFF) for text, arrows, and lines. Use ONLY black (#000000) for background. NEVER use teal, cyan, green, blue, or any other accent color.\n\n${prompt}`;
110+
const colorEnforcedPrompt = `STRICT RULES — FOLLOW EXACTLY:
111+
1. BACKGROUND: Pure black (#000000) only. NO gray, NO white, NO gradients, NO off-white. The entire background MUST be solid black.
112+
2. ACCENTS: Purple (#7c3aed) only for all boxes, fills, highlights, and glows. NO teal, NO cyan, NO green, NO blue.
113+
3. TEXT & LINES: White (#FFFFFF) only for all text labels, arrows, and connecting lines.
114+
4. VIOLATION: Any color other than black background, purple accents, and white text is REJECTED.
115+
116+
${prompt}`;
111117

112118
const response = await ai.models.generateContent({
113119
model,

0 commit comments

Comments
 (0)