A comprehensive color palette generation tool for designers and developers.
ColorMaestro helps you create beautiful, harmonious, and accessible color palettes for your design projects. Generate color schemes using different algorithms, export in multiple formats, and ensure your colors meet accessibility standards.
- Multiple Generation Methods: Create palettes using color harmony rules, monochromatic schemes, accessibility guidelines, mood-based palettes, and UI-optimized color sets
- Format Options: Export your palette to CSS, SCSS, Tailwind config, HTML preview, JSON, or terminal output
- Accessibility Tools: Check color contrast ratios against WCAG standards
- CLI Interface: Generate palettes directly from your terminal
- Flexible Output: Use as a library in your Python projects or as a standalone tool
# Clone the repository
git clone https://github.com/wikiteq/colormaestro.git
# Navigate to the directory
cd colormaestro
# Install the package
pip install -e .
- Python 3.8+
- Click (for CLI)
- Pillow (for image generation)
- Jinja2 (for HTML templates)
Generate a basic palette from a hex color:
colormaestro generate --color "#3498db" --method harmony --output palette.html
View a palette in the terminal:
colormaestro generate --color "#e74c3c" --method monochromatic --colors 5 --format terminal
from colormaestro.generators import harmony
from colormaestro.formatters import terminal, css
# Generate a palette
base_color = (52, 152, 219) # RGB for #3498db
palette = harmony.generate(base_color, "complementary", 5)
# Display in terminal
terminal.display(palette)
# Generate CSS variables
css_code = css.generate(palette)
print(css_code)
Generate palettes based on color theory harmony rules.
colormaestro generate --color "#9b59b6" --method harmony --harmony-type triadic --colors 6
Available harmony types:
complementary
- Colors opposite on the color wheelanalogous
- Colors adjacent on the color wheeltriadic
- Three colors evenly spaced around the color wheeltetradic
- Four colors evenly spaced around the color wheelsplit-complementary
- Base color plus two colors adjacent to its complement
Create variations of a single color with different lightness and saturation.
colormaestro generate --color "#2ecc71" --method monochromatic --colors 5
Generate color palettes optimized for accessibility and WCAG compliance.
colormaestro generate --color "#f39c12" --method accessible --colors 4
Create palettes that match a specific mood or feeling.
colormaestro generate --mood professional --colors 5
Available moods:
professional
playful
serious
calm
energetic
Generate palettes specifically designed for user interfaces with proper contrast.
colormaestro generate --color "#34495e" --method ui --colors 7 --dark-mode
Display color palettes directly in your terminal with color previews.
colormaestro generate --color "#3498db" --format terminal
Generate CSS custom properties (variables) for your palette.
colormaestro generate --color "#3498db" --format css --output palette.css
Example output:
:root {
--color-primary: #3498db;
--color-primary-rgb: 52, 152, 219;
--color-secondary: #db7834;
--color-secondary-rgb: 219, 120, 52;
--color-accent: #34db98;
--color-accent-rgb: 52, 219, 152;
/* Semantic color mapping */
--color-background: var(--color-primary);
--color-text: #000000;
--color-button: var(--color-secondary);
--color-border: rgba(var(--color-primary-rgb), 0.2);
--color-highlight: var(--color-accent);
}
Generate SCSS variables and color maps for your palette.
colormaestro generate --color "#3498db" --format scss --output palette.scss
Generate a Tailwind CSS configuration with your palette colors.
colormaestro generate --color "#3498db" --format tailwind --output tailwind-colors.js
Generate an HTML file that displays your palette.
colormaestro generate --color "#3498db" --format html --output palette.html
Export your palette as JSON for integration with other tools.
colormaestro generate --color "#3498db" --format json --output palette.json
Export your palette as a PNG or SVG image.
colormaestro generate --color "#3498db" --format image --output palette.png
Check if your palette meets WCAG accessibility standards:
from colormaestro.utils import accessibility_utils
from colormaestro.generators import accessible
# Generate an accessible palette
palette = accessible.generate((52, 152, 219), 4)
# Check contrast between all color pairs
results = accessibility_utils.check_contrast(palette)
# Display results
accessibility_utils.display_results(results)
You can create custom generation workflows:
from colormaestro.generators import mood, harmony
from colormaestro.formatters import css, terminal
# Generate a base color for a specific mood
base_color = mood.generate_base_color("energetic")
# Create a harmonious palette from that base color
palette = harmony.generate(base_color, "analogous", 5)
# Display and export
terminal.display(palette, show_demo=True)
css_code = css.generate(palette)
with open("custom-palette.css", "w") as f:
f.write(css_code)
Usage: colormaestro [OPTIONS] COMMAND [ARGS]...
ColorMaestro: A color palette generation tool.
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
generate Generate a color palette.
analyze Analyze a color or palette.
convert Convert colors between formats.
Usage: colormaestro generate [OPTIONS]
Generate a color palette.
Options:
--color TEXT Base color in hex format (#RRGGBB).
--mood [professional|playful|serious|calm|energetic]
Generate a palette based on mood.
--method [harmony|monochromatic|accessible|ui]
Color generation method.
--harmony-type [complementary|analogous|triadic|tetradic|split-complementary]
Harmony type when using harmony method.
--colors INTEGER Number of colors in the palette. [default: 5]
--dark-mode Generate dark mode optimized palette.
--format [terminal|css|scss|html|json|tailwind|image]
Output format. [default: terminal]
--output TEXT Output file path.
--show-demo Show UI component examples.
--help Show this message and exit.
This project is licensed under the MIT License - see the LICENSE file for details.