v2.0.0
Major Release - Architectural Rewrite
This release restructures the package with improved modularity, performance, and developer experience. The core API remains backward compatible - most v1.x code continues to work without changes.
Added
- Quality Presets:
ExtractionQuality.fast,balanced, andhighfor different use cases - ExtractionConfig: Unified configuration object with quality presets and callbacks
- Performance Monitoring:
ExtractionStatswith duration, cache hits, and image type detection - Cache Management: Configurable size (default: 32), warmup API, and statistics
- Debug Callbacks:
onDebugandonErrorfor real-time insights - Diversity Control: Configurable weight (0.0-2.0) to prevent selecting similar colors
- Comprehensive Tests: 59 unit tests covering all core algorithms
- Extensive Documentation: 15+ usage examples and migration guide
Changed
- Modular Architecture: Refactored from 1636-line monolithic file into 12 clean modules
- Improved WCAG Compliance: More reliable contrast ratio calculations
- Better Default Parameters: Optimized for real-world performance
- Enhanced Theme Generation: Fixed color contrast bugs, improved fallback behavior
- Larger Cache: Increased from 16 to 32 entries by default
Performance
Typical extraction times (MacBook Pro M1, Release mode):
| Quality | Time | Use Case |
|---|---|---|
| Fast | 30-50ms | Lists, thumbnails |
| Balanced | 60-90ms | General use (default) |
| High | 90-140ms | Hero images |
| Cache Hit | <1ms | All cached images |