返回 AiToEarn
colorize.md
1 > **Additional context needed**: existing brand colors.
2
3 Replace timid grayscale or single-accent designs with a strategic palette: pick a color strategy, choose a hue family that fits the brand, then apply color with intent. More color ≠ better. Strategic color beats rainbow vomit.
4
5 ---
6
7 ## Register
8
9 Brand: palette IS voice. Pick a color strategy first per SKILL.md (Restrained / Committed / Full palette / Drenched) and follow its dosage. Committed, Full palette, and Drenched deliberately exceed the ≤10% rule; that rule is Restrained only. Unexpected combinations are allowed; a dominant color can own the page when the chosen strategy calls for it.
10
11 Product: semantic-first and almost always Restrained. Accent color is reserved for primary action, current selection, and state indicators. Not decoration. Every color has a consistent meaning across every screen.
12
13 ---
14
15 ## Assess Color Opportunity
16
17 Analyze the current state and identify opportunities:
18
19 1. **Understand current state**:
20 - **Color absence**: Pure grayscale? Limited neutrals? One timid accent?
21 - **Missed opportunities**: Where could color add meaning, hierarchy, or delight?
22 - **Context**: What's appropriate for this domain and audience?
23 - **Brand**: Are there existing brand colors we should use?
24
25 2. **Identify where color adds value**:
26 - **Semantic meaning**: Success (green), error (red), warning (yellow/orange), info (blue)
27 - **Hierarchy**: Drawing attention to important elements
28 - **Categorization**: Different sections, types, or states
29 - **Emotional tone**: Warmth, energy, trust, creativity
30 - **Wayfinding**: Helping users navigate and understand structure
31 - **Delight**: Moments of visual interest and personality
32
33 If any of these are unclear from the codebase, STOP and use Codex's structured user-input/question tool when available; if unavailable, ask directly in chat to clarify what you cannot infer.
34
35 **CRITICAL**: More color ≠ better. Strategic color beats rainbow vomit every time. Every color should have a purpose.
36
37 ## Plan Color Strategy
38
39 Create a purposeful color introduction plan:
40
41 - **Color palette**: What colors match the brand/context? (Choose 2-4 colors max beyond neutrals)
42 - **Dominant color**: Which color owns 60% of colored elements?
43 - **Accent colors**: Which colors provide contrast and highlights? (30% and 10%)
44 - **Application strategy**: Where does each color appear and why?
45
46 **IMPORTANT**: Color should enhance hierarchy and meaning, not create chaos. Less is more when it matters more.
47
48 ## Introduce Color Strategically
49
50 Add color systematically across these dimensions:
51
52 ### Semantic Color
53 - **State indicators**:
54 - Success: Green tones (emerald, forest, mint)
55 - Error: Red/pink tones (rose, crimson, coral)
56 - Warning: Orange/amber tones
57 - Info: Blue tones (sky, ocean, indigo)
58 - Neutral: Gray/slate for inactive states
59
60 - **Status badges**: Colored backgrounds or borders for states (active, pending, completed, etc.)
61 - **Progress indicators**: Colored bars, rings, or charts showing completion or health
62
63 ### Accent Color Application
64 - **Primary actions**: Color the most important buttons/CTAs
65 - **Links**: Add color to clickable text (maintain accessibility)
66 - **Icons**: Colorize key icons for recognition and personality
67 - **Headers/titles**: Add color to section headers or key labels
68 - **Hover states**: Introduce color on interaction
69
70 ### Background & Surfaces
71 - **Tinted backgrounds**: If you replace pure gray, tint toward the brand hue, not toward a generic-warm-or-cool pair. The default-warm-tint (`oklch(97% 0.01 60)` and its neighbors) is now the AI cream/sand giveaway. Be specific to the brand or stay neutral.
72 - **Colored sections**: Use subtle background colors to separate areas
73 - **Gradient backgrounds**: Add depth with subtle, intentional gradients (not generic purple-blue)
74 - **Cards & surfaces**: Tint cards or surfaces toward the brand, not "for warmth" by reflex
75
76 **Use OKLCH for color**: It's perceptually uniform, meaning equal steps in lightness *look* equal. Great for generating harmonious scales.
77
78 ### Data Visualization
79 - **Charts & graphs**: Use color to encode categories or values
80 - **Heatmaps**: Color intensity shows density or importance
81 - **Comparison**: Color coding for different datasets or timeframes
82
83 ### Borders & Accents
84 - **Hairline borders**: 1px colored borders on full perimeter (not side-stripes; see the absolute ban on `border-left/right > 1px`)
85 - **Underlines**: Color underlines for emphasis or active states
86 - **Dividers**: Subtle colored dividers instead of gray lines
87 - **Focus rings**: Colored focus indicators matching brand
88 - **Surface tints**: A 4-8% background wash of the accent color instead of a stripe
89
90 **NEVER**: `border-left` or `border-right` greater than 1px as a colored accent stripe. This is one of the three absolute bans in the parent skill. If you want to mark a card as "active" or "warning", use a full hairline border, a background tint, a leading glyph, or a numbered prefix. Not a side stripe.
91
92 ### Typography Color
93 - **Colored headings**: Use brand colors for section headings (maintain contrast)
94 - **Highlight text**: Color for emphasis or categories
95 - **Labels & tags**: Small colored labels for metadata or categories
96
97 ### Decorative Elements
98 - **Illustrations**: Add colored illustrations or icons
99 - **Shapes**: Geometric shapes in brand colors as background elements
100 - **Gradients**: Colorful gradient overlays or mesh backgrounds
101 - **Blobs/organic shapes**: Soft colored shapes for visual interest
102
103 ## Balance & Refinement
104
105 Ensure color addition improves rather than overwhelms:
106
107 ### Maintain Hierarchy
108 - **Dominant color** (60%): Primary brand color or most used accent
109 - **Secondary color** (30%): Supporting color for variety
110 - **Accent color** (10%): High contrast for key moments
111 - **Neutrals** (remaining): Gray/black/white for structure
112
113 ### Accessibility
114 - **Contrast ratios**: Ensure WCAG compliance (4.5:1 for text, 3:1 for UI components)
115 - **Don't rely on color alone**: Use icons, labels, or patterns alongside color
116 - **Test for color blindness**: Verify red/green combinations work for all users
117
118 ### Cohesion
119 - **Consistent palette**: Use colors from defined palette, not arbitrary choices
120 - **Systematic application**: Same color meanings throughout (green always = success)
121 - **Temperature consistency**: Warm palette stays warm, cool stays cool
122
123 **NEVER**:
124 - Use every color in the rainbow (choose 2-4 colors beyond neutrals)
125 - Apply color randomly without semantic meaning
126 - Put gray text on colored backgrounds. It looks washed out; use a darker shade of the background color or transparency instead
127 - Violate WCAG contrast requirements
128 - Use color as the only indicator (accessibility issue)
129 - Make everything colorful (defeats the purpose)
130 - Default to purple-blue gradients (AI slop aesthetic)
131
132 ## Verify Color Addition
133
134 Test that colorization improves the experience:
135
136 - **Better hierarchy**: Does color guide attention appropriately?
137 - **Clearer meaning**: Does color help users understand states/categories?
138 - **More engaging**: Does the interface feel warmer and more inviting?
139 - **Still accessible**: Do all color combinations meet WCAG standards?
140 - **Not overwhelming**: Is color balanced and purposeful?
141
142 When the palette earns its place, hand off to `$impeccable polish` for the final pass.
143
144 ## Live-mode signature params
145
146 When invoked from live mode, each variant MUST declare a `color-amount` param so the user can dial between a restrained accent and a drenched surface without regeneration. Author the variant's CSS against `var(--p-color-amount, 0.5)`, typically as the alpha multiplier on backgrounds, or as a scaling factor on the chroma axis in an OKLCH expression. 0 = neutral/monochrome, 1 = full saturation / dominant coverage.
147
148 ```json
149 {"id":"color-amount","kind":"range","min":0,"max":1,"step":0.05,"default":0.5,"label":"Color amount"}
150 ```
151
152 Layer 1-2 variant-specific params on top: palette selection (`steps` with named options), temperature warmth, or tint vs. true color. See `reference/live.md` for the full params contract.
153
154 ---
155
156 ## Reference Material
157
158 The sections below were previously `color-and-contrast.md` and live inline now so the colorize flow has its deep color reference in one place.
159
160 ### Color & Contrast
161
162 #### Color Spaces: Use OKLCH
163
164 **Stop using HSL.** Use OKLCH (or LCH) instead. It's perceptually uniform, meaning equal steps in lightness *look* equal, unlike HSL where 50% lightness in yellow looks bright while 50% in blue looks dark.
165
166 The OKLCH function takes three components: `oklch(lightness chroma hue)` where lightness is 0-100%, chroma is roughly 0-0.4, and hue is 0-360. To build a primary color and its lighter / darker variants, hold the chroma+hue roughly constant and vary the lightness, but **reduce chroma as you approach white or black**, because high chroma at extreme lightness looks garish.
167
168 The hue you pick is a brand decision and should not come from a default. Do not reach for blue (hue 250) or warm orange (hue 60) by reflex; those are the dominant AI-design defaults, not the right answer for any specific brand.
169
170 #### Building Functional Palettes
171
172 ##### Tinted Neutrals
173
174 **Pure gray is dead.** A neutral with zero chroma feels lifeless next to a colored brand. Add a tiny chroma value (0.005-0.015) to all your neutrals, hued toward whatever your brand color is. The chroma is small enough not to read as "tinted" consciously, but it creates subconscious cohesion between brand color and UI surfaces.
175
176 The hue you tint toward should come from THIS project's brand, not from a "warm = friendly, cool = tech" formula. If your brand color is teal, your neutrals lean toward teal. If your brand color is amber, they lean toward amber. The point is cohesion with the SPECIFIC brand, not a stock palette.
177
178 **Avoid** the trap of always tinting toward warm orange or always tinting toward cool blue. Those are the two laziest defaults and they create their own monoculture across projects.
179
180 ##### Palette Structure
181
182 A complete system needs:
183
184 | Role | Purpose | Example |
185 |------|---------|---------|
186 | **Primary** | Brand, CTAs, key actions | 1 color, 3-5 shades |
187 | **Neutral** | Text, backgrounds, borders | 9-11 shade scale |
188 | **Semantic** | Success, error, warning, info | 4 colors, 2-3 shades each |
189 | **Surface** | Cards, modals, overlays | 2-3 elevation levels |
190
191 **Skip secondary/tertiary unless you need them.** Most apps work fine with one accent color. Adding more creates decision fatigue and visual noise.
192
193 ##### The 60-30-10 Rule (Applied Correctly)
194
195 This rule is about **visual weight**, not pixel count:
196
197 - **60%**: Neutral backgrounds, white space, base surfaces
198 - **30%**: Secondary colors: text, borders, inactive states
199 - **10%**: Accent: CTAs, highlights, focus states
200
201 The common mistake: using the accent color everywhere because it's "the brand color." Accent colors work *because* they're rare. Overuse kills their power.
202
203 #### Contrast & Accessibility
204
205 ##### WCAG Requirements
206
207 | Content Type | AA Minimum | AAA Target |
208 |--------------|------------|------------|
209 | Body text | 4.5:1 | 7:1 |
210 | Large text (18px+ or 14px bold) | 3:1 | 4.5:1 |
211 | UI components, icons | 3:1 | 4.5:1 |
212 | Non-essential decorations | None | None |
213
214 ##### Dangerous Color Combinations
215
216 These commonly fail contrast or cause readability issues:
217
218 - Light gray text on white (the #1 accessibility fail)
219 - Red text on green background (or vice versa): 8% of men can't distinguish these
220 - Blue text on red background (vibrates visually)
221 - Yellow text on white (almost always fails)
222 - Thin light text on images (unpredictable contrast)
223
224 ##### Testing
225
226 Don't trust your eyes. Use tools:
227
228 - [WebAIM Contrast Checker](https://webaim.org/resources/contrastchecker/)
229 - Browser DevTools → Rendering → Emulate vision deficiencies
230 - [Polypane](https://polypane.app/) for real-time testing
231
232 #### Theming: Light & Dark Mode
233
234 ##### Dark Mode Is Not Inverted Light Mode
235
236 You can't just swap colors. Dark mode requires different design decisions:
237
238 | Light Mode | Dark Mode |
239 |------------|-----------|
240 | Shadows for depth | Lighter surfaces for depth (no shadows) |
241 | Dark text on light | Light text on dark (reduce font weight) |
242 | Vibrant accents | Desaturate accents slightly |
243 | White backgrounds | Either pure black or a deep surface that fits the brand (a brand-tinted near-black at oklch 12-18% works too) |
244
245 In dark mode, depth comes from surface lightness, not shadow. Build a 3-step surface scale where higher elevations are lighter (e.g. 15% / 20% / 25% lightness). Use the SAME hue and chroma as your brand color (whatever it is for THIS project; do not reach for blue) and only vary the lightness. Reduce body text weight slightly (e.g. 350 instead of 400) because light text on dark reads as heavier than dark text on light.
246
247 ##### Token Hierarchy
248
249 Use two layers: primitive tokens (`--blue-500`) and semantic tokens (`--color-primary: var(--blue-500)`). For dark mode, only redefine the semantic layer; primitives stay the same.
250
251 #### Alpha Is A Design Smell
252
253 Heavy use of transparency (rgba, hsla) usually means an incomplete palette. Alpha creates unpredictable contrast, performance overhead, and inconsistency. Define explicit overlay colors for each context instead. Exception: focus rings and interactive states where see-through is needed.
254
255 ---
256
257 **Avoid**: Relying on color alone to convey information. Creating palettes without clear roles for each color. Skipping color blindness testing (8% of men affected).
258
258 lines MARKDOWN