Skip to main content
MapToPoster themes are defined as JSON files in the themes/ directory. Creating custom themes is simple and requires no code changes.

Theme Structure

Complete Schema

A theme JSON file contains 11 required properties:

Property Reference

string
required
Display name of the theme (used in --list-themes output)
string
required
Brief description of the aesthetic and use case
hex color
required
Background color for the entire poster
hex color
required
Color for city name, country name, and coordinates text
hex color
required
Color used for top/bottom gradient fade effect. Usually matches bg for subtle fade.
hex color
required
Color for water features (rivers, lakes, ocean)
hex color
required
Color for parks and green spaces
hex color
required
Color for major highways and motorways (thickest roads)
hex color
required
Color for primary roads and main streets
hex color
required
Color for secondary roads
hex color
required
Color for tertiary roads
hex color
required
Color for residential streets (thinnest roads)
hex color
required
Fallback color for roads without specific classification

Creating a Custom Theme

Step 1: Create JSON File

Create a new .json file in the themes/ directory:
The filename (without .json) becomes the theme identifier used with --theme.

Step 2: Define Colors

Add your color palette:
themes/my_theme.json

Step 3: Use Your Theme

Reference by filename (without .json):

Design Guidelines

Road Hierarchy

Roads should follow a visual hierarchy from major to minor:
Visual Weight Strategies:

Contrast & Readability

Background vs. Roads:
  • Ensure sufficient contrast between bg and road colors
  • Test with both dense cities (many roads) and sparse cities (few roads)
Background vs. Text:
  • Text must be clearly readable against bg
  • Aim for WCAG AA contrast ratio (4.5:1 minimum)
Water & Parks:
  • Should be distinguishable from bg but subtle
  • Usually slightly lighter or darker than bg

Color Harmony

Use a single hue with varying lightness/saturation:
Examples: Monochrome Blue, Ocean
Use adjacent colors on the color wheel:
Examples: Sunset, Autumn, Terracotta
Use opposite colors on the color wheel:
Examples: Copper Patina
Maximum contrast for dramatic effect:
Examples: Noir, Contrast Zones

Example Themes

Example 1: Retro Gameboy

themes/gameboy.json

Example 2: Vaporwave

themes/vaporwave.json

Example 3: Sepia Vintage

themes/sepia_vintage.json

Example 4: Matrix

themes/matrix.json

Example 5: Lavender Fields

themes/lavender.json

Testing Your Theme

Quick Test

Test with a well-known city:

Test Multiple City Types

Test your theme with different urban patterns:

Validation Checklist

1

Contrast Check

Verify text is readable against background
2

Road Hierarchy

Ensure major roads stand out more than minor roads
3

Water Visibility

Check water features are distinguishable (test Venice or Amsterdam)
4

Park Visibility

Verify parks are visible but subtle (test Paris or London)
5

Dense vs. Sparse

Test with both dense cities (Tokyo) and sparse cities (suburbs)

Advanced Techniques

Gradient Fade Effect

The gradient_color creates a subtle fade at top and bottom of the poster:

Color Temperature

Warm Themes (welcoming, vintage):
  • Use reds, oranges, yellows, warm browns
  • Examples: Sunset, Autumn, Terracotta
Cool Themes (modern, calm):
  • Use blues, cyans, purples, cool grays
  • Examples: Ocean, Blueprint, Midnight Blue
Neutral Themes (professional, versatile):
  • Use grays, beiges, balanced tones
  • Examples: Noir, Warm Beige, Pastel Dream

Accessibility

Ensure your theme works for colorblind users:
  • Use lightness/darkness variation (not just hue)
  • Avoid red/green as the only differentiator
  • Test with colorblind simulators

Troubleshooting

Ensure:
  1. File is in themes/ directory
  2. File has .json extension
  3. JSON is valid (use a JSON validator)
  4. All 11 properties are present
Common JSON mistakes:
Increase contrast between roads and background:
Ensure sufficient contrast:
Increase the gradient range:

Sharing Your Theme

If you create a great theme:
  1. Test thoroughly with multiple cities
  2. Choose a descriptive name and write clear description
  3. Consider contributing back to the project
  4. Share screenshots on social media

Next Steps

Theme Gallery

Browse all built-in themes for inspiration

Advanced Examples

See advanced usage patterns and techniques