theme-foundation
Theme Foundation
Generate a complete theme color system from a single brand color. Creates primary accent, secondary accent (complementary), and neutral ramps - all mathematically derived.
When to Use
- "Create a theme from my brand color"
- "I need colors for light and dark mode"
- "Generate a color system for my app"
- "Start a new design system with this color"
Installation
npx @basiclines/rampa
Recipe
Given a user's brand color, generate three ramp types:
1. Primary Accent Ramp
The main brand color expanded to a full 10-shade scale.
rampa -C "<brand-color>" -L 95:10 --size=10 -O css --name=accent
2. Secondary Accent (Complementary)
Mathematically opposite on the color wheel - perfect for CTAs, highlights, or secondary actions.
rampa -C "<brand-color>" --add=complementary -L 95:10 --size=10 -O css
This outputs two ramps:
base- the primary accentcomplementary-1- the secondary accent
3. Neutral Ramp
Derived from the brand color but heavily desaturated. This creates "warm" or "cool" neutrals that feel cohesive with the brand.
rampa -C "<brand-color>" -L 98:5 -S 5:10 --size=10 -O css --name=neutral
Complete Example
For brand color #3b82f6 (blue):
# Primary accent
rampa -C "#3b82f6" -L 95:10 --size=10 -O css --name=accent
# Secondary + Primary together
rampa -C "#3b82f6" --add=complementary -L 95:10 --size=10 -O css
# Neutrals (slightly warm from the blue)
rampa -C "#3b82f6" -L 98:5 -S 5:10 --size=10 -O css --name=neutral
Output Structure
:root {
/* Primary Accent */
--accent-0: #f0f7ff;
--accent-1: #dbeafe;
/* ... */
--accent-9: #1e3a5f;
/* Secondary Accent (complementary) */
--complementary-1-0: #fff7ed;
--complementary-1-1: #ffedd5;
/* ... */
/* Neutrals */
--neutral-0: #fafafa;
--neutral-1: #f5f5f5;
/* ... */
--neutral-9: #171717;
}
Light vs Dark Mode
The same ramps work for both modes - just map them differently:
Light Mode:
- Background:
neutral-0toneutral-2 - Text:
neutral-8toneutral-9 - Accent:
accent-5toaccent-7
Dark Mode:
- Background:
neutral-9toneutral-7 - Text:
neutral-0toneutral-2 - Accent:
accent-3toaccent-5
Tips
- The complementary color is mathematically guaranteed to contrast with the primary
- Neutrals inherit subtle warmth/coolness from the brand color
- Use
--size=11for more granular control - Adjust
-Lrange for more/less contrast (e.g.,-L 90:20for less extreme)
More from basiclines/rampa-studio
rampa-colors
Generate mathematically accurate color palettes using OKLCH color space. Use when creating design systems, color ramps, accessible palettes, CSS variables for themes, or when user asks about color generation.
36accessible-contrast
Generate color ramps designed for WCAG-compliant contrast pairing. Creates 11-step scales with predictable foreground/background combinations.
35data-viz-palette
Generate distinct, accessible colors for charts, graphs, and data visualizations. Uses color harmonies for maximum perceptual distinction.
30tinted-neutrals
Generate neutral gray palettes with subtle brand color tinting. Use when you want grays that feel connected to your brand rather than pure neutral grays.
27status-from-accent
Generate success, warning, danger, and info status colors that harmonize with your brand using square harmony. All colors mathematically derived from one input.
27brand-expansion
Expand a single brand color into a complete multi-hue color system using harmonies. Creates primary, analogous, complementary, and split-complementary ramps.
26