π¨ An interactive tool for creating custom brand icons for Flutter Flavorizr projects.
- Interactive Setup: Step-by-step guided configuration
- Brand-Specific Icons: Generate unique icons for each app flavor
- Multi-Platform Support: Creates icons for Android, iOS, and macOS
- Automatic Integration: Updates flavorizr.yaml and runs flavorizr automatically
- Generic & Reusable: Works with any brand colors and styles
- Navigate to your Flutter project (must have flavorizr configured)
- Run the automation script:
cd custom-icon-tool python3 automate_icons.py
If you already have a config JSON, you can run without prompts:
cd custom-icon-tool
python automate_icons.py --config brand_config.jsonOr use the wrapper, which auto-detects brand_config.json:
bash run.sh- Follow the prompts to configure your brands
- Watch the magic happen β¨
- Prompts for brand names, colors, and icon styles
- Supports multiple brands in one session
- Validates input (hex colors, flavor names)
- Creates PNG icons in all required sizes:
- Android: 5 density buckets (mdpi to xxxhdpi)
- iOS/macOS: 7 sizes (16px to 1024px)
- Generates brand-specific designs based on:
- Colors (primary, secondary, accent)
- Icon style (circle, tag, square)
- Brand name and symbol
- Updates
flavorizr.yamlwith new brand configurations - Copies icons to expected paths
- Runs
dart run flutter_flavorizrautomatically
- Circular background with inner design elements
- Cooperative/community themed design
- Best for professional brands
- Price tag design with fold
- Dollar sign or custom symbol
- Perfect for retail/discount brands
- Square background with inner square
- Clean, modern look
- Great for tech brands
Each brand can be configured with:
{
"flavor_name": {
"name": "Brand Display Name",
"primary_color": "#RRGGBB",
"secondary_color": "#RRGGBB",
"accent_color": "#RRGGBB",
"icon_style": "circle|tag|square",
"symbol": "Single character or symbol"
}
}python3 generate_icons.py [config_file.json]If config_file.json is relative, it resolves from the tool directory; all outputs are written under the project root assets/icons/....
- Copy
brand_config.json.exampletobrand_config.json - Edit the JSON with your brand settings
- Run
python3 generate_icons.py
custom-icon-tool/
βββ automate_icons.py # Interactive automation script
βββ generate_icons.py # Icon generation engine
βββ README.md # This documentation
βββ brand_config.json.example # Example configuration
Generated icons appear in:
assets/icons/{flavor_name}/
βββ android/mipmap-{density}/ic_launcher.png
βββ ios_icon_{size}.png
βββ macos_icon_{size}.png
βββ {ic_launcher,ios_icon,macos_icon}.png
- Python 3.6+ with PIL/Pillow
- Flutter project with flavorizr configured
- flavorizr.yaml and pubspec.yaml in project root
Edit the create_brand_icon() function in generate_icons.py:
def create_brand_icon(size, brand_config):
# Your custom drawing logic here
# Use: primary_color, secondary_color, accent_color
# Use: brand_config['name'], brand_config['symbol']
# Use: brand_config['icon_style']
pass- Add style option to the switch statement
- Implement your custom design logic
- Update this README
- Primary: Main background color
- Secondary: Inner elements/highlights
- Accent: Text and contrast elements
"Missing required files"
- Ensure you're in a Flutter project directory
- Check for
flavorizr.yamlandpubspec.yaml
"Icon generation failed"
- Verify Python PIL/Pillow is installed:
pip install Pillow - Check that brand colors are valid hex format
"Flavorizr execution failed"
- Run
dart run flutter_flavorizrmanually to see detailed errors - Ensure you have internet connection for asset downloads
If automation fails partway through:
- Fix the issue (missing dependencies, invalid config, etc.)
- Run generation only:
python3 generate_icons.py - Run flavorizr manually:
dart run flutter_flavorizr
{
"primary_color": "#E30613",
"secondary_color": "#FF0000",
"accent_color": "#FFFFFF",
"icon_style": "tag",
"symbol": "$"
}{
"primary_color": "#009639",
"secondary_color": "#00A651",
"accent_color": "#FFFFFF",
"icon_style": "circle",
"symbol": "P"
}{
"primary_color": "#3F51B5",
"secondary_color": "#2196F3",
"accent_color": "#FFFFFF",
"icon_style": "square",
"symbol": "T"
}- Fork the repository
- Add new icon styles or features
- Update documentation
- Submit a pull request
This tool is provided as-is for Flutter development. Feel free to modify and distribute.
Happy icon generating! π¨β¨