Replace the smoke-test main() with a proper argparse CLI that accepts
a URL and --name, validates the name, fetches + extracts + analyzes the
article, calls generate_theme_yaml(), and writes the YAML to
toolkit/themes/. Prints a human-readable theme report with color values
and typography. Adds `learn-theme` subcommand to toolkit/cli.py
(delegates to subprocess call of scripts/learn_theme.py).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add `generate_theme_yaml()` that builds a complete theme YAML by loading
the professional-clean template CSS, substituting extracted colors and
typography, and deriving a dark-mode palette via `derive_darkmode()`.
Adds `import yaml`, `import argparse`, `from pathlib import Path`, and
module-level constants `TEMPLATE_THEME` / `THEMES_DIR`.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- fetch_article: catch RequestException, add raise_for_status()
- Extract _attach_title() shared by fetch_article and _load_from_file
- text_light: only search foreground colors, not background values
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Excludes dominant text color from accent candidates; blockquote-first
quote_bg heuristic avoids picking up decorative divider colors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>