diff --git a/MIGRATION_PLAN.md b/MIGRATION_PLAN.md index 162c6c6..8d84f8c 100644 --- a/MIGRATION_PLAN.md +++ b/MIGRATION_PLAN.md @@ -349,10 +349,10 @@ Source of truth for the step-by-step rebuild. Keep this concise and up to date. - Phase 11.8: Plugin support (LSP, Telescope, Gitsigns, etc.) ## Phase 11.2 — Extract Paper Tonic color palette -- [ ] Create `lua/paper-tonic-modern/colors.lua` -- [ ] Extract all `c_*` color variables from Paper Tonic -- [ ] Document what each color represents (foreground, background, accent colors) -- [ ] Convert to modern format (keep hex, 256-color, ANSI mappings) +- [x] Create `lua/paper-tonic-modern/colors.lua` +- [x] Extract all `c_*` color variables from Paper Tonic +- [x] Document what each color represents (foreground, background, accent colors) +- [x] Convert to modern format (keep hex, 256-color, ANSI mappings) ## Phase 11.3 — Create colorscheme structure - [ ] Create directory structure: diff --git a/README.md b/README.md index 1c08659..b5a3b16 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,13 @@ Record every decision here with a short rationale. Append new entries; do not re - **Templates**: Shell script template (template.sh) auto-loaded via BufNewFile autocmd for `*.sh` files - **Whitespace highlighting**: Already handled via `listchars` in Phase 3.2 (settings.lua) - **Persistent folds**: Not needed; UFO handles folding without explicit persistence mechanism +- 2025-12-11: Colorscheme Phase 11.2: + - **Color palette extraction**: Extracted all 45 color definitions from original Paper Tonic colorscheme + - **Structure**: Created `lua/paper-tonic-modern/colors.lua` with comprehensive documentation + - **Categories**: Background colors (main, UI, highlights, status), foreground colors (text grays, exceptions), alerts/diagnostics, primary accents (brownish-red), and secondary accents (green/blue/cyan/magenta palettes) + - **Format**: Each color defined as `{hex, 256-color, ansi}` tuple for broad terminal compatibility + - **Philosophy**: Light, paper-like theme with subtle colors for long reading sessions + - **Next steps**: Phase 11.3 will create colorscheme structure and entry point ## Project-Local Configuration (design) diff --git a/lua/paper-tonic-modern/colors.lua b/lua/paper-tonic-modern/colors.lua new file mode 100644 index 0000000..62a3f76 --- /dev/null +++ b/lua/paper-tonic-modern/colors.lua @@ -0,0 +1,159 @@ +-- Paper Tonic Modern - Color Palette +-- Extracted from original Paper Tonic colorscheme +-- Light, paper-like theme with subtle colors + +local M = {} + +-- Color format: { hex, 256-color, ansi } +-- hex: Hexadecimal color code for GUI (GVim/MacVim/terminal with true color) +-- 256: Integer 0-255 for 256-color terminals +-- ansi: ANSI color name for basic 16-color terminals + +-- ============================================================================ +-- Background Colors +-- ============================================================================ + +-- Main background: pure white paper +M.bg = {'#ffffff', 255, 'white'} + +-- Darkest background: used for very strong contrast elements +M.bg_darkest = {'#505050', 244, 'gray'} + +-- UI background: slightly off-white for UI elements (statusline, etc.) +M.bg_ui = {'#efefef', 0, 'darkgray'} + +-- ============================================================================ +-- Highlight Backgrounds (general) +-- ============================================================================ + +-- Selection/highlight backgrounds (neutral gray tones) +M.bg_hl_strong = {"#dddddd", 17, "white"} +M.bg_hl = {"#eeeeee", 250, "white"} +M.bg_hl_weak = {"#f7f2f2", 250, "white"} + +-- Special highlight backgrounds (cyan/blue tones - for LSP references, search, etc.) +M.bg_hl_special_strong = {"#a3e0ff", 17, "cyan"} +M.bg_hl_special = {"#d4f0ff", 250, "cyan"} +M.bg_hl_special_weak = {"#e0eaff", 250, "cyan"} + +-- Alternative special highlight (green tones - for diff additions, etc.) +M.bg_hl_special_alt_strong = {"#74f283", 17, "cyan"} +M.bg_hl_special_alt = {"#bff2cd", 250, "cyan"} + +-- ============================================================================ +-- Status Backgrounds (error, success, modified, fail) +-- ============================================================================ + +-- Error backgrounds (red/pink tones) +M.bg_error = {'#ffd7d7', 196, 'white'} +M.bg_error_weak = {'#ffefef', 196, 'white'} + +-- Success background (green tone) +M.bg_success = {'#e0ece0', 196, 'white'} + +-- Modified background (blue tone) +M.bg_modified = {'#e0e0ec', 196, 'white'} + +-- Fail/warning background (red tone) +M.bg_fail = {'#ece0e0', 196, 'white'} + +-- ============================================================================ +-- Foreground Colors (text) +-- ============================================================================ + +-- Main text colors (gray scale, strongest to weakest) +M.fg_stronger = {'#444444', 236, 'darkgrey'} -- Darkest text +M.fg_strong = {'#666666', 236, 'darkgrey'} -- Dark text +M.fg = {'#8c8c8c', 244, 'gray'} -- Normal text (default) +M.fg_weak = {'#9d9d9d', 251, 'gray'} -- Light text (comments, less important) +M.fg_weaker = {'#bbbbbb', 251, 'gray'} -- Lightest text (very subtle) + +-- Exception foreground (reddish-brown for errors/exceptions) +M.fg_exception = {'#7c4444', 251, 'gray'} + +-- ============================================================================ +-- Status Foreground Colors +-- ============================================================================ + +-- Git/diff status indicators (used in statusline, signs, etc.) +M.success = {'#89af89', 196, 'white'} -- Success/addition (green) +M.modified = {'#8989af', 196, 'white'} -- Modified/change (blue) +M.fail = {'#af8989', 196, 'white'} -- Fail/deletion (red) + +-- ============================================================================ +-- Alert/Diagnostic Colors +-- ============================================================================ + +-- Alert colors (errors, warnings - red/orange scale) +M.alert_strong = {'#d70000', 124, 'darkred'} -- Strong error (bright red) +M.alert = {'#d75f00', 196, 'red'} -- Normal alert (orange-red) +M.alert_weak = {'#000000', 203, 'red'} -- Weak alert (black - used for text) + +-- Question/info color (black - for prompts, info messages) +M.question = {'#000000', 0, 'black'} + +-- ============================================================================ +-- Primary Accent Colors (brownish-red tones) +-- ============================================================================ + +-- Primary accent: For "base" languages +-- Used for: PHP, JavaScript, Python, etc. +-- Languages using primary: +-- - PHP: always primary (whether standalone or in tags within HTML) +-- - JavaScript: always primary (standalone or embedded) +-- - Python: always primary +-- Note: Both PHP and JS use primary; acceptable since embedded JS in PHP is discouraged +M.primary_stronger = {"#7f4b4b", 236, "black"} -- Darkest accent +M.primary_strong = {"#5a4444", 236, "black"} -- Dark accent +M.primary = {"#6b5555", 244, "gray"} -- Normal accent +M.primary_weak = {"#7c6666", 248, "darkgray"} -- Light accent + +-- ============================================================================ +-- Language-Specific Color Palettes (for mixed-language contexts) +-- ============================================================================ + +-- IMPORTANT: Each language maintains its color identity regardless of where it appears. +-- A language always uses the same color, whether standalone or embedded in another language. +-- This creates consistent visual language recognition across all contexts. +-- +-- Example: In a PHP file with HTML and CSS: +-- - PHP code: primary (brownish-red) - everywhere, including blocks +-- - HTML tags: c3 (blue) - everywhere, whether in .html or embedded in PHP +-- - CSS rules: c2 (green) - everywhere, whether in .css or