From 0788ce68c4c43148d3d5fa173b4fe46aa10371c9 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 26 Nov 2026 03:40:00 -0300 Subject: themes, colors, gen_themes: every theme file in the v2 names, values unchanged (the themes programme's L3; DESIGN.md B2, B3, B8, E1, G4, G6), the fields the new names derive deleted, the comptime fold of the old names gone, each faithful port's file saying each own colour pardes moves to meet a floor, and E1's five fixes: THE FILES: core/themes/*.zig renamed by a script (bg page, fg text, tag_bg tag, tag_fg tag_text, box accent, sel_bg selection, kw keyword, str string, num number, palette ansi, sel_fg selection_text, tag_active_* tag_focus*, tag_name_fg tag_name, tagline_* workspace*, lineno* line_number*, search_bg hit, diagnostic_* the severities, border rule, scroll_* rail*, empty_col empty_column, box_border grip_ring, box_dirty dirty, column_box column_grip, tag_sel_bg tag_selection; seoul256's level rows and their citations too), box_dim, column_box_dim, tag_active_name_fg, search_fg and acme's tag_reading_bg deleted with the lines citing them (B8: always derived; G1': acme's #f3f0cc reading tint goes with the ground), acme's sweep_bg and sweep_fg one `sweeps`; tools/gen_themes.zig writes the generated ones in the same names (its emitted box_dim, the selection again, gone); `colors.fold` folds the files into `Theme` itself (a field no Theme has is a compile error; `as` turns acme's sweep literals into Theme.Sweep, which a literal's own struct type does not coerce to); `legacy_themes`, the ring folded in the old names at comptime, deleted: THE OLD NAMES' VIEW (what draw.zig and the old ChromeTheme and Roles still read until L2a) is a ring theme's chrome's, `ChromeTheme.view`, filled from its Chrome as L1 filled a new-names ThemeFile's (`viewOf`: the old required fields a theme leaves unset, and the derived ones: box_dim a resting grip's fill, the tag's own ground where a theme rings its grips itself (acme's clean button, so its grid grip keeps its look) else the resting ring; tag_active_name_fg `name[1]`, column_box_dim `grip.column_rest`); `Pardes.theme()` reads it (a ThemeFile's, the file itself, as before); ChromeTheme.box, the focused grip the grid fills, is the chrome's `grip.focus` (the accent held 3:1, R6: ayu_light's accent, 2:1 on its tag, was its resting ring too, and the grid drew its focused and resting grips alike); the library's `Theme` and `themes` are the v2 ones (lib_syntax: page, ink and synInk read page, text, keyword, string, number, comment; Grounds.of takes a Theme), runtime/macos.zig's bare page reads `themes[0].page`; E1's FIXES (the ring test's L3 list): acme's sixteen each 4.5:1 on its page, the native floor (6, 8 and 13 held darker in their hue; 10, 11 and 14, held there, landed on their normal colour and go 0.06 OKLab darker than it, R14's bright on a light page: #038384 #757575 #016e08 #785300 #b942b9 #017070); solarized_dark's, solarized_light's and seoul256's light levels' search hit their own hue as a ground the text reads on (#1d180e, #ffeb99, #a6e6fe; each file says from what and why); R8 takes a theme's own hit at R0's visible alternative, 1.1:1 off the page with 0.08 OKLab, only where its text leaves no room for 1.5:1 (no ground that far off keeps the text its floor: those four and forge_soft and ayu_light, whose own hits are taken now where an amber stood; no other theme's hit moves), else E1's `hit` fixes could not be met; G4: core/themes' ports say, under "Moved by pardes as it loads", each own colour Chrome.of moves (focused tag and grip, the resting and unsaved grip, the selection and its ink, the hit, the four severities on the page; 267 lines over 54 files, written from the test's own output by .scratch/themes/L3457/tools/g4_headers.py); RUN (TEST FIRST): colors.zig "every faithful port's file says each of its own colours pardes moves to meet a floor (DESIGN.md G4)" (each port's own value Chrome.of moves, as `role #own -> #got`, found in its file): fails on the renamed files with 273 unsaid, passes now; "every theme in the ring meets every floor ..." with L3's five taken off its list: acme fails ansi and ansi_pro, solarized_dark, solarized_light, seoul256_light_254 and _255 fail hit, all five pass now: 266 of 285 themes pass (261 at L1), 19 on the list (L4 6, L5 1, L7 8, soft 4); draw.zig's "an unfocused reading pane's box in the grid is its ring round the reading tint where the box's fill is the tag's own ground (acme's)" failed on the first view (acme's resting fill its ring), passes with the tag's ground; "a grip's four states ... are each its own" failed in ayu_light on the raw accent, passes on grip.focus; the old tests that pinned the deleted fields' file values keep what is still a file's (a name's tint at its tag ink's lightness, the accent off the column grip; the helix document test strips the derived fields too; the names test reads Chrome's names, an ink held to white or black its own name, ao's and modus_vivendi's); the consumer's lib.zig pins orchard's page, ink and syntax unchanged (dark's page its `.tag`); the ring's values unchanged by the rename (the ring test's count and every original's colour asserted unmoved); core-test 1133/1306 (173 skipped: L2b's 1132/1305 + the G4 test); OUTSIDE my files: core/Core.zig `theme()` (the view), core/lib_syntax.zig (v2 Theme), runtime/macos.zig `pardes_theme_bg` (one line), test/consumer/lib.zig (`.tag`); the process goldens move with the view (the grid's resting grip, the focused name's tint, the column grip at rest, acme's reading grip) and are re-recorded and read at the programme's end gate; no dump or digest change (the view is the chrome's, a `local` field) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE --- core/themes/seoul256.zig | 341 +++++++++++++++++++++++++++-------------------- 1 file changed, 196 insertions(+), 145 deletions(-) (limited to 'core/themes/seoul256.zig') diff --git a/core/themes/seoul256.zig b/core/themes/seoul256.zig index d51ec310..0c4c17ab 100644 --- a/core/themes/seoul256.zig +++ b/core/themes/seoul256.zig @@ -35,164 +35,220 @@ //! so, its tabline_fg or tabline_bg role lands on an xterm index missing //! from the default s:rgb_map, so Vim emits gui*=NONE and it inherits //! Normal (given as such). +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - dark_233: focused tag ground #9a7372 -> #4e4d4e: 3.08:1 off the tag, now 1.52:1 (R4, H: a focus step off the tag, and the loudest) +//! - dark_233: focused grip #006a6c -> #55a8aa: 1.31:1 on the focused tag, now 3.03:1 (R6: 3:1) +//! - dark_233, dark_234, dark_235, dark_236, dark_237: selection text #d9d9d9 -> #e3e3e3: 4.12:1 on the selection, now 4.53:1 (R7: 4.5:1) +//! - dark_233: search hit #007299 -> #582929: 3.30:1 off the page, now 1.51:1 (R8: 1.5:1, the text reading on it) +//! - dark_233: error #e12672 -> #eb337a: 4.03:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) +//! - dark_234: focused tag ground #9a7372 -> #595959: 2.54:1 off the tag, now 1.50:1 (R4, H: a focus step off the tag, and the loudest) +//! - dark_234: focused grip #006a6c -> #64b7b8: 1.09:1 on the focused tag, now 3.00:1 (R6: 3:1) +//! - dark_234: unsaved grip #719cdf -> #80acf0: 3.77:1 on the tag, now 4.55:1 (R6: 3:1 on both tags) +//! - dark_234: search hit #007299 -> #643333: 2.82:1 off the page, now 1.51:1 (R8: 1.5:1, the text reading on it) +//! - dark_234: error #e12672 -> #fa4386: 3.45:1 on the page, now 4.53:1 (R9: 4.5:1, told from the text and the others) +//! - dark_235: focused tag ground #9a7372 -> #666666: 2.11:1 off the tag, now 1.52:1 (R4, H: a focus step off the tag, and the loudest) +//! - dark_235: focused grip #006a6c -> #76c9ca: 1.12:1 on the focused tag, now 3.00:1 (R6: 3:1) +//! - dark_235: unsaved grip #719cdf -> #94befe: 3.13:1 on the tag, now 4.59:1 (R6: 3:1 on both tags) +//! - dark_235: search hit #007299 -> #723f3f: 2.35:1 off the page, now 1.52:1 (R8: 1.5:1, the text reading on it) +//! - dark_235: error #e12672 -> #ff6395: 2.87:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) +//! - dark_236: focused tag ground #9a7372 -> #717171: 1.77:1 off the tag, now 1.50:1 (R4, H: a focus step off the tag, and the loudest) +//! - dark_236: focused grip #006a6c -> #86d9da: 1.31:1 on the focused tag, now 3.01:1 (R6: 3:1) +//! - dark_236: unsaved grip #719cdf -> #adcdfe: 2.63:1 on the tag, now 4.52:1 (R6: 3:1 on both tags) +//! - dark_236: search hit #007299 -> #7e4b4a: 1.94:1 off the page, now 1.50:1 (R8: 1.5:1, the text reading on it) +//! - dark_236: error #e12672 -> #ff82a5: 2.37:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) +//! - dark_237: tag ground #616161 -> #545454: 1.41:1 off the page, now 1.15:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - dark_237: focused tag ground #9d7473 -> #6f6f6f: 1.87:1 off the tag, now 1.51:1 (R4, H: a focus step off the tag, and the loudest) +//! - dark_237: focused grip #006c6e -> #82d6d8: 1.24:1 on the focused tag, now 3.01:1 (R6: 3:1) +//! - dark_237: unsaved grip #719cdf -> #a8cafe: 2.71:1 on the tag, now 4.52:1 (R6: 3:1 on both tags) +//! - dark_237: search hit #007299 -> #7a5932: 1.61:1 off the page, now 1.37:1 (R8: 1.5:1, the text reading on it) +//! - dark_237: error #e12672 -> #fe9fb7: 1.96:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) +//! - dark_237: warning #e09b99 -> #deb565: 3.87:1 on the page, now 4.53:1 (R9: 4.5:1, told from the text and the others) +//! - dark_238: tag ground #6b6b6b -> #606060: 1.38:1 off the page, now 1.17:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - dark_238: focused tag ground #b97877 -> #7c7c7c: 1.80:1 off the tag, now 1.51:1 (R4, H: a focus step off the tag, and the loudest) +//! - dark_238: focused grip #007173 -> #003a3c: 1.39:1 on the focused tag, now 3.01:1 (R6: 3:1) +//! - dark_238: unsaved grip #719cdf -> #c7ddfe: 2.25:1 on the tag, now 4.55:1 (R6: 3:1 on both tags) +//! - dark_238: selection #007173 -> #13797b: 1.26:1 off the page, now 1.42:1 (R7) +//! - dark_238: selection text #d9d9d9 -> #efefef: 3.67:1 on the selection, now 4.51:1 (R7: 4.5:1) +//! - dark_238: search hit #007299 -> #7a5932: 1.35:1 off the page, now 1.15:1 (R8: 1.5:1, the text reading on it) +//! - dark_238: error #e12672 -> #feb8c8: 1.65:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) +//! - dark_238: warning #e09b99 -> #eec575: 3.26:1 on the page, now 4.50:1 (R9: 4.5:1, told from the text and the others) +//! - dark_239: focused tag ground #ac8f86 -> #949494: 1.54:1 off the tag, now 1.52:1 (R4, H: a focus step off the tag, and the loudest) +//! - dark_239: focused grip #007173 -> #005153: 1.92:1 on the focused tag, now 3.01:1 (R6: 3:1) +//! - dark_239: unsaved grip #719cdf -> #032a63: 1.65:1 on the tag, now 3.01:1 (R6: 3:1 on both tags) +//! - dark_239: selection #007173 -> #278587: 1.06:1 off the page, now 1.41:1 (R7) +//! - dark_239: selection text #d9d9d9 -> #0a0a0a: 3.11:1 on the selection, now 4.52:1 (R7: 4.5:1) +//! - dark_239: search hit #007299 -> #83613a: 1.14:1 off the page, now 1.10:1 (R8: 1.5:1, the text reading on it) +//! - dark_239: error #e12672 -> #ffd2d0: 1.39:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) +//! - dark_239: warning #e09b99 -> #ffd78b: 2.75:1 on the page, now 4.53:1 (R9: 4.5:1, told from the text and the others) +//! - light_252, light_253, light_254, light_255, light_256: focused grip #4b6465 -> #213839: 1.53:1 on the focused tag, now 3.00:1 (R6: 3:1) +//! - light_252: unsaved grip #719cdf -> #0b326c: 1.67:1 on the tag, now 7.44:1 (R6: 3:1 on both tags) +//! - light_252: selection #bcdede -> #a8c9c9: 1.02:1 off the page, now 1.25:1 (R7) +//! - light_252: selection text #616161 -> #505050: 3.50:1 on the selection, now 4.56:1 (R7: 4.5:1) +//! - light_252: search hit #a6e6fe -> #febfbc: 1.03:1 off the page, now 1.11:1 (R8: 1.5:1, the text reading on it) +//! - light_252: error #e12672 -> #bc045a: 3.15:1 on the page, now 4.50:1 (R9: 4.5:1, told from the text and the others) +//! - light_252: warning #be7572 -> #904b4a: 2.49:1 on the page, now 4.52:1 (R9: 4.5:1, told from the text and the others) +//! - light_253: unsaved grip #719cdf -> #0b326c: 1.81:1 on the tag, now 8.09:1 (R6: 3:1 on both tags) +//! - light_253: selection #bcdede -> #aed0d0: 1.10:1 off the page, now 1.26:1 (R7) +//! - light_253: selection text #616161 -> #555555: 3.76:1 on the selection, now 4.52:1 (R7: 4.5:1) +//! - light_253: search hit #a6e6fe -> #fecac7: 1.04:1 off the page, now 1.11:1 (R8: 1.5:1, the text reading on it) +//! - light_253: error #e12672 -> #c4095f: 3.40:1 on the page, now 4.52:1 (R9: 4.5:1, told from the text and the others) +//! - light_253: warning #be7572 -> #95504f: 2.69:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) +//! - light_254: unsaved grip #719cdf -> #0b326c: 1.98:1 on the tag, now 8.82:1 (R6: 3:1 on both tags) +//! - light_254: selection #bcdede -> #b7d8d8: 1.18:1 off the page, now 1.25:1 (R7) +//! - light_254: selection text #616161 -> #5a5a5a: 4.08:1 on the selection, now 4.54:1 (R7: 4.5:1) +//! - light_254: error #e12672 -> #cf0064: 3.66:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) +//! - light_254: warning #be7572 -> #9b5553: 2.89:1 on the page, now 4.53:1 (R9: 4.5:1, told from the text and the others) +//! - light_255: unsaved grip #719cdf -> #0b326c: 2.13:1 on the tag, now 9.52:1 (R6: 3:1 on both tags) +//! - light_255, light_256: selection text #616161 -> #5e5e5e: 4.32:1 on the selection, now 4.52:1 (R7: 4.5:1) +//! - light_255: error #e12672 -> #d51169: 3.94:1 on the page, now 4.52:1 (R9: 4.5:1, told from the text and the others) +//! - light_255: warning #be7572 -> #a05a58: 3.11:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) +//! - light_256: unsaved grip #719cdf -> #0b326c: 2.30:1 on the tag, now 10.25:1 (R6: 3:1 on both tags) +//! - light_256: error #e12672 -> #df2471: 4.45:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) +//! - light_256: warning #be7572 -> #aa6361: 3.51:1 on the page, now 4.50:1 (R9: 4.5:1, told from the text and the others) const std = @import("std"); /// What a dark level changes; each row cites where its values come from. const Dark = struct { level: u16, - bg: [3]u8, - tag_bg: [3]u8, - tag_fg: [3]u8, - tag_active_bg: [3]u8, - tag_active_fg: [3]u8, - box: [3]u8, - box_dim: [3]u8, - border: [3]u8, + page: [3]u8, + tag: [3]u8, + tag_text: [3]u8, + tag_focus: [3]u8, + tag_focus_text: [3]u8, + accent: [3]u8, + rule: [3]u8, }; const dark_levels = [_]Dark{ - // bg: S:206 Normal guibg = s:hi arg s:dark_bg = 233 -> s:rgb_map[233] S:132 - // tag_bg: S:351 StatusLineNC guifg = s:hi arg s:dark_bg + 2 = 235 -> s:rgb_map[235] S:132 - // tag_fg: S:351 StatusLineNC guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129 - // tag_active_bg: S:350 StatusLine guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124 - // box_dim: derived: the grip at rest, the accent #007173 faded toward the unfocused tag #333233 as far as 1.6:1 off it (0.66 of the way) - // border: S:287 VertSplit guifg = s:hi arg s:dark_bg_2 = 16 -> s:rgb_map[16] S:120 #000000, adjusted + // page: S:206 Normal guibg = s:hi arg s:dark_bg = 233 -> s:rgb_map[233] S:132 + // tag: S:351 StatusLineNC guifg = s:hi arg s:dark_bg + 2 = 235 -> s:rgb_map[235] S:132 + // tag_text: S:351 StatusLineNC guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129 + // tag_focus: S:350 StatusLine guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124 + // rule: S:287 VertSplit guifg = s:hi arg s:dark_bg_2 = 16 -> s:rgb_map[16] S:120 #000000, adjusted // adjusted: focused tag text #dfdebd -> #12120f: 3.02:1 on #9a7372, tag text needs 4.5:1 // adjusted: focused grip #007173 -> #006a6c: 1.40:1 on the focused tag #9a7372 // adjusted: rules between panes #000000 -> #3d3d3d: 1.17:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) // index gap: tabline_fg inherits Normal - .{ .level = 233, .bg = .{ 0x17, 0x17, 0x17 }, .tag_bg = .{ 0x33, 0x32, 0x33 }, .tag_fg = .{ 0xdf, 0xde, 0xbd }, .tag_active_bg = .{ 0x9a, 0x73, 0x72 }, .tag_active_fg = .{ 0x12, 0x12, 0x0f }, .box = .{ 0x00, 0x6a, 0x6c }, .box_dim = .{ 0x11, 0x5c, 0x5d }, .border = .{ 0x3d, 0x3d, 0x3d } }, - // bg: S:206 Normal guibg = s:hi arg s:dark_bg = 234 -> s:rgb_map[234] S:132 - // tag_bg: S:351 StatusLineNC guifg = s:hi arg s:dark_bg + 2 = 236 -> s:rgb_map[236] S:132 - // tag_fg: S:351 StatusLineNC guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129 - // tag_active_bg: S:350 StatusLine guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124 - // box_dim: derived: the grip at rest, the accent #007173 faded toward the unfocused tag #3f3f3f as far as 1.6:1 off it (0.84 of the way) - // border: S:287 VertSplit guifg = s:hi arg s:dark_bg_2 = 232 -> s:rgb_map[232] S:131 #060606, adjusted + .{ .level = 233, .page = .{ 0x17, 0x17, 0x17 }, .tag = .{ 0x33, 0x32, 0x33 }, .tag_text = .{ 0xdf, 0xde, 0xbd }, .tag_focus = .{ 0x9a, 0x73, 0x72 }, .tag_focus_text = .{ 0x12, 0x12, 0x0f }, .accent = .{ 0x00, 0x6a, 0x6c }, .rule = .{ 0x3d, 0x3d, 0x3d } }, + // page: S:206 Normal guibg = s:hi arg s:dark_bg = 234 -> s:rgb_map[234] S:132 + // tag: S:351 StatusLineNC guifg = s:hi arg s:dark_bg + 2 = 236 -> s:rgb_map[236] S:132 + // tag_text: S:351 StatusLineNC guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129 + // tag_focus: S:350 StatusLine guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124 + // rule: S:287 VertSplit guifg = s:hi arg s:dark_bg_2 = 232 -> s:rgb_map[232] S:131 #060606, adjusted // adjusted: focused tag text #dfdebd -> #12120f: 3.02:1 on #9a7372, tag text needs 4.5:1 // adjusted: focused grip #007173 -> #006a6c: 1.40:1 on the focused tag #9a7372 // adjusted: rules between panes #060606 -> #4a4a4a: 1.32:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) // index gap: tabline_fg inherits Normal - .{ .level = 234, .bg = .{ 0x25, 0x25, 0x25 }, .tag_bg = .{ 0x3f, 0x3f, 0x3f }, .tag_fg = .{ 0xdf, 0xde, 0xbd }, .tag_active_bg = .{ 0x9a, 0x73, 0x72 }, .tag_active_fg = .{ 0x12, 0x12, 0x0f }, .box = .{ 0x00, 0x6a, 0x6c }, .box_dim = .{ 0x0a, 0x69, 0x6b }, .border = .{ 0x4a, 0x4a, 0x4a } }, - // bg: S:206 Normal guibg = s:hi arg s:dark_bg = 235 -> s:rgb_map[235] S:132 - // tag_bg: S:351 StatusLineNC guifg = s:hi arg s:dark_bg + 2 = 237 -> s:rgb_map[237] S:132 - // tag_fg: S:351 StatusLineNC guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129 - // tag_active_bg: S:350 StatusLine guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124 - // box_dim: derived: the grip at rest, the accent #007173 faded toward the unfocused tag #4b4b4b as far as 1.6:1 off it (1.00 of the way) - // border: S:287 VertSplit guifg = s:hi arg s:dark_bg_2 = 233 -> s:rgb_map[233] S:132 #171717, adjusted + .{ .level = 234, .page = .{ 0x25, 0x25, 0x25 }, .tag = .{ 0x3f, 0x3f, 0x3f }, .tag_text = .{ 0xdf, 0xde, 0xbd }, .tag_focus = .{ 0x9a, 0x73, 0x72 }, .tag_focus_text = .{ 0x12, 0x12, 0x0f }, .accent = .{ 0x00, 0x6a, 0x6c }, .rule = .{ 0x4a, 0x4a, 0x4a } }, + // page: S:206 Normal guibg = s:hi arg s:dark_bg = 235 -> s:rgb_map[235] S:132 + // tag: S:351 StatusLineNC guifg = s:hi arg s:dark_bg + 2 = 237 -> s:rgb_map[237] S:132 + // tag_text: S:351 StatusLineNC guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129 + // tag_focus: S:350 StatusLine guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124 + // rule: S:287 VertSplit guifg = s:hi arg s:dark_bg_2 = 233 -> s:rgb_map[233] S:132 #171717, adjusted // adjusted: focused tag text #dfdebd -> #12120f: 3.02:1 on #9a7372, tag text needs 4.5:1 // adjusted: focused grip #007173 -> #006a6c: 1.40:1 on the focused tag #9a7372 // adjusted: rules between panes #171717 -> #515151: 1.40:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) // index gap: tabline_fg inherits Normal - .{ .level = 235, .bg = .{ 0x33, 0x32, 0x33 }, .tag_bg = .{ 0x4b, 0x4b, 0x4b }, .tag_fg = .{ 0xdf, 0xde, 0xbd }, .tag_active_bg = .{ 0x9a, 0x73, 0x72 }, .tag_active_fg = .{ 0x12, 0x12, 0x0f }, .box = .{ 0x00, 0x6a, 0x6c }, .box_dim = .{ 0x0a, 0x77, 0x79 }, .border = .{ 0x51, 0x51, 0x51 } }, - // bg: S:206 Normal guibg = s:hi arg s:dark_bg = 236 -> s:rgb_map[236] S:132 - // tag_bg: S:351 StatusLineNC guifg = s:hi arg s:dark_bg + 2 = 238 -> s:rgb_map[238] S:133 - // tag_fg: S:351 StatusLineNC guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129 - // tag_active_bg: S:350 StatusLine guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124 - // box_dim: derived: the grip at rest, the accent #007173 faded toward the unfocused tag #565656 as far as 1.6:1 off it (1.00 of the way) - // border: S:287 VertSplit guifg = s:hi arg s:dark_bg_2 = 234 -> s:rgb_map[234] S:132 #252525, adjusted + .{ .level = 235, .page = .{ 0x33, 0x32, 0x33 }, .tag = .{ 0x4b, 0x4b, 0x4b }, .tag_text = .{ 0xdf, 0xde, 0xbd }, .tag_focus = .{ 0x9a, 0x73, 0x72 }, .tag_focus_text = .{ 0x12, 0x12, 0x0f }, .accent = .{ 0x00, 0x6a, 0x6c }, .rule = .{ 0x51, 0x51, 0x51 } }, + // page: S:206 Normal guibg = s:hi arg s:dark_bg = 236 -> s:rgb_map[236] S:132 + // tag: S:351 StatusLineNC guifg = s:hi arg s:dark_bg + 2 = 238 -> s:rgb_map[238] S:133 + // tag_text: S:351 StatusLineNC guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129 + // tag_focus: S:350 StatusLine guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124 + // rule: S:287 VertSplit guifg = s:hi arg s:dark_bg_2 = 234 -> s:rgb_map[234] S:132 #252525, adjusted // adjusted: focused tag text #dfdebd -> #12120f: 3.02:1 on #9a7372, tag text needs 4.5:1 // adjusted: focused grip #007173 -> #006a6c: 1.40:1 on the focused tag #9a7372 // adjusted: rules between panes #252525 -> #5f5f5f: 1.46:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) // index gap: tabline_fg inherits Normal - .{ .level = 236, .bg = .{ 0x3f, 0x3f, 0x3f }, .tag_bg = .{ 0x56, 0x56, 0x56 }, .tag_fg = .{ 0xdf, 0xde, 0xbd }, .tag_active_bg = .{ 0x9a, 0x73, 0x72 }, .tag_active_fg = .{ 0x12, 0x12, 0x0f }, .box = .{ 0x00, 0x6a, 0x6c }, .box_dim = .{ 0x24, 0x85, 0x87 }, .border = .{ 0x5f, 0x5f, 0x5f } }, - // bg: S:206 Normal guibg = s:hi arg s:dark_bg = 237 -> s:rgb_map[237] S:132 - // tag_bg: S:351 StatusLineNC guifg = s:hi arg s:dark_bg + 2 = 239 -> s:rgb_map[239] S:133 - // tag_fg: S:351 StatusLineNC guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129 - // tag_active_bg: S:350 StatusLine guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124 #9a7372, adjusted - // box_dim: derived: the grip at rest, the accent #007173 faded toward the unfocused tag #616161 as far as 1.6:1 off it (1.00 of the way) - // border: S:287 VertSplit guifg = s:hi arg s:dark_bg_2 = 235 -> s:rgb_map[235] S:132 #333233, adjusted + .{ .level = 236, .page = .{ 0x3f, 0x3f, 0x3f }, .tag = .{ 0x56, 0x56, 0x56 }, .tag_text = .{ 0xdf, 0xde, 0xbd }, .tag_focus = .{ 0x9a, 0x73, 0x72 }, .tag_focus_text = .{ 0x12, 0x12, 0x0f }, .accent = .{ 0x00, 0x6a, 0x6c }, .rule = .{ 0x5f, 0x5f, 0x5f } }, + // page: S:206 Normal guibg = s:hi arg s:dark_bg = 237 -> s:rgb_map[237] S:132 + // tag: S:351 StatusLineNC guifg = s:hi arg s:dark_bg + 2 = 239 -> s:rgb_map[239] S:133 + // tag_text: S:351 StatusLineNC guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129 + // tag_focus: S:350 StatusLine guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124 #9a7372, adjusted + // rule: S:287 VertSplit guifg = s:hi arg s:dark_bg_2 = 235 -> s:rgb_map[235] S:132 #333233, adjusted // adjusted: focused tag ground #9a7372 -> #9d7473: 1.50:1 off the unfocused #616161, pardes needs 1.5:1 on a dark page // adjusted: focused tag text #dfdebd -> #12120f: 2.96:1 on #9d7473, tag text needs 4.5:1 // adjusted: focused grip #007173 -> #006c6e: 1.43:1 on the focused tag #9d7473 // adjusted: rules between panes #333233 -> #6b6b6b: 1.46:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) - .{ .level = 237, .bg = .{ 0x4b, 0x4b, 0x4b }, .tag_bg = .{ 0x61, 0x61, 0x61 }, .tag_fg = .{ 0xdf, 0xde, 0xbd }, .tag_active_bg = .{ 0x9d, 0x74, 0x73 }, .tag_active_fg = .{ 0x12, 0x12, 0x0f }, .box = .{ 0x00, 0x6c, 0x6e }, .box_dim = .{ 0x38, 0x90, 0x92 }, .border = .{ 0x6b, 0x6b, 0x6b } }, - // bg: S:206 Normal guibg = s:hi arg s:dark_bg = 238 -> s:rgb_map[238] S:133 - // tag_bg: S:351 StatusLineNC guifg = s:hi arg s:dark_bg + 2 = 240 -> s:rgb_map[240] S:133 - // tag_fg: S:351 StatusLineNC guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129 #dfdebd, adjusted - // tag_active_bg: S:350 StatusLine guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124 #9a7372, adjusted - // box_dim: derived: the grip at rest, the accent #007173 faded toward the unfocused tag #6b6b6b as far as 1.6:1 off it (1.00 of the way) - // border: S:287 VertSplit guifg = s:hi arg s:dark_bg_2 = 236 -> s:rgb_map[236] S:132 #3f3f3f, adjusted + .{ .level = 237, .page = .{ 0x4b, 0x4b, 0x4b }, .tag = .{ 0x61, 0x61, 0x61 }, .tag_text = .{ 0xdf, 0xde, 0xbd }, .tag_focus = .{ 0x9d, 0x74, 0x73 }, .tag_focus_text = .{ 0x12, 0x12, 0x0f }, .accent = .{ 0x00, 0x6c, 0x6e }, .rule = .{ 0x6b, 0x6b, 0x6b } }, + // page: S:206 Normal guibg = s:hi arg s:dark_bg = 238 -> s:rgb_map[238] S:133 + // tag: S:351 StatusLineNC guifg = s:hi arg s:dark_bg + 2 = 240 -> s:rgb_map[240] S:133 + // tag_text: S:351 StatusLineNC guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129 #dfdebd, adjusted + // tag_focus: S:350 StatusLine guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124 #9a7372, adjusted + // rule: S:287 VertSplit guifg = s:hi arg s:dark_bg_2 = 236 -> s:rgb_map[236] S:132 #3f3f3f, adjusted // adjusted: focused tag ground #9a7372 -> #b97877: 1.29:1 off the unfocused #6b6b6b, pardes needs 1.5:1 on a dark page // adjusted: unfocused tag text #dfdebd -> #eeeddb: 3.89:1 on #6b6b6b, tag text needs 4.5:1 to be read and run // adjusted: focused tag text #dfdebd -> #1f1f1a: 2.55:1 on #b97877, tag text needs 4.5:1 // adjusted: rules between panes #3f3f3f -> #767676: 1.43:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) // index gap: tabline_bg inherits Normal - .{ .level = 238, .bg = .{ 0x56, 0x56, 0x56 }, .tag_bg = .{ 0x6b, 0x6b, 0x6b }, .tag_fg = .{ 0xee, 0xed, 0xdb }, .tag_active_bg = .{ 0xb9, 0x78, 0x77 }, .tag_active_fg = .{ 0x1f, 0x1f, 0x1a }, .box = .{ 0x00, 0x71, 0x73 }, .box_dim = .{ 0x4d, 0x9c, 0x9d }, .border = .{ 0x76, 0x76, 0x76 } }, - // bg: S:206 Normal guibg = s:hi arg s:dark_bg = 239 -> s:rgb_map[239] S:133 - // tag_bg: S:351 StatusLineNC guifg = s:hi arg s:dark_bg + 2 = 241 -> s:rgb_map[241] S:133 - // tag_fg: S:351 StatusLineNC guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129 #dfdebd, adjusted - // tag_active_bg: S:350 StatusLine guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124 #9a7372, adjusted - // box_dim: derived: the grip at rest, the accent #007173 faded toward the unfocused tag #757575 as far as 1.6:1 off it (1.00 of the way) - // border: S:287 VertSplit guifg = s:hi arg s:dark_bg_2 = 237 -> s:rgb_map[237] S:132 #4b4b4b, adjusted + .{ .level = 238, .page = .{ 0x56, 0x56, 0x56 }, .tag = .{ 0x6b, 0x6b, 0x6b }, .tag_text = .{ 0xee, 0xed, 0xdb }, .tag_focus = .{ 0xb9, 0x78, 0x77 }, .tag_focus_text = .{ 0x1f, 0x1f, 0x1a }, .accent = .{ 0x00, 0x71, 0x73 }, .rule = .{ 0x76, 0x76, 0x76 } }, + // page: S:206 Normal guibg = s:hi arg s:dark_bg = 239 -> s:rgb_map[239] S:133 + // tag: S:351 StatusLineNC guifg = s:hi arg s:dark_bg + 2 = 241 -> s:rgb_map[241] S:133 + // tag_text: S:351 StatusLineNC guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129 #dfdebd, adjusted + // tag_focus: S:350 StatusLine guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124 #9a7372, adjusted + // rule: S:287 VertSplit guifg = s:hi arg s:dark_bg_2 = 237 -> s:rgb_map[237] S:132 #4b4b4b, adjusted // adjusted: focused tag ground #9a7372 -> #ac8f86: 1.11:1 off the unfocused #757575, pardes needs 1.5:1 on a dark page // adjusted: unfocused tag text #dfdebd -> #fdfdfb: 3.36:1 on #757575, tag text needs 4.5:1 to be read and run // adjusted: focused tag text #dfdebd -> #2d2c26: 2.18:1 on #ac8f86, tag text needs 4.5:1 // adjusted: rules between panes #4b4b4b -> #848484: 1.41:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) // index gap: tabline_bg inherits Normal - .{ .level = 239, .bg = .{ 0x61, 0x61, 0x61 }, .tag_bg = .{ 0x75, 0x75, 0x75 }, .tag_fg = .{ 0xfd, 0xfd, 0xfb }, .tag_active_bg = .{ 0xac, 0x8f, 0x86 }, .tag_active_fg = .{ 0x2d, 0x2c, 0x26 }, .box = .{ 0x00, 0x71, 0x73 }, .box_dim = .{ 0x61, 0xa7, 0xa8 }, .border = .{ 0x84, 0x84, 0x84 } }, + .{ .level = 239, .page = .{ 0x61, 0x61, 0x61 }, .tag = .{ 0x75, 0x75, 0x75 }, .tag_text = .{ 0xfd, 0xfd, 0xfb }, .tag_focus = .{ 0xac, 0x8f, 0x86 }, .tag_focus_text = .{ 0x2d, 0x2c, 0x26 }, .accent = .{ 0x00, 0x71, 0x73 }, .rule = .{ 0x84, 0x84, 0x84 } }, }; /// What a light level changes; each row cites where its values come from. const Light = struct { level: u16, - bg: [3]u8, - tag_bg: [3]u8, - tag_fg: [3]u8, - box_dim: [3]u8, - border: [3]u8, + page: [3]u8, + tag: [3]u8, + tag_text: [3]u8, + rule: [3]u8, }; const light_levels = [_]Light{ - // bg: S:206 Normal guibg = s:hi arg s:light_bg = 252 -> s:rgb_map[252] S:134 - // tag_bg: S:351 StatusLineNC guifg = s:hi arg s:light_bg - 2 = 250 -> s:rgb_map[250] S:134 - // tag_fg: S:351 StatusLineNC guibg = s:hi arg 238 = 238 -> s:rgb_map[238] S:133 #565656, adjusted - // box_dim: derived: the grip at rest, the accent #719899 faded toward the unfocused tag #c8c8c8 as far as 1.6:1 off it (0.78 of the way) - // border: S:287 VertSplit guifg = s:hi arg s:light_bg - 3 = 249 -> s:rgb_map[249] S:133 #bfbfbf, adjusted + // page: S:206 Normal guibg = s:hi arg s:light_bg = 252 -> s:rgb_map[252] S:134 + // tag: S:351 StatusLineNC guifg = s:hi arg s:light_bg - 2 = 250 -> s:rgb_map[250] S:134 + // tag_text: S:351 StatusLineNC guibg = s:hi arg 238 = 238 -> s:rgb_map[238] S:133 #565656, adjusted + // rule: S:287 VertSplit guifg = s:hi arg s:light_bg - 3 = 249 -> s:rgb_map[249] S:133 #bfbfbf, adjusted // adjusted: unfocused tag text #565656 -> #545454: 4.39:1 on #c8c8c8, tag text needs 4.5:1 to be read and run // adjusted: focused tag text #dfdebd -> #12120f: 3.02:1 on #9a7372, tag text needs 4.5:1 // adjusted: focused grip #719899 -> #4b6465: 1.31:1 on the focused tag #9a7372 // adjusted: rules between panes #bfbfbf -> #acacac: 1.30:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) // index gap: tabline_bg inherits Normal - .{ .level = 252, .bg = .{ 0xd9, 0xd9, 0xd9 }, .tag_bg = .{ 0xc8, 0xc8, 0xc8 }, .tag_fg = .{ 0x54, 0x54, 0x54 }, .box_dim = .{ 0x84, 0xa3, 0xa3 }, .border = .{ 0xac, 0xac, 0xac } }, - // bg: S:206 Normal guibg = s:hi arg s:light_bg = 253 -> s:rgb_map[253] S:134 - // tag_bg: S:351 StatusLineNC guifg = s:hi arg s:light_bg - 2 = 251 -> s:rgb_map[251] S:134 - // tag_fg: S:351 StatusLineNC guibg = s:hi arg 238 = 238 -> s:rgb_map[238] S:133 - // box_dim: derived: the grip at rest, the accent #719899 faded toward the unfocused tag #d1d0d1 as far as 1.6:1 off it (0.70 of the way) - // border: S:287 VertSplit guifg = s:hi arg s:light_bg - 3 = 250 -> s:rgb_map[250] S:134 #c8c8c8, adjusted + .{ .level = 252, .page = .{ 0xd9, 0xd9, 0xd9 }, .tag = .{ 0xc8, 0xc8, 0xc8 }, .tag_text = .{ 0x54, 0x54, 0x54 }, .rule = .{ 0xac, 0xac, 0xac } }, + // page: S:206 Normal guibg = s:hi arg s:light_bg = 253 -> s:rgb_map[253] S:134 + // tag: S:351 StatusLineNC guifg = s:hi arg s:light_bg - 2 = 251 -> s:rgb_map[251] S:134 + // tag_text: S:351 StatusLineNC guibg = s:hi arg 238 = 238 -> s:rgb_map[238] S:133 + // rule: S:287 VertSplit guifg = s:hi arg s:light_bg - 3 = 250 -> s:rgb_map[250] S:134 #c8c8c8, adjusted // adjusted: focused tag text #dfdebd -> #12120f: 3.02:1 on #9a7372, tag text needs 4.5:1 // adjusted: focused grip #719899 -> #4b6465: 1.31:1 on the focused tag #9a7372 // adjusted: rules between panes #c8c8c8 -> #b3b3b3: 1.28:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) - .{ .level = 253, .bg = .{ 0xe1, 0xe1, 0xe1 }, .tag_bg = .{ 0xd1, 0xd0, 0xd1 }, .tag_fg = .{ 0x56, 0x56, 0x56 }, .box_dim = .{ 0x8e, 0xa9, 0xaa }, .border = .{ 0xb3, 0xb3, 0xb3 } }, - // bg: S:206 Normal guibg = s:hi arg s:light_bg = 254 -> s:rgb_map[254] S:134 - // tag_bg: S:351 StatusLineNC guifg = s:hi arg s:light_bg - 2 = 252 -> s:rgb_map[252] S:134 - // tag_fg: S:351 StatusLineNC guibg = s:hi arg 238 = 238 -> s:rgb_map[238] S:133 - // box_dim: derived: the grip at rest, the accent #719899 faded toward the unfocused tag #d9d9d9 as far as 1.6:1 off it (0.64 of the way) - // border: S:287 VertSplit guifg = s:hi arg s:light_bg - 3 = 251 -> s:rgb_map[251] S:134 #d1d0d1, adjusted + .{ .level = 253, .page = .{ 0xe1, 0xe1, 0xe1 }, .tag = .{ 0xd1, 0xd0, 0xd1 }, .tag_text = .{ 0x56, 0x56, 0x56 }, .rule = .{ 0xb3, 0xb3, 0xb3 } }, + // page: S:206 Normal guibg = s:hi arg s:light_bg = 254 -> s:rgb_map[254] S:134 + // tag: S:351 StatusLineNC guifg = s:hi arg s:light_bg - 2 = 252 -> s:rgb_map[252] S:134 + // tag_text: S:351 StatusLineNC guibg = s:hi arg 238 = 238 -> s:rgb_map[238] S:133 + // rule: S:287 VertSplit guifg = s:hi arg s:light_bg - 3 = 251 -> s:rgb_map[251] S:134 #d1d0d1, adjusted // adjusted: focused tag text #dfdebd -> #12120f: 3.02:1 on #9a7372, tag text needs 4.5:1 // adjusted: focused grip #719899 -> #4b6465: 1.31:1 on the focused tag #9a7372 // adjusted: rules between panes #d1d0d1 -> #b8b8b8: 1.27:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) // index gap: tabline_fg inherits Normal - .{ .level = 254, .bg = .{ 0xe9, 0xe9, 0xe9 }, .tag_bg = .{ 0xd9, 0xd9, 0xd9 }, .tag_fg = .{ 0x56, 0x56, 0x56 }, .box_dim = .{ 0x96, 0xaf, 0xb0 }, .border = .{ 0xb8, 0xb8, 0xb8 } }, - // bg: S:206 Normal guibg = s:hi arg s:light_bg = 255 -> s:rgb_map[255] S:135 - // tag_bg: S:351 StatusLineNC guifg = s:hi arg s:light_bg - 2 = 253 -> s:rgb_map[253] S:134 - // tag_fg: S:351 StatusLineNC guibg = s:hi arg 238 = 238 -> s:rgb_map[238] S:133 - // box_dim: derived: the grip at rest, the accent #719899 faded toward the unfocused tag #e1e1e1 as far as 1.6:1 off it (0.58 of the way) - // border: S:287 VertSplit guifg = s:hi arg s:light_bg - 3 = 252 -> s:rgb_map[252] S:134 #d9d9d9, adjusted + .{ .level = 254, .page = .{ 0xe9, 0xe9, 0xe9 }, .tag = .{ 0xd9, 0xd9, 0xd9 }, .tag_text = .{ 0x56, 0x56, 0x56 }, .rule = .{ 0xb8, 0xb8, 0xb8 } }, + // page: S:206 Normal guibg = s:hi arg s:light_bg = 255 -> s:rgb_map[255] S:135 + // tag: S:351 StatusLineNC guifg = s:hi arg s:light_bg - 2 = 253 -> s:rgb_map[253] S:134 + // tag_text: S:351 StatusLineNC guibg = s:hi arg 238 = 238 -> s:rgb_map[238] S:133 + // rule: S:287 VertSplit guifg = s:hi arg s:light_bg - 3 = 252 -> s:rgb_map[252] S:134 #d9d9d9, adjusted // adjusted: focused tag text #dfdebd -> #12120f: 3.02:1 on #9a7372, tag text needs 4.5:1 // adjusted: focused grip #719899 -> #4b6465: 1.31:1 on the focused tag #9a7372 // adjusted: rules between panes #d9d9d9 -> #bfbfbf: 1.25:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) // index gap: tabline_fg inherits Normal - .{ .level = 255, .bg = .{ 0xf1, 0xf1, 0xf1 }, .tag_bg = .{ 0xe1, 0xe1, 0xe1 }, .tag_fg = .{ 0x56, 0x56, 0x56 }, .box_dim = .{ 0xa0, 0xb7, 0xb7 }, .border = .{ 0xbf, 0xbf, 0xbf } }, - // bg: S:206 Normal guibg = s:hi arg s:light_bg = 256 (256>255 -> 231 per S:184-185) -> s:rgb_map[231] S:131 - // tag_bg: S:351 StatusLineNC guifg = s:hi arg s:light_bg - 2 = 254 -> s:rgb_map[254] S:134 - // tag_fg: S:351 StatusLineNC guibg = s:hi arg 238 = 238 -> s:rgb_map[238] S:133 - // box_dim: derived: the grip at rest, the accent #719899 faded toward the unfocused tag #e9e9e9 as far as 1.6:1 off it (0.54 of the way) - // border: S:287 VertSplit guifg = s:hi arg s:light_bg - 3 = 253 -> s:rgb_map[253] S:134 #e1e1e1, adjusted + .{ .level = 255, .page = .{ 0xf1, 0xf1, 0xf1 }, .tag = .{ 0xe1, 0xe1, 0xe1 }, .tag_text = .{ 0x56, 0x56, 0x56 }, .rule = .{ 0xbf, 0xbf, 0xbf } }, + // page: S:206 Normal guibg = s:hi arg s:light_bg = 256 (256>255 -> 231 per S:184-185) -> s:rgb_map[231] S:131 + // tag: S:351 StatusLineNC guifg = s:hi arg s:light_bg - 2 = 254 -> s:rgb_map[254] S:134 + // tag_text: S:351 StatusLineNC guibg = s:hi arg 238 = 238 -> s:rgb_map[238] S:133 + // rule: S:287 VertSplit guifg = s:hi arg s:light_bg - 3 = 253 -> s:rgb_map[253] S:134 #e1e1e1, adjusted // adjusted: focused tag text #dfdebd -> #12120f: 3.02:1 on #9a7372, tag text needs 4.5:1 // adjusted: focused grip #719899 -> #4b6465: 1.31:1 on the focused tag #9a7372 // adjusted: rules between panes #e1e1e1 -> #cacaca: 1.31:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) // index gap: tabline_fg inherits Normal - .{ .level = 256, .bg = .{ 0xff, 0xff, 0xff }, .tag_bg = .{ 0xe9, 0xe9, 0xe9 }, .tag_fg = .{ 0x56, 0x56, 0x56 }, .box_dim = .{ 0xa8, 0xbd, 0xbe }, .border = .{ 0xca, 0xca, 0xca } }, + .{ .level = 256, .page = .{ 0xff, 0xff, 0xff }, .tag = .{ 0xe9, 0xe9, 0xe9 }, .tag_text = .{ 0x56, 0x56, 0x56 }, .rule = .{ 0xca, 0xca, 0xca } }, }; /// The dark style at background `level` (233 to 239). @@ -204,58 +260,55 @@ pub fn dark(comptime level: u16) type { pub const theme = .{ .name = std.fmt.comptimePrint("seoul256_dark_{d}", .{level}), // the level's own, cited in its row of dark_levels - .bg = own.bg, + .page = own.page, // S:206 Normal guifg = s:hi arg s:dark_fg = 252 -> s:rgb_map[252] S:134 - .fg = .{ 0xd9, 0xd9, 0xd9 }, + .text = .{ 0xd9, 0xd9, 0xd9 }, // S:209 Visual guibg = s:hi arg 23 = 23 -> s:rgb_map[23] S:121 - .sel_bg = .{ 0x00, 0x71, 0x73 }, + .selection = .{ 0x00, 0x71, 0x73 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xd9, 0xd9, 0xd9 }, + .selection_text = .{ 0xd9, 0xd9, 0xd9 }, // the level's own, cited in its row of dark_levels - .tag_bg = own.tag_bg, + .tag = own.tag, // the level's own, cited in its row of dark_levels - .tag_fg = own.tag_fg, + .tag_text = own.tag_text, // the level's own, cited in its row of dark_levels - .tag_active_bg = own.tag_active_bg, + .tag_focus = own.tag_focus, // S:350 StatusLine guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129; rendered as the bar text because S:354 sets gui=bold,reverse #dfdebd, adjusted - .tag_active_fg = own.tag_active_fg, + .tag_focus_text = own.tag_focus_text, // the focused grip: S:359 TabLineSel guibg = s:hi arg 23 = 23 -> s:rgb_map[23] S:121 (accent: the selected-tab background, TabLineSel, the file's only coloured focus marker; the airline/lightline seoul256 themes live outside this repo) - .box = own.box, + .accent = own.accent, // the level's own, cited in its row of dark_levels - .box_dim = own.box_dim, // an unsaved grip: the original's modified colour, S:396 GitGutterChange guifg = s:hi arg 68 = 68 -> s:rgb_map[68] S:123 (modified: vim-gitgutter Changed sign) - .box_dirty = .{ 0x71, 0x9c, 0xdf }, + .dirty = .{ 0x71, 0x9c, 0xdf }, // derived: the column grip, the original's type colour, S:247 Type guifg = s:hi arg 179 = 179 -> s:rgb_map[179] S:129 - .column_box = .{ 0xdf, 0xbc, 0x72 }, + .column_grip = .{ 0xdf, 0xbc, 0x72 }, // S:253 Keyword guifg = s:hi arg 168 = 168 -> s:rgb_map[168] S:128 - .kw = .{ 0xe1, 0x78, 0x99 }, + .keyword = .{ 0xe1, 0x78, 0x99 }, // S:216 String guifg = s:hi arg 109 = 109 -> s:rgb_map[109] S:125 - .str = .{ 0x98, 0xbc, 0xbd }, + .string = .{ 0x98, 0xbc, 0xbd }, // S:213 Number guifg = s:hi arg 222 = 222 -> s:rgb_map[222] S:131 - .num = .{ 0xff, 0xde, 0x99 }, + .number = .{ 0xff, 0xde, 0x99 }, // S:212 Comment guifg = s:hi arg 65 = 65 -> s:rgb_map[65] S:123 .comment = .{ 0x71, 0x98, 0x72 }, // S:208 LineNr guifg = s:hi arg 101 = 101 -> s:rgb_map[101] S:125 - .lineno = .{ 0x99, 0x98, 0x72 }, + .line_number = .{ 0x99, 0x98, 0x72 }, // S:276 CursorLineNr guifg = s:hi arg 131 = 131 -> s:rgb_map[131] S:126 - .lineno_active = .{ 0xbe, 0x75, 0x72 }, + .line_number_current = .{ 0xbe, 0x75, 0x72 }, // S:306 PmenuSbar guibg = s:hi arg 65 = 65 -> s:rgb_map[65] S:123 - .scroll_track = .{ 0x71, 0x98, 0x72 }, + .rail = .{ 0x71, 0x98, 0x72 }, // S:307 PmenuThumb guibg = s:hi arg 23 = 23 -> s:rgb_map[23] S:121 - .scroll_thumb = .{ 0x00, 0x71, 0x73 }, + .rail_thumb = .{ 0x00, 0x71, 0x73 }, // the level's own, cited in its row of dark_levels - .border = own.border, + .rule = own.rule, // S:309 Search guibg = s:hi arg 24 = 24 -> s:rgb_map[24] S:121 - .search_bg = .{ 0x00, 0x72, 0x99 }, - // S:309 Search guifg = s:hi arg s:dark_fg = 252 -> s:rgb_map[252] S:134 - .search_fg = .{ 0xd9, 0xd9, 0xd9 }, + .hit = .{ 0x00, 0x72, 0x99 }, // S:402 ALEErrorSign guifg = s:hi arg 161 = 161 -> s:rgb_map[161] S:128 (no Diagnostic* groups; ALE error sign used) - .diagnostic_error = .{ 0xe1, 0x26, 0x72 }, + .@"error" = .{ 0xe1, 0x26, 0x72 }, // S:403 ALEWarningSign guifg = s:hi arg 174 = 174 -> s:rgb_map[174] S:128 (no Diagnostic* groups; ALE warning sign used) - .diagnostic_warning = .{ 0xe0, 0x9b, 0x99 }, + .warning = .{ 0xe0, 0x9b, 0x99 }, // The official urxvt port (the vim colorscheme sets no terminal // colours), U = ~/05-genizah/seoul256.vim/urxvt/seoul256. - .palette = .{ + .ansi = .{ .{ 0x4e, 0x4e, 0x4e }, // 0: U:5 URxvt*color0 .{ 0xd6, 0x87, 0x87 }, // 1: U:6 URxvt*color1 .{ 0x5f, 0x86, 0x5f }, // 2: U:7 URxvt*color2 @@ -286,58 +339,56 @@ pub fn light(comptime level: u16) type { pub const theme = .{ .name = std.fmt.comptimePrint("seoul256_light_{d}", .{level}), // the level's own, cited in its row of light_levels - .bg = own.bg, + .page = own.page, // S:206 Normal guifg = s:hi arg s:light_fg = 239 -> s:rgb_map[239] S:133 - .fg = .{ 0x61, 0x61, 0x61 }, + .text = .{ 0x61, 0x61, 0x61 }, // S:209 Visual guibg = s:hi arg 152 = 152 -> s:rgb_map[152] S:127 - .sel_bg = .{ 0xbc, 0xde, 0xde }, + .selection = .{ 0xbc, 0xde, 0xde }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x61, 0x61, 0x61 }, + .selection_text = .{ 0x61, 0x61, 0x61 }, // the level's own, cited in its row of light_levels - .tag_bg = own.tag_bg, + .tag = own.tag, // the level's own, cited in its row of light_levels - .tag_fg = own.tag_fg, + .tag_text = own.tag_text, // S:350 StatusLine guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124; rendered as the bar background because S:354 sets gui=bold,reverse - .tag_active_bg = .{ 0x9a, 0x73, 0x72 }, + .tag_focus = .{ 0x9a, 0x73, 0x72 }, // S:350 StatusLine guibg = s:hi arg 187 = 187 -> s:rgb_map[187] S:129; rendered as the bar text because S:354 sets gui=bold,reverse #dfdebd, adjusted - .tag_active_fg = .{ 0x12, 0x12, 0x0f }, + .tag_focus_text = .{ 0x12, 0x12, 0x0f }, // the focused grip: S:359 TabLineSel guibg = s:hi arg 66 = 66 -> s:rgb_map[66] S:123 (accent: the selected-tab background, TabLineSel, the file's only coloured focus marker; the airline/lightline seoul256 themes live outside this repo) - .box = .{ 0x4b, 0x64, 0x65 }, + .accent = .{ 0x4b, 0x64, 0x65 }, // the level's own, cited in its row of light_levels - .box_dim = own.box_dim, // an unsaved grip: the original's modified colour, S:396 GitGutterChange guifg = s:hi arg 68 = 68 -> s:rgb_map[68] S:123 (modified: vim-gitgutter Changed sign) - .box_dirty = .{ 0x71, 0x9c, 0xdf }, + .dirty = .{ 0x71, 0x9c, 0xdf }, // derived: the column grip, the original's type colour, S:247 Type guifg = s:hi arg 94 = 94 -> s:rgb_map[94] S:124 - .column_box = .{ 0x9a, 0x72, 0x00 }, + .column_grip = .{ 0x9a, 0x72, 0x00 }, // S:253 Keyword guifg = s:hi arg 168 = 168 -> s:rgb_map[168] S:128 - .kw = .{ 0xe1, 0x78, 0x99 }, + .keyword = .{ 0xe1, 0x78, 0x99 }, // S:216 String guifg = s:hi arg 30 = 30 -> s:rgb_map[30] S:121 - .str = .{ 0x00, 0x97, 0x99 }, + .string = .{ 0x00, 0x97, 0x99 }, // S:213 Number guifg = s:hi arg 95 = 95 -> s:rgb_map[95] S:124 - .num = .{ 0x9a, 0x73, 0x72 }, + .number = .{ 0x9a, 0x73, 0x72 }, // S:212 Comment guifg = s:hi arg 65 = 65 -> s:rgb_map[65] S:123 .comment = .{ 0x71, 0x98, 0x72 }, // S:208 LineNr guifg = s:hi arg 101 = 101 -> s:rgb_map[101] S:125 - .lineno = .{ 0x99, 0x98, 0x72 }, + .line_number = .{ 0x99, 0x98, 0x72 }, // S:276 CursorLineNr guifg = s:hi arg 131 = 131 -> s:rgb_map[131] S:126 - .lineno_active = .{ 0xbe, 0x75, 0x72 }, + .line_number_current = .{ 0xbe, 0x75, 0x72 }, // S:306 PmenuSbar guibg = s:hi arg 65 = 65 -> s:rgb_map[65] S:123 - .scroll_track = .{ 0x71, 0x98, 0x72 }, + .rail = .{ 0x71, 0x98, 0x72 }, // S:307 PmenuThumb guibg = s:hi arg 23 = 23 -> s:rgb_map[23] S:121 - .scroll_thumb = .{ 0x00, 0x71, 0x73 }, + .rail_thumb = .{ 0x00, 0x71, 0x73 }, // the level's own, cited in its row of light_levels - .border = own.border, - // S:309 Search guibg = s:hi arg 74 = 74 -> s:rgb_map[74] S:124 - .search_bg = .{ 0x70, 0xbd, 0xdf }, - // S:309 Search guifg = s:hi arg 255 = 255 -> s:rgb_map[255] S:135 - .search_fg = .{ 0xf1, 0xf1, 0xf1 }, + .rule = own.rule, + // S:309 Search guibg = s:hi arg 74 = 74 -> s:rgb_map[74] S:124 #70bddf, adjusted + // adjusted: search hit #70bddf -> #a6e6fe: the text #616161 reads 2.96:1 on #70bddf; its sky blue lighter, 1.13:1 off the page at 254 and 1.21:1 at 255, 0.08 OKLab, the text 4.53:1 on it (DESIGN.md R0, R8) + .hit = .{ 0xa6, 0xe6, 0xfe }, // S:402 ALEErrorSign guifg = s:hi arg 161 = 161 -> s:rgb_map[161] S:128 (no Diagnostic* groups; ALE error sign used) - .diagnostic_error = .{ 0xe1, 0x26, 0x72 }, + .@"error" = .{ 0xe1, 0x26, 0x72 }, // S:403 ALEWarningSign guifg = s:hi arg 131 = 131 -> s:rgb_map[131] S:126 (no Diagnostic* groups; ALE warning sign used) - .diagnostic_warning = .{ 0xbe, 0x75, 0x72 }, + .warning = .{ 0xbe, 0x75, 0x72 }, // The official urxvt port (the vim colorscheme sets no terminal // colours), U = ~/05-genizah/seoul256.vim/urxvt/seoul256-light. - .palette = .{ + .ansi = .{ .{ 0x4e, 0x4e, 0x4e }, // 0: U:5 URxvt*color0 .{ 0xaf, 0x5f, 0x5f }, // 1: U:6 URxvt*color1 .{ 0x5f, 0x88, 0x5f }, // 2: U:7 URxvt*color2 -- cgit v1.3 From 77b22e7c7623696feb52292bb86839870e20050d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 26 Nov 2026 04:37:03 -0300 Subject: themes, vendor, colors, gen_themes, exec, ctl, dump: DESIGN.md E's 44 themes retired, each name standing for its successor wherever it is still read (the themes programme's L7; DESIGN.md E, F): GONE: 28 helix sources (base16_default_light, base16_terminal, base16_transparent, bogster_light, cyan_light, eldritch_transparent, gruvbox-material, hex_lavender, hex_poison, ingrid, iroaseta, nord_light, nyxvamp-transparent, peachpuff, the six helix seoul256s, term16_dark, term16_light, tokyonight, ttox, ttox_soft, vesper-transparent, zed_onedark, zed_onelight), zed's ayu.json and gruvbox.json (every variant in them retired: ayu_dark/light/mirage_zed, the six gruvbox_*_zed) and their licences (ayu.LICENSE, gruvbox.LICENSE: zed's, covering those files alone; helix's licences each cover a kept theme), seoul256's 238, 239, 252 and 253 (their rows, their citations, their lines in its G4 block); vendor/themes/base/ holds the retired three kept themes inherit from (ayu_dark_helix, hex_steel, nord_helix; the designer's list named seven, but no kept theme inherits seoul256_dark/_light, term16_dark or zed_onedark once their children retire), passed to the generator as `base=` (build/core.zig `vendoredThemes` per directory), read for `inherits`, never rung; THE SUCCESSORS: `colors.retired`, 44 names and the kept one each stands for (the kept twin, the nearest kept seoul256 step, dark or light for the terminal-colour themes, the default where there is none: ingrid), read by `successorOf`: a `Theme` (an init file's line, a click, a /ctl write) naming one wears its successor and says so once, as a notice: "Theme gruvbox_dark_zed was retired: gruvbox instead" (exec.applySettingBuiltin); /ctl takes such a write (ctl.zig); a dump or Restore naming one restores its successor (`colors.restoredIndex`, dump.zig's two readers, which said the same loop twice; one this build has nothing of keeps the theme in effect as before, else the default by name, where it was index 0, dark's now); an unknown name keeps today's path and words; THE RING TEST'S LIST: empty, so gone (`ring_expected` and its bookkeeping: every theme in the ring passes every floor it is held to, or the test names it); RUN (TEST FIRST): colors.zig "a retired theme's name stands for its successor in an init file and a dump, said once; an unknown one leaves the default, in today's words" (an init `Theme gruvbox_dark_zed`, `Theme TTOX` (any case), `Theme ingrid` and `Theme no-such-theme`: gruvbox, dark, orchard and orchard, each with its one message; a dump of a session in acme with `ttox` put in for its theme's name, as an older build's: restored in dark): fails on L5 (gruvbox_dark_zed still in the ring, worn as itself), passes now; "every retired theme's successor is in the ring, and no retired name is" (44); the ring test: 245 of 245 themes pass every floor (289 at L5, 44 retired); "seoul256's eight backgrounds ring in their order"; the G4 test holds every port's file; core-test 1142/1315 (173 skipped: L5's 1140/1313 + the two retirement tests); OUTSIDE my files: build/core.zig (`vendoredThemes` per directory, the base arguments), core/exec.zig (`Theme`'s retired branch, 7 lines), core/ninep/ctl.zig (1 line), core/dump.zig (its two readers, `restoredIndex`); the dump's bytes and layout unchanged and a name in this build's ring restored as before (restoredIndex's first loop is the old one), so a join or a restore within a build never reaches the new branches: no fuzz or soak Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE --- build/core.zig | 9 +- core/colors.zig | 167 +- core/dump.zig | 10 +- core/exec.zig | 7 + core/ninep/ctl.zig | 2 +- core/themes/seoul256.zig | 78 +- tools/gen_themes.zig | 12 +- vendor/themes/ayu.LICENSE | 21 - vendor/themes/ayu.json | 1228 --------------- vendor/themes/ayu_dark_helix.toml | 92 -- vendor/themes/base/ayu_dark_helix.toml | 92 ++ vendor/themes/base/hex_steel.toml | 127 ++ vendor/themes/base/nord_helix.toml | 199 +++ vendor/themes/base16_default_light.toml | 79 - vendor/themes/base16_terminal.toml | 55 - vendor/themes/base16_transparent.toml | 84 - vendor/themes/bogster_light.toml | 103 -- vendor/themes/cyan_light.toml | 5 - vendor/themes/eldritch_transparent.toml | 7 - vendor/themes/gruvbox-material.toml | 6 - vendor/themes/gruvbox.LICENSE | 21 - vendor/themes/gruvbox.json | 2539 ------------------------------- vendor/themes/hex_lavender.toml | 41 - vendor/themes/hex_poison.toml | 41 - vendor/themes/hex_steel.toml | 127 -- vendor/themes/ingrid.toml | 77 - vendor/themes/iroaseta.toml | 162 -- vendor/themes/nord_helix.toml | 199 --- vendor/themes/nord_light.toml | 90 -- vendor/themes/nyxvamp-transparent.toml | 54 - vendor/themes/peachpuff.toml | 66 - vendor/themes/seoul256-dark-hard.toml | 16 - vendor/themes/seoul256-dark-soft.toml | 15 - vendor/themes/seoul256-dark.toml | 161 -- vendor/themes/seoul256-light-hard.toml | 16 - vendor/themes/seoul256-light-soft.toml | 16 - vendor/themes/seoul256-light.toml | 51 - vendor/themes/term16_dark.toml | 80 - vendor/themes/term16_light.toml | 85 -- vendor/themes/tokyonight.toml | 136 -- vendor/themes/ttox.toml | 33 - vendor/themes/ttox_soft.toml | 37 - vendor/themes/vesper-transparent.toml | 25 - vendor/themes/zed_onedark.toml | 114 -- vendor/themes/zed_onelight.toml | 62 - 45 files changed, 575 insertions(+), 6072 deletions(-) delete mode 100644 vendor/themes/ayu.LICENSE delete mode 100644 vendor/themes/ayu.json delete mode 100644 vendor/themes/ayu_dark_helix.toml create mode 100644 vendor/themes/base/ayu_dark_helix.toml create mode 100644 vendor/themes/base/hex_steel.toml create mode 100644 vendor/themes/base/nord_helix.toml delete mode 100644 vendor/themes/base16_default_light.toml delete mode 100644 vendor/themes/base16_terminal.toml delete mode 100644 vendor/themes/base16_transparent.toml delete mode 100644 vendor/themes/bogster_light.toml delete mode 100644 vendor/themes/cyan_light.toml delete mode 100644 vendor/themes/eldritch_transparent.toml delete mode 100644 vendor/themes/gruvbox-material.toml delete mode 100644 vendor/themes/gruvbox.LICENSE delete mode 100644 vendor/themes/gruvbox.json delete mode 100644 vendor/themes/hex_lavender.toml delete mode 100644 vendor/themes/hex_poison.toml delete mode 100644 vendor/themes/hex_steel.toml delete mode 100644 vendor/themes/ingrid.toml delete mode 100644 vendor/themes/iroaseta.toml delete mode 100644 vendor/themes/nord_helix.toml delete mode 100644 vendor/themes/nord_light.toml delete mode 100644 vendor/themes/nyxvamp-transparent.toml delete mode 100644 vendor/themes/peachpuff.toml delete mode 100644 vendor/themes/seoul256-dark-hard.toml delete mode 100644 vendor/themes/seoul256-dark-soft.toml delete mode 100644 vendor/themes/seoul256-dark.toml delete mode 100644 vendor/themes/seoul256-light-hard.toml delete mode 100644 vendor/themes/seoul256-light-soft.toml delete mode 100644 vendor/themes/seoul256-light.toml delete mode 100644 vendor/themes/term16_dark.toml delete mode 100644 vendor/themes/term16_light.toml delete mode 100644 vendor/themes/tokyonight.toml delete mode 100644 vendor/themes/ttox.toml delete mode 100644 vendor/themes/ttox_soft.toml delete mode 100644 vendor/themes/vesper-transparent.toml delete mode 100644 vendor/themes/zed_onedark.toml delete mode 100644 vendor/themes/zed_onelight.toml (limited to 'core/themes/seoul256.zig') diff --git a/build/core.zig b/build/core.zig index f9cb450f..c787fdc8 100644 --- a/build/core.zig +++ b/build/core.zig @@ -131,9 +131,11 @@ fn patchesHash(b: *std.Build, io: std.Io) u64 { return h; } -fn vendoredThemes(b: *std.Build, io: std.Io) []const []const u8 { +/// The theme sources in `sub` of vendor/themes, sorted: the ring's (`.`), +/// or the retired ones kept themes inherit from (`base`, read, never rung). +fn vendoredThemes(b: *std.Build, io: std.Io, sub: []const u8) []const []const u8 { var names: std.ArrayList([]const u8) = .empty; - var dir = b.root.root_dir.handle.openDir(io, "vendor/themes", .{ .iterate = true }) catch @panic("open vendor/themes"); + var dir = b.root.root_dir.handle.openDir(io, b.pathJoin(&.{ "vendor/themes", sub }), .{ .iterate = true }) catch @panic("open vendor/themes"); defer dir.close(io); var it = dir.iterate(); while (it.next(io) catch @panic("read vendor/themes")) |e| { @@ -161,7 +163,8 @@ pub fn generatedThemes(b: *std.Build, io: std.Io, target: std.Build.ResolvedTarg }); const run_theme_gen = b.addRunArtifact(theme_gen); const themes_out = run_theme_gen.addOutputDirectoryArg("themes"); - for (vendoredThemes(b, io)) |name| run_theme_gen.addFileArg(b.path(b.fmt("vendor/themes/{s}", .{name}))); + for (vendoredThemes(b, io, ".")) |name| run_theme_gen.addFileArg(b.path(b.fmt("vendor/themes/{s}", .{name}))); + for (vendoredThemes(b, io, "base")) |name| run_theme_gen.addPrefixedFileArg("base=", b.path(b.fmt("vendor/themes/base/{s}", .{name}))); return b.createModule(.{ .target = target, .optimize = optimize, diff --git a/core/colors.zig b/core/colors.zig index 9091760f..960123e2 100644 --- a/core/colors.zig +++ b/core/colors.zig @@ -1092,7 +1092,7 @@ pub const Grounds = struct { } }; -/// One family, its twelve backgrounds a theme each (`curated`). +/// One family, its eight backgrounds a theme each (`curated`). const seoul256 = @import("themes/seoul256.zig"); const curated = struct { @@ -1156,10 +1156,6 @@ const curated = struct { pub const seoul256_dark_235 = seoul256.dark(235); pub const seoul256_dark_236 = seoul256.dark(236); pub const seoul256_dark_237 = seoul256.dark(237); - pub const seoul256_dark_238 = seoul256.dark(238); - pub const seoul256_dark_239 = seoul256.dark(239); - pub const seoul256_light_252 = seoul256.light(252); - pub const seoul256_light_253 = seoul256.light(253); pub const seoul256_light_254 = seoul256.light(254); pub const seoul256_light_255 = seoul256.light(255); pub const seoul256_light_256 = seoul256.light(256); @@ -1271,6 +1267,71 @@ const theme_groups = [_]ThemeGroup{ /// The theme a session starts in, by name: never a place in the ring. pub const default_theme = indexOfTheme("orchard"); +/// The themes retired (DESIGN.md E, under the user's ruling of 2026-11-25) +/// and the kept one each stands for where its name is still read: an init +/// file's `Theme`, a /ctl write, a dump; null, the default. +const retired = [_]struct { []const u8, ?[]const u8 }{ + .{ "seoul256_dark_238", "seoul256_dark_237" }, + .{ "seoul256_dark_239", "seoul256_dark_237" }, + .{ "seoul256_light_252", "seoul256_light_254" }, + .{ "seoul256_light_253", "seoul256_light_254" }, + .{ "ayu_dark_helix", "ayu_dark" }, + .{ "ayu_dark_zed", "ayu_dark" }, + .{ "ayu_light_zed", "ayu_light" }, + .{ "ayu_mirage_zed", "ayu_mirage" }, + .{ "base16_default_light", "base16_default_dark" }, + .{ "base16_terminal", "dark" }, + .{ "base16_transparent", "base16_default_dark" }, + .{ "bogster_light", "bogster" }, + .{ "cyan_light", "jetbrains_cyan_light" }, + .{ "eldritch_transparent", "eldritch" }, + .{ "gruvbox_dark_hard_zed", "gruvbox_dark_hard" }, + .{ "gruvbox_dark_soft_zed", "gruvbox_dark_soft" }, + .{ "gruvbox_dark_zed", "gruvbox" }, + .{ "gruvbox_light_hard_zed", "gruvbox_light_hard" }, + .{ "gruvbox_light_soft_zed", "gruvbox_light_soft" }, + .{ "gruvbox_light_zed", "gruvbox_light" }, + .{ "gruvbox_material", "gruvbox_material_dark_medium" }, + .{ "hex_lavender", "hex_toxic" }, + .{ "hex_poison", "hex_toxic" }, + .{ "hex_steel", "hex_toxic" }, + .{ "ingrid", null }, + .{ "iroaseta", "ao" }, + .{ "nord_helix", "nord" }, + .{ "nord_light", "nord" }, + .{ "nyxvamp_transparent", "nyxvamp_veil" }, + .{ "peachpuff", "dark" }, + .{ "seoul256_dark", "seoul256_dark_235" }, + .{ "seoul256_dark_hard", "seoul256_dark_233" }, + .{ "seoul256_dark_soft", "seoul256_dark_237" }, + .{ "seoul256_light", "seoul256_light_254" }, + .{ "seoul256_light_hard", "seoul256_light_256" }, + .{ "seoul256_light_soft", "seoul256_light_254" }, + .{ "term16_dark", "dark" }, + .{ "term16_light", "light" }, + .{ "tokyonight", "tokyonight_night" }, + .{ "ttox", "dark" }, + .{ "ttox_soft", "dark" }, + .{ "vesper_transparent", "vesper" }, + .{ "zed_onedark", "one_dark_zed" }, + .{ "zed_onelight", "one_light_zed" }, +}; + +/// The ring's place for the kept theme a retired `name` stands for, +/// whatever its case. +pub fn successorOf(name: []const u8) ?usize { + for (retired) |r| if (std.ascii.eqlIgnoreCase(r[0], name)) return if (r[1]) |kept| themeIndex(kept).? else default_theme; + return null; +} + +/// The theme a dump naming `name` restores: that one, a retired one's +/// successor, else the one in effect (`was`) where this build has it, else +/// the default. +pub fn restoredIndex(name: []const u8, was: usize) usize { + for (themes, 0..) |t, i| if (std.mem.eql(u8, t.name, name)) return i; + return successorOf(name) orelse if (was < themes.len) was else default_theme; +} + fn indexOfTheme(comptime name: []const u8) usize { return comptime blk: { @setEvalBranchQuota(100000); @@ -2030,11 +2091,10 @@ test "the picker's sections run in ring order and cover it" { for (themes[lone + 1 ..], lone + 1..) |_, i| try std.testing.expectEqual(null, groupAt(i)); } -test "seoul256's twelve backgrounds ring in their order, after Catppuccin and before Zenbones" { +test "seoul256's eight backgrounds ring in their order, after Catppuccin and before Zenbones" { const names = [_][]const u8{ - "seoul256_dark_233", "seoul256_dark_234", "seoul256_dark_235", "seoul256_dark_236", - "seoul256_dark_237", "seoul256_dark_238", "seoul256_dark_239", "seoul256_light_252", - "seoul256_light_253", "seoul256_light_254", "seoul256_light_255", "seoul256_light_256", + "seoul256_dark_233", "seoul256_dark_234", "seoul256_dark_235", "seoul256_dark_236", + "seoul256_dark_237", "seoul256_light_254", "seoul256_light_255", "seoul256_light_256", }; const first = indexOfTheme("seoul256_dark_233"); for (names, themes[first..][0..names.len]) |name, t| try std.testing.expectEqualStrings(name, t.name); @@ -2658,21 +2718,6 @@ fn ringFailures(th: *const Theme, c: *const Chrome, designed_here: bool) std.Enu return f; } -/// The themes that fail a check they are held to until the line that fixes -/// them lands (DESIGN.md E1, F): the list shrinks as each does, and a theme -/// on it that passes fails the test, so it is taken off. -const ring_expected = [_]struct { []const u8, []const u8 }{ - // L7: retired. - .{ "seoul256_dark_238", "L7: retired" }, - .{ "seoul256_dark_239", "L7: retired" }, - .{ "seoul256_light_252", "L7: retired" }, - .{ "seoul256_light_253", "L7: retired" }, - .{ "hex_lavender", "L7: retired" }, - .{ "hex_poison", "L7: retired" }, - .{ "hex_steel", "L7: retired" }, - .{ "ingrid", "L7: retired" }, -}; - /// The soft natives: their text 4.5-7:1 by design, held at AA, never the /// professional 7:1, and never retuned (the coordinator's ruling; solarium /// is the user's). @@ -2684,7 +2729,6 @@ test "every theme in the ring meets every floor pardes owns (DESIGN.md B4), nati const ports = comptime indexOfTheme("dark_plus"); const helix = comptime indexOfTheme("helix"); var passing: usize = 0; - var wrong: usize = 0; for (&themes, 0..) |*th, i| { const c = Chrome.of(th); // The original's own (B1.5): never moved. @@ -2707,24 +2751,17 @@ test "every theme in the ring meets every floor pardes owns (DESIGN.md B4), nati if (check.original() and !ours and !(std.mem.startsWith(u8, @tagName(check), "ansi") and th.ansi == null)) continue; held.insert(check); } - const expected = for (ring_expected) |e| { - if (std.mem.eql(u8, e[0], th.name)) break true; - } else false; - if (held.count() == 0) passing += 1; - if (held.count() > 0 and !expected) { - wrong += 1; - std.debug.print("{s} fails:", .{th.name}); - var failed = held.iterator(); - while (failed.next()) |check| std.debug.print(" {s}", .{@tagName(check)}); - std.debug.print("\n", .{}); - } - if (held.count() == 0 and expected) { - wrong += 1; - std.debug.print("{s} passes now: take it off ring_expected\n", .{th.name}); + if (held.count() == 0) { + passing += 1; + continue; } + std.debug.print("{s} fails:", .{th.name}); + var failed = held.iterator(); + while (failed.next()) |check| std.debug.print(" {s}", .{@tagName(check)}); + std.debug.print("\n", .{}); } - std.debug.print("ring floors: {d} of {d} themes pass; {d} on the expected list\n", .{ passing, themes.len, ring_expected.len }); - try std.testing.expectEqual(0, wrong); + std.debug.print("ring floors: {d} of {d} themes pass\n", .{ passing, themes.len }); + try std.testing.expectEqual(themes.len, passing); } /// A faithful port's own colours pardes moves where they miss a floor: its @@ -2873,3 +2910,51 @@ test "a theme file in the old names, a user's own or an older DumpThemes', and D try std.testing.expect(!loadThemeFile(p, p.theme_file_generation, ".{ .name = \"x\", .page = null, .txet = null }")); try std.testing.expectEqualStrings("one_dark_zed", p.theme().name); } + +test "a retired theme's name stands for its successor in an init file and a dump, said once; an unknown one leaves the default, in today's words (DESIGN.md E)" { + const gpa = std.testing.allocator; + const Said = struct { + fn count(p: *const Pardes, needle: []const u8) usize { + var n: usize = 0; + for (p.messages.log[0..p.messages.len]) |m| { + if (std.mem.indexOf(u8, m.text[0..m.len], needle) != null) n += 1; + } + return n; + } + }; + for ([_][3][]const u8{ + .{ "gruvbox_dark_zed", "gruvbox", "Theme gruvbox_dark_zed was retired: gruvbox instead" }, + .{ "TTOX", "dark", "Theme TTOX was retired: dark instead" }, + // a retired one with no kept twin: the default + .{ "ingrid", "orchard", "Theme ingrid was retired: orchard instead" }, + .{ "no-such-theme", "orchard", "Theme: no theme \"no-such-theme\"; like it: " }, + }) |case| { + const line = try std.fmt.allocPrint(gpa, "Theme {s}\n", .{case[0]}); + defer gpa.free(line); + const p = try Pardes.init(gpa, .{ .tty_only = true, .startup_config = line }); + defer p.deinit(); + try std.testing.expectEqualStrings(case[1], p.theme().name); + try std.testing.expectEqual(1, Said.count(p, case[2])); + } + // A dump naming one (this build writes none: a dump of an older one, + // its theme's name put in): its successor. + const source = try Pardes.init(gpa, .{ .tty_only = true, .startup_config = "Theme acme\n" }); + defer source.deinit(); + try @import("dump.zig").dumpState(source); + const bytes = try gpa.dupe(u8, source.dump_out.?); + defer gpa.free(bytes); + const at = std.mem.indexOf(u8, bytes, "acme").?; + try std.testing.expect(std.mem.indexOfPos(u8, bytes, at + 4, "acme") == null); + @memcpy(bytes[at..][0..4], "ttox"); + const restored = try @import("dump.zig").initFromDump(gpa, .{ .tty_only = true }, bytes); + defer restored.deinit(); + try std.testing.expectEqualStrings("dark", restored.theme().name); +} + +test "every retired theme's successor is in the ring, and no retired name is" { + for (retired) |r| { + try std.testing.expectEqual(null, themeIndex(r[0])); + if (r[1]) |kept| try std.testing.expect(themeIndex(kept) != null); + } + try std.testing.expectEqual(44, retired.len); +} diff --git a/core/dump.zig b/core/dump.zig index 2dde9c8c..69eda35e 100644 --- a/core/dump.zig +++ b/core/dump.zig @@ -422,10 +422,8 @@ fn loadKnowing(gpa: std.mem.Allocator, opts: Options, bytes: []const u8, notes: const was = try l.get(OnDisk); if (on_disk) |out| out.* = was; const theme = try l.get([]const u8); - // This build's place for that theme; one it has not, its first. - p.settings.theme = for (colors.themes, 0..) |t, i| { - if (std.mem.eql(u8, t.name, theme)) break i; - } else if (p.settings.theme < colors.themes.len) p.settings.theme else 0; + // This build's place for that theme, a retired one's successor's. + p.settings.theme = colors.restoredIndex(theme, p.settings.theme); // A mount this process was started with stands; one of the same name // to elsewhere is refused, never silently put over it. for (mounts) |m| { @@ -515,9 +513,7 @@ fn loadImage(gpa: std.mem.Allocator, opts: Options, bytes: []const u8, notes: ?* if (on_disk) |out| out.* = was; const theme: []const u8 = if (try walk.Get.member(root, "theme")) |c| try l.get([]const u8, c) else ""; defer gpa.free(theme); - p.settings.theme = for (colors.themes, 0..) |t, i| { - if (std.mem.eql(u8, t.name, theme)) break i; - } else if (p.settings.theme < colors.themes.len) p.settings.theme else 0; + p.settings.theme = colors.restoredIndex(theme, p.settings.theme); for (mounts) |m| { const existing = for (p.fs.mounts.items) |e| { if (std.mem.eql(u8, e.name, m.name)) break e; diff --git a/core/exec.zig b/core/exec.zig index a56c17f9..44cfea64 100644 --- a/core/exec.zig +++ b/core/exec.zig @@ -1008,6 +1008,13 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Settings.Setting, arg: ?[ .theme => { const want = std.mem.trim(u8, arg orelse return, " \t\r\n"); if (colors.themeIndex(want)) |i| return colors.setThemeIndex(p, i); + // A retired theme's name (DESIGN.md E): its successor, said. + if (colors.successorOf(want)) |i| { + colors.setThemeIndex(p, i); + var said: pardes.Kind.Buf(128) = .{}; + _ = pardes.Messages.say(p, .notice, v.active, said.print("Theme {s} was retired: {s} instead", .{ want[0..@min(want.len, 40)], colors.themes[i].name })); + return; + } // A failure is said, the init file's too (applyStartupConfig // logs it with its line): never silent. // All of it within the 128 bytes a 9P error carries, so a write diff --git a/core/ninep/ctl.zig b/core/ninep/ctl.zig index 2411b20f..80d1176c 100644 --- a/core/ninep/ctl.zig +++ b/core/ninep/ctl.zig @@ -555,7 +555,7 @@ fn checkBuiltin(p: *Pardes, req: Req, line: []const u8, scope: builtins.Scope) ? if (arg.len == 0 and builtins.registry.requiresArg(b)) return refuse(p, req, "wrong #args in control message", line); const setting = config.Settings.find(word) orelse return null; const takes = switch (setting.action) { - .theme => if (pardes.colors.themeIndex(arg) != null) true else { + .theme => if (pardes.colors.themeIndex(arg) != null or pardes.colors.successorOf(arg) != null) true else { // `refuse` quotes the line after it, all in the 128 bytes an // Rerror carries: the names get what is left. const head = "bad value in control message; like it: "; diff --git a/core/themes/seoul256.zig b/core/themes/seoul256.zig index 0c4c17ab..5940d485 100644 --- a/core/themes/seoul256.zig +++ b/core/themes/seoul256.zig @@ -1,7 +1,8 @@ //! Seoul256 (junegunn/seoul256.vim), as close to the original as pardes -//! can draw it: its dark style at each of its backgrounds 233 to 239 and its -//! light one at 252 to 256, a theme each (`dark`, `light`; colors.zig rings -//! them as seoul256_