diff options
Diffstat (limited to 'core')
121 files changed, 5354 insertions, 3252 deletions
diff --git a/core/Band.zig b/core/Band.zig index 8ee5c9f0..d60e9831 100644 --- a/core/Band.zig +++ b/core/Band.zig @@ -40,6 +40,9 @@ pub const Row = struct { on: bool = false, /// Its first `key` bytes are a key: the key ink, bold. key: u8 = 0, + /// Its first `kind` bytes are a symbol's kind mark (`t`, `f`, `m`): + /// the keyword's ink (UX DESIGN N4). + kind: u8 = 0, /// Its first `chord` bytes are a chord (Help's `SPC h t`): the key ink /// at the text's weight. chord: u8 = 0, @@ -53,8 +56,9 @@ pub const Row = struct { index: u16 = 0, /// Marked in a picker's list: `•` before it. mark: bool = false, - /// Its first `pre` bytes are a place (`file:line`, `@p3`): the name's - /// tint; the `faint` bytes after them dimmed (a path's directory). + /// Its first `pre` bytes are a place (`file:line`, `@p3`) or a kind + /// mark: the name's tint; the `faint` bytes after them dimmed (a path's + /// directory, a symbol's qualifier). pre: u16 = 0, faint: u16 = 0, /// Said at the row's right end in the dim ink, two cells off its text @@ -644,6 +648,7 @@ fn cutRow(arena: std.mem.Allocator, tab: u16, row: Row, room: u16) !Row { fit.text = try std.mem.concat(arena, u8, &.{ row.text[0..cut], if (room > 0) "…" else "" }); for (row.marks) |m| if (m < cut) try marks.append(arena, m); fit.key = @intCast(@min(row.key, cut)); + fit.kind = @intCast(@min(row.kind, cut)); fit.pre = @intCast(@min(row.pre, cut)); fit.faint = @intCast(@min(row.faint, cut -| fit.pre)); } @@ -681,6 +686,8 @@ test "a narrow band gives way and keeps its spines: the doc goes, the steps star defer p.deinit(); const pane = try p.setTestFile("one\n"); const id = p.view().active; + // Its own text past a row: the tag takes two (UX K'1). + pane.tag.own = try p.gpa.dupe(u8, "words of the user's own that run on past a row"); p.sync(); const rest = pane.tag_rows; try std.testing.expect(rest > 1); @@ -716,6 +723,8 @@ test "out of rest with no band, the rows a tag keeps from rest stay blank: a spi defer p.deinit(); const pane = try p.setTestFile("one\n"); const id = p.view().active; + // Its own text past a row: the tag takes two (UX K'1). + pane.tag.own = try p.gpa.dupe(u8, "words of the user's own that run on past a row"); p.sync(); const rest = pane.tag_rows; try std.testing.expect(rest > 1); diff --git a/core/Command.zig b/core/Command.zig index 908358de..f41d0639 100644 --- a/core/Command.zig +++ b/core/Command.zig @@ -2,8 +2,9 @@ //! tag after a `:` key cell, a text prompt of its own (Prompt.zig's //! `.command`). Its rows are the answers of a question waiting on the pane //! (SPEC §10.4), then the tag's own words in the tag's order (`Kill` after -//! them for a terminal), marked `in the tag`, each kind ruled off, then the -//! commands a helix hand types, each the pardes word it runs: `write` +//! them for a terminal), marked `in the tag`, then the words of the pane's +//! kind its tag does not show now (UX K'4), marked `for this pane`, each +//! kind ruled off, then the commands a helix hand types, each the pardes word it runs: `write` //! Save, `quit` Del, `theme X` Theme X, `set` and `toggle` a setting's //! word, `reload` Get, `goto N` Look `:N`, `open F` Find F, `sort`, //! `reflow` and `pipe` a pipe of the selections. The field filters them by @@ -57,10 +58,11 @@ rows: Rows = .names, /// values are its. setting: u8 = 0, /// The names' first rows are the waiting question's answers, then the -/// tag's words: how many of each there were when the field was filtered -/// (the commands' come after them). +/// tag's words, then the pane's others: how many of each there were when +/// the field was filtered (the commands' come after them). answers: u8 = 0, words: u8 = 0, +others: u8 = 0, /// Where the query starts in the field: Tab writes the current row from /// there. from: u16 = 0, @@ -86,7 +88,8 @@ const typed = [_]Typed{ .{ .name = "toggle", .arg = "setting", .rows = .settings, .doc = "Flip a setting, or step it to its next value: its word bare." }, }; -/// The tag's words `:` lists at most, and a question's answers. +/// The tag's words and the pane's others `:` lists at most, and a +/// question's answers. const max_words = 32; const max_answers = 8; /// A row's text at most, its name and what it says beside it. @@ -149,6 +152,7 @@ pub fn filter(p: *Pardes, pane: *Pane) void { c.from = 0; c.answers = 0; c.words = 0; + c.others = 0; s.rows = .{}; s.nhits = 0; s.ntotal = 0; @@ -195,7 +199,13 @@ pub fn filter(p: *Pardes, pane: *Pane) void { consider(s, q, w, c.answers + c.words); c.words += 1; } - for (typed, 0..) |t, i| consider(s, q, t.name, c.answers + c.words + i); + var others = otherWords(pane); + while (others.next()) |w| { + if (c.words + c.others == max_words) break; + consider(s, q, w, c.answers + c.words + c.others); + c.others += 1; + } + for (typed, 0..) |t, i| consider(s, q, t.name, c.answers + c.words + c.others + i); }, .themes => for (colors.themes, 0..) |t, i| consider(s, q, t.name, i), .settings => { @@ -263,14 +273,16 @@ fn matches(q: []const u8, text: []const u8) bool { return Names.match(q, t, std.ascii.lowerString(&low, t), 0, null, null) != null; } -/// The tag's own words, in its order: its text after the prefix but `|`, -/// then for a terminal `Kill` (its job's), unless the tag has it. +/// The tag's words, in its order: its computed words, then its own text +/// but `|` (UX K'1), then for a terminal `Kill` (its job's), unless the +/// tag has it. const Words = struct { - words: std.mem.TokenIterator(u8, .any), + computed: std.mem.TokenIterator(u8, .any), + own: std.mem.TokenIterator(u8, .any), kill: bool, fn next(w: *Words) ?[]const u8 { - while (w.words.next()) |word| { + while (w.computed.next() orelse w.own.next()) |word| { if (std.mem.eql(u8, word, "|")) continue; if (std.mem.eql(u8, word, "Kill")) w.kill = false; return word; @@ -282,7 +294,38 @@ const Words = struct { }; fn tagWords(pane: *Pane) Words { - return .{ .words = std.mem.tokenizeAny(u8, tagline.curTail(pane), " \t\n"), .kill = pane.isTerminal() and pane.command == null }; + return .{ .computed = std.mem.tokenizeAny(u8, tagline.computedWords(pane), " "), .own = std.mem.tokenizeAny(u8, tagline.curTail(pane), " \t\n"), .kill = pane.isTerminal() and pane.command == null }; +} + +/// The words of the pane's kind its tag does not show now (UX K'4): those +/// its tag had before K' (tagline.kindTail: Save while clean, Term, +/// Collapse, Follow, Def, Refs, TreeContext, Mode, Filter, ...), then a +/// file's Undo and Redo (u, U); each runs from `:` as it ran from the tag. +const Others = struct { + pane: *Pane, + kind: std.mem.TokenIterator(u8, .scalar), + edits: u8, + + fn next(o: *Others) ?[]const u8 { + while (true) { + const word = o.kind.next() orelse edit: { + const all = [_][]const u8{ "Undo", "Redo" }; + if (o.edits == all.len) return null; + o.edits += 1; + break :edit all[o.edits - 1]; + }; + var shown = tagWords(o.pane); + while (shown.next()) |w| { + if (std.mem.eql(u8, w, word)) break; + } else return word; + } + } +}; + +fn otherWords(pane: *Pane) Others { + // A query's text is its rows (Query.zig): none of a file's edits. + const edits = pane.file != null and pane.query == null; + return .{ .pane = pane, .kind = std.mem.tokenizeScalar(u8, tagline.kindTail(pane), ' '), .edits = if (edits) 0 else 2 }; } /// What row `at` of the rows stands for, as Tab writes it: an answer's @@ -297,6 +340,8 @@ fn rowOf(p: *Pardes, pane: *Pane, c: *const Command, at: usize) ?[]const u8 { var words = tagWords(pane); var i: usize = c.answers; while (words.next()) |w| : (i += 1) if (i == at) return w; + var others = otherWords(pane); + while (others.next()) |w| : (i += 1) if (i == at) return w; return null; }, .themes => return if (at < colors.themes.len) colors.themes[at].name else null, @@ -320,8 +365,9 @@ fn answerAt(p: *const Pardes, pane: *const Pane, c: *const Command, at: usize) ? /// The command row `at` of the names is, by its index in `typed`. fn typedAt(c: *const Command, at: usize) ?usize { - if (c.rows != .names or at < @as(usize, c.answers) + c.words) return null; - const t = at - c.answers - c.words; + const before = @as(usize, c.answers) + c.words + c.others; + if (c.rows != .names or at < before) return null; + const t = at - before; return if (t < typed.len) t else null; } @@ -569,9 +615,9 @@ pub fn steps(p: *Pardes, arena: std.mem.Allocator, out: []Band.Step) !usize { _ = Names.match(q, t, std.ascii.lowerString(&low, t), 0, &marks, &nmarks); for (marks[0..nmarks]) |*m| m.* += lead; } - // The answers' last and the tag's last word ruled off from what is - // under them. - const last = c.rows == .names and i + 1 < s.nhits and (at + 1 == c.answers or at + 1 == @as(usize, c.answers) + c.words); + // The answers' last, the tag's last word and the pane's last other + // ruled off from what is under them. + const last = c.rows == .names and i + 1 < s.nhits and (at + 1 == c.answers or at + 1 == @as(usize, c.answers) + c.words or at + 1 == @as(usize, c.answers) + c.words + c.others); row.* = .{ .text = text.items, .on = i == s.rows.at, .key = if (ans != null) 1 else 0, .marks = try arena.dupe(u16, marks[0..nmarks]), .index = @intCast(i), .under = last }; } out[0] = .{ .rows = rows }; @@ -580,14 +626,14 @@ pub fn steps(p: *Pardes, arena: std.mem.Allocator, out: []Band.Step) !usize { return 2; } -/// What row `at` says on its right: a tag's word `in the tag`, what a -/// command takes, the theme in use, a setting's value now (its line of +/// What row `at` says on its right: a tag's word `in the tag`, the pane's +/// others `for this pane`, what a command takes, the theme in use, a setting's value now (its line of /// the settings' text `now`), the value it has. fn saidOf(p: *Pardes, arena: std.mem.Allocator, c: *const Command, at: usize, name: []const u8, now: []const u8) ![]const u8 { switch (c.rows) { .names => { if (at < c.answers) return "answers the question"; - const t = typed[typedAt(c, at) orelse return "in the tag"]; + const t = typed[typedAt(c, at) orelse return wordSaid(c, at)]; return if (t.arg.len > 0) try std.fmt.allocPrint(arena, "<{s}>", .{t.arg}) else ""; }, .themes => return if (p.custom_theme == null and at == p.settings.theme) "in use" else "", @@ -605,6 +651,11 @@ fn saidOf(p: *Pardes, arena: std.mem.Allocator, c: *const Command, at: usize, na } } +/// What a word row says: in the tag, or one of the pane's others. +fn wordSaid(c: *const Command, at: usize) []const u8 { + return if (at < @as(usize, c.answers) + c.words) "in the tag" else "for this pane"; +} + /// Setting `k`'s value now, as its word is written: `on`, `walk`. fn valueNow(p: *Pardes, k: u8, buf: []u8) []const u8 { const st = config.Settings.settings[@min(k, config.Settings.settings.len - 1)]; @@ -646,7 +697,7 @@ fn docRows(p: *Pardes, arena: std.mem.Allocator, pane: *Pane, c: *const Command, return rows; } const name = rowOf(p, pane, c, at) orelse ""; - rows[0] = .{ .text = try std.fmt.allocPrint(arena, "{s} in the tag", .{name}), .key = @intCast(name.len), .index = none }; + rows[0] = .{ .text = try std.fmt.allocPrint(arena, "{s} {s}", .{ name, wordSaid(c, at) }), .key = @intCast(name.len), .index = none }; rows[1] = .{ .text = if (std.meta.stringToEnum(pardes.Builtin, name)) |b| builtins.registry.doc(b).text else "A word of this pane's tag: ⏎ runs it, as B2 on it does.", .index = none }; return rows; } @@ -691,6 +742,9 @@ test ": opens a field in the tag after its key cell: the tag's own words first, defer frame.deinit(); const a = frame.allocator(); const pane = try p.setTestFile("b\na\nc\n"); + // Typed into: its tag's words Save Undo Del (UX K'3). + typeKeys(p, "ix"); + p.update(.{ .key = .{ .cp = Key.escape } }); const rest = try std.testing.allocator.dupe(u8, try tagOf(p)); defer std.testing.allocator.free(rest); typeKeys(p, ":"); @@ -699,19 +753,22 @@ test ": opens a field in the tag after its key cell: the tag's own words first, try std.testing.expectEqual(Prompt.Op.command, s.prompt.op); try std.testing.expectEqual(panes.Pane.Focus.body, pane.focus); // The head: its key cell, the field, the count, the hints. - try std.testing.expect(has(try tagOf(p), ": 16 commands Tab complete · ⏎ run · C-r history · esc")); + try std.testing.expect(has(try tagOf(p), ": 18 commands Tab complete · ⏎ run · C-r history · esc")); // The rows: the tag's words in its order, `in the tag`, the last ruled // off; then the commands, each what it takes. try std.testing.expect(has(try bandRow(p, a, 0), "▶ Save ")); try std.testing.expect(has(try bandRow(p, a, 0), "in the tag")); - try std.testing.expect(has(try bandRow(p, a, 1), " Term ")); + try std.testing.expect(has(try bandRow(p, a, 1), " Undo ")); // The doc beside them is the current row's: Save's. try std.testing.expect(has(try bandRow(p, a, 0), "Save in the tag")); const band = (try Band.of(p, a, pane, p.view().active)).?; const first = band.steps[0].rows; - try std.testing.expect(first[4].under and !first[3].under); - try std.testing.expect(has(first[5].text, "write w")); - try std.testing.expect(has(first[7].text, "theme") and has(first[7].text, "<theme>")); + try std.testing.expect(first[2].under and !first[1].under); + // Then its kind's words the tag does not show (UX K'4), ruled off too. + try std.testing.expect(has(first[3].text, "Term for this pane")); + try std.testing.expect(first[6].under and has(first[6].text, "Redo")); + try std.testing.expect(has(first[7].text, "write w")); + try std.testing.expect(has(first[9].text, "theme") and has(first[9].text, "<theme>")); // Typing filters both, by the scorer, in their order. typeKeys(p, "th"); try std.testing.expect(has(try tagOf(p), ": th = Exec th 1 command ")); @@ -990,3 +1047,43 @@ test "a question waiting on the pane lists its answers first, each after its key try std.testing.expect(has(try bandRow(p, a, 0), "▶ Save ")); p.update(.{ .key = .{ .cp = Key.escape } }); } + +test ": lists the words of the pane's kind its tag does not show now, `for this pane`: Save while the file is clean, Collapse, Undo; Enter runs any builtin as B2 does, Joincol too (UX K'4)" { + const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 160, .rows = 40 }); + defer p.deinit(); + var frame = std.heap.ArenaAllocator.init(std.testing.allocator); + defer frame.deinit(); + const a = frame.allocator(); + const pane = try p.setTestFile("one\n"); + const id = p.view().active; + // A file reading, clean: its tag's word `Del` (`Keep` is its walk's, + // after its path); the words its kind had before UX K' and a file's + // edits are the rest, in that order. + typeKeys(p, ":"); + const s = &p.view().tag_state; + try std.testing.expectEqual(@as(u8, 1), s.prompt.command.words); + try std.testing.expectEqual(@as(u8, 6), s.prompt.command.others); + const rows = (try Band.of(p, a, pane, id)).?.steps[0].rows; + try std.testing.expect(has(rows[0].text, "Del in the tag") and rows[0].under); + try std.testing.expect(has(rows[1].text, "Save for this pane")); + try std.testing.expect(has(rows[3].text, "Collapse for this pane")); + try std.testing.expect(has(rows[5].text, "Undo for this pane")); + try std.testing.expect(has(rows[6].text, "Redo for this pane") and rows[6].under); + try std.testing.expect(has(rows[7].text, "write w")); + // Its doc is the builtin's, said for this pane. + typeKeys(p, "Coll"); + try std.testing.expect(has(try bandRow(p, a, 0), "▶ Collapse ")); + try std.testing.expect(has(try bandRow(p, a, 0), "Collapse for this pane")); + p.update(.{ .key = .{ .cp = Key.escape } }); + // Enter runs the line as B2 runs a word: Joincol, in no pane's tag, + // from two columns folds this one into the one on its right. + try std.testing.expect(p.executeBuiltinLine(id, "Newcol")); + tagline.exitHeader(p); + p.view().active = id; + p.sync(); + try std.testing.expectEqual(@as(usize, 2), p.view().ncol); + typeKeys(p, ":Joincol"); + p.update(.{ .key = .{ .cp = Key.enter } }); + try std.testing.expectEqual(@as(usize, 1), p.view().ncol); + try std.testing.expectEqualStrings("one\n", pane.file.?.content); +} diff --git a/core/Core.zig b/core/Core.zig index 4c98977a..3a2e1f51 100644 --- a/core/Core.zig +++ b/core/Core.zig @@ -351,8 +351,6 @@ custom_theme: ?LegacyTheme = null, /// session's own theme untouched under it. theme_preview: ?u16 = null, preview_chrome: ChromeTheme = undefined, -/// bodyChrome's: the theme it was worked out for, and it. -body_chrome: ?struct { theme: LegacyTheme, chrome: ChromeTheme } = null, theme_file_path: config.Settings.Text(limits.host_path_cap) = .{}, /// The ThemeFile last loaded whole: what /ctl and DumpConfig name, and /// what a failed ThemeFile goes back to (colors.revertThemeFile). @@ -547,7 +545,7 @@ pub const replica = .{ "opts", "dump_out", "dump_export", "tape", }, - .derived = .{ "shell_rows", "diff_output", "locations_cache", "retired_panes", "tty_filter_palette", "body_chrome", "theme_preview", "preview_chrome" }, + .derived = .{ "shell_rows", "diff_output", "locations_cache", "retired_panes", "tty_filter_palette", "theme_preview", "preview_chrome" }, // The host's handles, the state file every session of the user // shares (and Recent read from it), this session's closed panes, and // the files of a host with no file system of its own. (The 9P @@ -1006,24 +1004,11 @@ fn setLastDumpInner(p: *Pardes, path: []const u8) void { ctlfs.events.notePath(p, "dump", path); } -/// The workspace tag's `Restore <path>` names `path` from now on: the -/// default's does by itself, and one the tag was edited around (its own -/// text) has the old path swapped, never left pointing at a dump that is -/// not the last. +/// The window row's `Restore <path>` names `path` from now on: a computed +/// word (UX K'2, tagline.headerWords), never the user's text. pub fn pointRestoreAt(p: *Pardes, path: []const u8) void { const copy = p.gpa.dupe(u8, path) catch |err| return p.reportError(.at(p.view().active), "Restore", err); - if (p.last_dump) |old| { - if (p.global_tag.own) |own| swap: { - const a = p.scratch.allocator(); - const was = std.fmt.allocPrint(a, "Restore {s}", .{old}) catch break :swap; - if (std.mem.indexOf(u8, own, was) == null) break :swap; - const now = std.fmt.allocPrint(a, "Restore {s}", .{path}) catch break :swap; - const swapped = std.mem.replaceOwned(u8, p.gpa, own, was, now) catch break :swap; - p.gpa.free(own); - p.global_tag.own = swapped; - } - p.gpa.free(old); - } + if (p.last_dump) |old| p.gpa.free(old); p.last_dump = copy; } @@ -1172,14 +1157,13 @@ fn acknowledgeShellInner(p: *Pardes, id: Pane.Id, executable: []const u8, prompt pane.greeted = false; pane.had_shell = true; pane.fs.unmarked = !prompt_marks; - // The tag's Term word names the shell the host ran, and a click - // on it (`Term+fish`) opens another of the same. + // The tag's text names the shell the host ran (tagline.defaultTail), + // and a click on it (`Term+fish`) opens another of the same. if (pane.command == null) { // A shell given as a path keeps it: its bare name would find // nothing, or another program, on the usual paths. const base = if (pane.shell) |given| (if (std.mem.indexOfScalar(u8, given, '/') != null) given else std.Io.Dir.path.basename(executable)) else std.Io.Dir.path.basename(executable); - const rest = tagline.terminal_pane_tail[" Term".len..]; - if (std.fmt.bufPrint(&pane.shell_tail, " Term+{s}{s}", .{ base, rest })) |tail| { + if (std.fmt.bufPrint(&pane.shell_tail, "Term+{s}", .{base})) |tail| { pane.shell_tail_len = @intCast(tail.len); } else |_| {} } @@ -2021,7 +2005,9 @@ pub fn layOut(p: *Pardes) void { // A file opened or closed this step: the kept list follows. p.saveRecent(); tagline.flattenHeaders(p); - if (p.headerColumn() != null and layout.columnBarHeight(p) == 0) { + // A column's tag with no row to be in lets the keyboard go; a lone + // column's keeps it in the window row (UX K'2). + if (p.headerColumn() != null and layout.columnBarHeight(p) == 0 and !layout.columnInWindowRow(p)) { tagline.exitHeader(p); } pardes.panes.reapPanes(p); @@ -2061,7 +2047,7 @@ pub fn layOut(p: *Pardes) void { const prefix: ?[]const u8 = tagline.prefixIn(p, wa, pane) catch null; // The tag's cursor and selections are offsets in its text at rest: // a head shown over its own text moves none of them (UX D1). - const at_rest = if (pardes.Trail.outOfRest(p, pane)) tagline.restPrefix(p, wa, pane) catch null else prefix; + const at_rest = if (pardes.Trail.outOfRest(p, pane) or pardes.TagState.asks(p, pane)) tagline.restPrefix(p, wa, pane) catch null else prefix; const lead = if (at_rest) |made| made.len else pane.tag_lead; if (lead != pane.tag_lead) { const t = &pane.tag; @@ -2187,10 +2173,11 @@ fn sizes(p: *const Pardes, pane: *const Pane) bool { return pane.sized_by == p.live; } +/// The theme in the old names, for what still reads a theme's own +/// fields (colors.ChromeTheme.view). pub fn theme(p: *const Pardes) *const LegacyTheme { - if (p.theme_preview) |i| return &colors.legacy_themes[i]; - if (p.custom_theme) |*custom| return custom; - return &colors.legacy_themes[p.settings.theme]; + if (p.theme_preview == null) if (p.custom_theme) |*custom| return custom; + return &p.chromeTheme().view; } /// The colours of the chrome: the theme's, set as it changes. @@ -2205,16 +2192,6 @@ pub fn chrome(p: *const Pardes) *const colors.Chrome { return &p.chromeTheme().resolved; } -/// The theme's own chrome, not a fade's (`theme()`'s, worked out once -/// per theme: its contrast searches take pow calls, too many for a -/// grapheme or a row). -pub fn bodyChrome(p: *Pardes) *const ChromeTheme { - const th = p.theme(); - if (p.body_chrome) |*cached| if (std.meta.eql(cached.theme, th.*)) return &cached.chrome; - p.body_chrome = .{ .theme = th.*, .chrome = ChromeTheme.fromTheme(th) }; - return &p.body_chrome.?.chrome; -} - /// When the core next needs a frame, on the `stepped_ns` timeline: a /// frame from now while work goes on (places to find, a picture /// decoding, a PDF page on a lane), the end of the wait while something @@ -2585,25 +2562,30 @@ test "topbar hover highlights exactly the executable word" { defer frame.deinit(); _ = try p.render(frame.allocator()); - p.update(.{ .mouse = .{ .button = .none, .kind = .motion, .col = TAG_TEXT_INSET + 1, .row = 0 } }); - _ = frame.reset(.retain_capacity); - const hovered = try p.render(frame.allocator()); - for (0.."Newcol".len) |col| { - const cell = hovered.at(TAG_TEXT_INSET + @as(u16, @intCast(col)), 0); - try std.testing.expectEqual(Color{ .rgb = p.theme().sel_bg }, cell.style.bg); - try std.testing.expectEqual(Color{ .rgb = p.theme().sel_fg }, cell.style.fg); - } - try std.testing.expectEqual(Color{ .rgb = p.chromeTheme().tag_bg }, hovered.at(TAG_TEXT_INSET + 6, 0).style.bg); + // Each side of the window row (UX K'2): the lone column's `New`, then + // the window's `Find`. + const words = tagline.windowRow(p).words; + for ([_]struct { at: u16, len: u16 }{ .{ .at = TAG_TEXT_INSET, .len = "New".len }, .{ .at = words, .len = "Find".len } }) |word| { + p.update(.{ .mouse = .{ .button = .none, .kind = .motion, .col = word.at + 1, .row = 0 } }); + _ = frame.reset(.retain_capacity); + const hovered = try p.render(frame.allocator()); + for (0..word.len) |col| { + const cell = hovered.at(word.at + @as(u16, @intCast(col)), 0); + try std.testing.expectEqual(Color{ .rgb = p.theme().sel_bg }, cell.style.bg); + try std.testing.expectEqual(Color{ .rgb = p.theme().sel_fg }, cell.style.fg); + } + try std.testing.expectEqual(Color{ .rgb = p.chromeTheme().tag_bg }, hovered.at(word.at + word.len, 0).style.bg); - p.update(.{ .mouse = .{ .button = .none, .kind = .motion, .col = TAG_TEXT_INSET + 6, .row = 0 } }); - _ = frame.reset(.retain_capacity); - const whitespace = try p.render(frame.allocator()); - try std.testing.expectEqual(Color{ .rgb = p.chromeTheme().tag_bg }, whitespace.at(TAG_TEXT_INSET + 1, 0).style.bg); + p.update(.{ .mouse = .{ .button = .none, .kind = .motion, .col = word.at + word.len, .row = 0 } }); + _ = frame.reset(.retain_capacity); + const whitespace = try p.render(frame.allocator()); + try std.testing.expectEqual(Color{ .rgb = p.chromeTheme().tag_bg }, whitespace.at(word.at + 1, 0).style.bg); + } p.update(.pointer_leave); _ = frame.reset(.retain_capacity); const left = try p.render(frame.allocator()); - try std.testing.expectEqual(Color{ .rgb = p.chromeTheme().tag_bg }, left.at(TAG_TEXT_INSET + 1, 0).style.bg); + try std.testing.expectEqual(Color{ .rgb = p.chromeTheme().tag_bg }, left.at(words + 1, 0).style.bg); } test "pane-tag Exec prefers Term and argument builtins before shell fallback" { @@ -2614,9 +2596,10 @@ test "pane-tag Exec prefers Term and argument builtins before shell fallback" { while (p.nextEffect()) |_| {} // initial shell spawn/geometry p.acknowledgeShell(.at(0), "/bin/sh", false); - // The Term word names the shell the host ran, and opens another of it. + // The Term word names the shell the host ran, and opens another of it: + // the tag's text after its computed Del (UX K'3). const pane = p.panes[0].?; - try std.testing.expectEqualStrings(" Term+sh" ++ tagline.terminal_pane_tail[" Term".len..], tagline.curTail(pane)); + try std.testing.expectEqualStrings("Term+sh", tagline.curTail(pane)); const tag_x = p.view().rects[0].x + TAG_TEXT_INSET; const tag_y = p.view().rects[0].y; @@ -2643,10 +2626,11 @@ test "pane-tag Exec prefers Term and argument builtins before shell fallback" { // Argument-taking builtins use the same gesture path: a tag sweep is the // complete command line, and Theme consumes its tail without a PTY write. if (pane.tag.own) |own| p.gpa.free(own); - pane.tag.own = try p.gpa.dupe(u8, " Theme dark"); - p.update(.{ .mouse = .{ .button = config.exec_button, .kind = .press, .col = tag_x + 1, .row = tag_y } }); - p.update(.{ .mouse = .{ .button = config.exec_button, .kind = .drag, .col = tag_x + 10, .row = tag_y } }); - p.update(.{ .mouse = .{ .button = config.exec_button, .kind = .release, .col = tag_x + 10, .row = tag_y } }); + pane.tag.own = try p.gpa.dupe(u8, "Theme dark"); + const theme_x = tag_x + @as(u16, @intCast(std.mem.indexOf(u8, try tagline.tagText(p, p.scratch.allocator(), pane), "Theme dark").?)); + p.update(.{ .mouse = .{ .button = config.exec_button, .kind = .press, .col = theme_x, .row = tag_y } }); + p.update(.{ .mouse = .{ .button = config.exec_button, .kind = .drag, .col = theme_x + 9, .row = tag_y } }); + p.update(.{ .mouse = .{ .button = config.exec_button, .kind = .release, .col = theme_x + 9, .row = tag_y } }); try std.testing.expectEqualStrings("dark", p.theme().name); while (p.nextEffect()) |effect| switch (effect) { .write => return error.ArgumentBuiltinFellThroughToPty, @@ -2662,9 +2646,10 @@ test "pane-tag Exec prefers Term and argument builtins before shell fallback" { // A word absent from the builtin vocabulary takes the fallback, including // the terminating carriage return expected by the shell prompt. if (pane.tag.own) |own| p.gpa.free(own); - pane.tag.own = try p.gpa.dupe(u8, " DefinitelyNotABuiltin"); - p.update(.{ .mouse = .{ .button = config.exec_button, .kind = .press, .col = tag_x + 1, .row = tag_y } }); - p.update(.{ .mouse = .{ .button = config.exec_button, .kind = .release, .col = tag_x + 1, .row = tag_y } }); + pane.tag.own = try p.gpa.dupe(u8, "DefinitelyNotABuiltin"); + const word_x = tag_x + @as(u16, @intCast(std.mem.indexOf(u8, try tagline.tagText(p, p.scratch.allocator(), pane), "Definitely").?)) + 1; + p.update(.{ .mouse = .{ .button = config.exec_button, .kind = .press, .col = word_x, .row = tag_y } }); + p.update(.{ .mouse = .{ .button = config.exec_button, .kind = .release, .col = word_x, .row = tag_y } }); var sent: [256]u8 = undefined; var sent_len: usize = 0; while (p.nextEffect()) |effect| switch (effect) { @@ -2736,12 +2721,14 @@ test "TreeContext command and custom tag survive a workspace round trip" { defer p.deinit(); const pane = try p.setTestFile("pub fn main() void {}\n"); try std.testing.expect(!pardes.panes.File.supportsContext(pane)); - try std.testing.expectEqualStrings(tagline.file_pane_tail, tagline.curTail(pane)); + try std.testing.expectEqualStrings(tagline.file_pane_tail, tagline.kindTail(pane)); const path = try p.gpa.dupe(u8, "/test.zig"); p.gpa.free(pane.file.?.path); pane.file.?.path = path; if (!pardes.panes.File.supportsContext(pane)) return error.SkipZigTest; - try std.testing.expectEqualStrings(if (lsp.speaks("/test.zig")) tagline.lsp_context_pane_tail else tagline.context_pane_tail, tagline.curTail(pane)); + // TreeContext is a word of its kind's (`:`'s, UX K'4), not its tag's. + try std.testing.expectEqualStrings(if (lsp.speaks("/test.zig")) tagline.lsp_context_pane_tail else tagline.context_pane_tail, tagline.kindTail(pane)); + try std.testing.expect(std.mem.indexOf(u8, try tagline.tagText(p, p.scratch.allocator(), pane), "TreeContext") == null); try std.testing.expect(!pane.file.?.tree_context); try std.testing.expect(p.executeBuiltinLine(0, "TreeContext on")); try std.testing.expect(pane.file.?.tree_context); @@ -2802,7 +2789,7 @@ test "Filter is ordered after Del and toggles only its terminal or +Pager pane" const pager_id = try pardes.panes.Output.openPager(p, 0, "/tmp"); const pager_pane = p.panes[pager_id].?; try testing.expect(pager_pane.tty_filter); - try testing.expectEqualStrings(tagline.pager_pane_tail, tagline.curTail(pager_pane)); + try testing.expectEqualStrings(" Filter Del", tagline.computedWords(pager_pane)); try testing.expectEqual(@as(u16, 0), pardes.panes.File.gutterWidth(pager_pane)); try testing.expect(p.executeBuiltinLine(pager_id, "Filter")); try testing.expect(!pager_pane.tty_filter); @@ -2832,7 +2819,9 @@ test "compact tag commands stay beside their own prefix across layout changes" { defer gpa.free(above_tag); const below_tag = try tagline.tagText(p, p.scratch.allocator(), below); try std.testing.expect(below_tag.len > above_tag.len); - const tail = tagline.terminal_pane_tail; + // Its computed Del, the blank before its own text (UX K'1), and that + // text: Term, its shell not yet named. + const tail = " Del Term"; try std.testing.expectEqualStrings(tail, above_tag[above_tag.len - tail.len ..]); try std.testing.expectEqual(above.cwdSlice().len + tail.len, above_tag.len); @@ -2844,7 +2833,7 @@ test "compact tag commands stay beside their own prefix across layout changes" { try std.testing.expectEqualStrings(above_tag, try tagline.tagText(p, p.scratch.allocator(), above)); p.update(.{ .resize = .{ .cols = 100, .rows = 30 } }); while (p.nextEffect()) |_| {} - try std.testing.expectEqualStrings(tail, tagline.curTail(below)); + try std.testing.expectEqualStrings("Term", tagline.curTail(below)); try below.appendTag(" lots and lots of typing out here"); try std.testing.expectEqual(above_tag.len, (try tagline.tagText(p, p.scratch.allocator(), above)).len); @@ -3116,7 +3105,7 @@ test "a REPL bound for a language takes the exec made on a body in it; tags, Exe try std.testing.expect(p.executeBuiltinLine(1, "Repl PY")); var idbuf: [48]u8 = undefined; try std.testing.expectEqualStrings("python-a", exec.replId(&idbuf, p.panes[1].?)); - try std.testing.expect(std.mem.endsWith(u8, try tagline.tagPrefix(p, p.panes[1].?), " python-a")); + try std.testing.expect(std.mem.endsWith(u8, try tagline.pathPrefix(p, p.scratch.allocator(), p.panes[1].?), " python-a")); Sent.drain(p); // A click on the file's body, a single word: typed into the REPL. @@ -3319,7 +3308,7 @@ test "a Term started by a shell's path keeps the path in its Term+ word" { try std.testing.expect(p.executeBuiltinLine(0, "Term /bin/sh")); try std.testing.expect(p.view().active != 0); p.acknowledgeShell(.at(p.view().active), "/bin/sh", false); - try std.testing.expect(std.mem.startsWith(u8, tagline.curTail(p.panes[p.view().active].?), " Term+/bin/sh ")); + try std.testing.expectEqualStrings("Term+/bin/sh", tagline.curTail(p.panes[p.view().active].?)); } test "Tty, Term's old name in saved tags, runs as Term, bare and with its +shell" { @@ -3345,7 +3334,7 @@ test "Term+fish, one word a tag can hold, opens a terminal on that shell" { try std.testing.expect(p.view().active != 0); try std.testing.expectEqualStrings("sh", p.panes[p.view().active].?.shell.?); p.acknowledgeShell(.at(p.view().active), "/bin/sh", false); - try std.testing.expect(std.mem.startsWith(u8, tagline.curTail(p.panes[p.view().active].?), " Term+sh ")); + try std.testing.expectEqualStrings("Term+sh", tagline.curTail(p.panes[p.view().active].?)); p.view().active = 0; // A shell that is not there is said, not quietly replaced, and the // pane that asked gets no shell of its own. @@ -3385,7 +3374,7 @@ test "a command pane shows how its command ended, and the next command there run } var frame = std.heap.ArenaAllocator.init(gpa); defer frame.deinit(); - try std.testing.expect(std.mem.endsWith(u8, try tagline.tagPrefix(p, pane), "(make -j8) running")); + try std.testing.expect(std.mem.endsWith(u8, try tagline.pathPrefix(p, p.scratch.allocator(), pane), "(make -j8) running")); // Running, a second command goes to a pane of its own. const other = exec.execute(p, 1, "ls") orelse return error.NoCommandPane; try std.testing.expect(other != dst); @@ -3403,7 +3392,7 @@ test "a command pane shows how its command ended, and the next command there run try std.testing.expect(p.panes[dst] == pane and !pane.command_pty); try std.testing.expect(p.panes[dst] == pane); try std.testing.expect(pane.command_done); - try std.testing.expect(std.mem.endsWith(u8, try tagline.tagPrefix(p, pane), "(make -j8) exit 2")); + try std.testing.expect(std.mem.endsWith(u8, try tagline.pathPrefix(p, p.scratch.allocator(), pane), "(make -j8) exit 2")); // Kill leaves a finished one be. try std.testing.expect(p.executeBuiltinLine(0, "Kill make")); while (p.nextEffect()) |effect| if (effect == .signal_pty and effect.signal_pty.pane.index() == dst) return error.SignalledAFinishedCommand; @@ -3425,7 +3414,7 @@ test "a command pane shows how its command ended, and the next command there run const ended = std.mem.indexOf(u8, body, "exit 2") orelse return error.ExitLost; const next = std.mem.indexOf(u8, body, "% make test") orelse return error.NoSeparator; try std.testing.expect(said < ended and ended < next); - try std.testing.expect(std.mem.endsWith(u8, try tagline.tagPrefix(p, pane), "(make test) running")); + try std.testing.expect(std.mem.endsWith(u8, try tagline.pathPrefix(p, p.scratch.allocator(), pane), "(make test) running")); // Kill stops a running one: its whole process group, SIGTERM. try std.testing.expect(p.executeBuiltinLine(0, "Kill make")); var signalled = false; @@ -3786,18 +3775,17 @@ test "tabbed file aligns syntax cursor and mouse at the nearest insertion gap" { try std.testing.expect(look.expandedSel(p, pane, .{ .state = .dragging, .c0 = separator, .c1 = separator, .r0 = BOX_H, .r1 = BOX_H }) == null); } -test "the workspace tag's Restore word names the last dump, the tag edited around it or not, across a Restore too" { +test "the window row's Restore word names the last dump, the user's text after it, across a Restore too (UX K'2)" { const p = try Pardes.init(std.testing.allocator, .{ .cols = 100, .rows = 20, .tty_only = true }); defer p.deinit(); p.setLastDump("/tmp/a.zon"); - // The tag edited: its own text holds the Restore word as it was then. - p.global_tag.own = try p.gpa.dupe(u8, try std.fmt.allocPrint(p.scratch.allocator(), "{s} Mine", .{tagline.headerDefault(p, .workspace)})); + p.global_tag.own = try p.gpa.dupe(u8, "Mine"); p.setLastDump("/tmp/b.zon"); - try std.testing.expect(std.mem.indexOf(u8, p.global_tag.own.?, "Restore /tmp/b.zon Mine") != null); + try std.testing.expectEqualStrings("Find Grep Newcol Help Exit Restore /tmp/b.zon Mine", tagline.topbar(p)); try dump.dumpState(p); const restored = try dump.restore(p, p.dump_out.?, "/tmp/c.zon"); defer restored.deinit(); - try std.testing.expect(std.mem.indexOf(u8, restored.global_tag.own.?, "Restore /tmp/c.zon Mine") != null); + try std.testing.expectEqualStrings("Find Grep Newcol Help Exit Restore /tmp/c.zon Mine", tagline.topbar(restored)); try std.testing.expectEqualStrings("/tmp/c.zon", restored.last_dump.?); } @@ -3806,27 +3794,45 @@ test "editable workspace and column tags are typed into and persist" { defer p.deinit(); _ = try p.setTestFile("untouched\n"); p.presented(); - try std.testing.expectEqual(TOPBAR_H + COLBAR_H, p.view().rects[0].y); + // One column: its tag in the window row, no column row (UX K'2). + try std.testing.expectEqual(TOPBAR_H, p.view().rects[0].y); + const words = tagline.windowRow(p).words; // a sweep over a header is its selection, the caret where it ended - p.update(.{ .mouse = .{ .button = .left, .kind = .press, .col = TAG_TEXT_INSET, .row = 0 } }); - p.update(.{ .mouse = .{ .button = .left, .kind = .drag, .col = TAG_TEXT_INSET + 6, .row = 0 } }); - p.update(.{ .mouse = .{ .button = .left, .kind = .release, .col = TAG_TEXT_INSET + 6, .row = 0 } }); + p.update(.{ .mouse = .{ .button = .left, .kind = .press, .col = words, .row = 0 } }); + p.update(.{ .mouse = .{ .button = .left, .kind = .drag, .col = words + 6, .row = 0 } }); + p.update(.{ .mouse = .{ .button = .left, .kind = .release, .col = words + 6, .row = 0 } }); try std.testing.expect(p.global_tag.vsel.active and p.global_tag.vsel.col == 0 and p.global_tag.cur_col == 6); - // A clicked header is in normal mode: `a` types after the sweep's - // last character, the blank it ended on. + // A clicked header is in normal mode: `a` types after the sweep's last + // character, in the computed words: refused, they are no one's. p.update(.{ .key = .{ .cp = 'a', .text = "a" } }); p.update(.{ .key = .{ .cp = 'H', .text = "Help " } }); - try std.testing.expect(std.mem.startsWith(u8, p.global_tag.own.?, "Newcol Help Joincol")); + try std.testing.expect(p.global_tag.own == null); p.update(.{ .key = .{ .cp = Key.escape } }); - p.update(.{ .mouse = .{ .button = .left, .kind = .press, .col = TAG_TEXT_INSET, .row = TOPBAR_H } }); - p.update(.{ .mouse = .{ .button = .left, .kind = .release, .col = TAG_TEXT_INSET, .row = TOPBAR_H } }); + // After them, the user's text. + const end: u16 = @intCast(words + "Find Grep Newcol Help Exit ".len); + p.update(.{ .mouse = .{ .button = .left, .kind = .press, .col = end, .row = 0 } }); + p.update(.{ .mouse = .{ .button = .left, .kind = .release, .col = end, .row = 0 } }); + p.update(.{ .key = .{ .cp = 'i', .text = "i" } }); + p.update(.{ .key = .{ .cp = 'H', .text = "Help " } }); + try std.testing.expectEqualStrings("Help ", p.global_tag.own.?); + try std.testing.expectEqualStrings("Find Grep Newcol Help Exit Help ", tagline.topbar(p)); + p.update(.{ .key = .{ .cp = Key.escape } }); + // The column's tag, at the window row's left: typed into, it has the + // user's text and the column row comes for it; emptied, it goes. + const own: u16 = TAG_TEXT_INSET + "New Term ".len; + p.update(.{ .mouse = .{ .button = .left, .kind = .press, .col = own, .row = 0 } }); + p.update(.{ .mouse = .{ .button = .left, .kind = .release, .col = own, .row = 0 } }); + try std.testing.expectEqual(@as(?usize, 0), p.headerColumn()); p.update(.{ .key = .{ .cp = 'i', .text = "i" } }); p.update(.{ .key = .{ .cp = 'é', .text = "é" } }); - try std.testing.expect(std.mem.startsWith(u8, tagline.columnTag(p, 0), "éNew")); + try std.testing.expectEqualStrings("New Term é", tagline.columnTag(p, 0)); + try std.testing.expectEqual(TOPBAR_H + COLBAR_H, p.view().rects[0].y); p.update(.{ .key = .{ .cp = Key.backspace } }); - try std.testing.expect(std.mem.startsWith(u8, tagline.columnTag(p, 0), "New")); + try std.testing.expectEqualStrings("New Term ", tagline.columnTag(p, 0)); + try std.testing.expectEqual(TOPBAR_H, p.view().rects[0].y); + try std.testing.expectEqual(@as(?usize, 0), p.headerColumn()); p.update(.{ .paste = "Grep " }); - try std.testing.expect(std.mem.startsWith(u8, tagline.columnTag(p, 0), "Grep New")); + try std.testing.expectEqualStrings("New Term Grep ", tagline.columnTag(p, 0)); try std.testing.expectEqualStrings("untouched\n", p.panes[0].?.file.?.content); try dump.dumpState(p); const restored = try dump.restore(p, p.dump_out.?, "test"); @@ -3838,7 +3844,7 @@ test "editable workspace and column tags are typed into and persist" { try dump.dumpState(p); const empty = try dump.restore(p, p.dump_out.?, "test"); defer empty.deinit(); - try std.testing.expectEqualStrings("", tagline.columnTag(empty, 0)); + try std.testing.expectEqualStrings("New Term ", tagline.columnTag(empty, 0)); } test "column tag first-cell execution keeps New local to the clicked column" { @@ -3866,6 +3872,7 @@ test "a screen too short for the column row releases a column tag's focus withou defer p.deinit(); const pane = try p.setTestFile("unchanged body\n"); p.view().col_tags[0].own = try p.gpa.dupe(u8, "New Help"); + p.sync(); p.presented(); const shown = p.view().rects[0]; try std.testing.expectEqual(TOPBAR_H + COLBAR_H, shown.y); @@ -3879,7 +3886,7 @@ test "a screen too short for the column row releases a column tag's focus withou try std.testing.expect(p.view().header == null and p.headerColumn() == null); p.update(.{ .resize = .{ .cols = 60, .rows = 12 } }); try std.testing.expectEqual(shown, p.view().rects[0]); - try std.testing.expectEqualStrings("New Help", tagline.columnTag(p, 0)); + try std.testing.expectEqualStrings("New Term New Help", tagline.columnTag(p, 0)); try std.testing.expectEqualStrings("unchanged body\n", pane.file.?.content); } diff --git a/core/Dir.zig b/core/Dir.zig index 869a7cd5..b9c8c917 100644 --- a/core/Dir.zig +++ b/core/Dir.zig @@ -360,7 +360,7 @@ test "a look at a directory opens a pane named for it with a /, its entries in c try testing.expectEqual(id, p.view().active); const pane = p.panes[id].?; try testing.expectEqualStrings(".dot sub/ top.txt\n", pane.file.?.content); - try testing.expectEqualStrings(@import("tagline.zig").dir_pane_tail, @import("tagline.zig").curTail(pane)); + try testing.expectEqualStrings(" Get Del", @import("tagline.zig").computedWords(pane)); try testing.expectEqualStrings(s.dir, Pardes.paneDir(pane)); // Edited, still never dirty, and no Save writes it. try testing.expect(p.executeBuiltinLine(id, "Edit ,d")); diff --git a/core/Effect.zig b/core/Effect.zig index 72244f2b..6146df69 100644 --- a/core/Effect.zig +++ b/core/Effect.zig @@ -448,8 +448,9 @@ test "Save on an output buffer writes its rows out and leaves the buffer alone" const rows = try gpa.dupe(u8, out.file.?.content); defer gpa.free(rows); - // Save leads its tagline now, and the path is REQUIRED: a bare Save asks - try std.testing.expectEqualStrings(tagline.file_pane_tail, tagline.curTail(out)); + // Save is one of its words (`:`'s, UX K'4), and the path is REQUIRED: a + // bare Save asks + try std.testing.expectEqualStrings(tagline.file_pane_tail, tagline.kindTail(out)); try std.testing.expect(p.executeBuiltinLine(id, "Save")); try std.testing.expect(out.prompt == .save); try edit.insertKey(p.editor(), &out.input, .{ .cp = 'h', .text = "help.txt" }); @@ -632,25 +633,29 @@ test "a save whose pane is gone before the drain writes nothing" { try std.testing.expect(p.fallback.get("/tmp/pardes-gone/recycled.txt") == null); } -test "Save reaches every tagline with text behind it and no other" { +test "Save is a word of every pane with text behind it and no other" { const gpa = std.testing.allocator; const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 100, .rows = 30 }); defer p.deinit(); while (p.nextEffect()) |_| {} + // Its kind's words (what `:` lists, UX K'4); its tag's, while clean, + // Del alone (K'3). const out = try p.setTestFile("build.zig:1:1 pub fn main\n"); out.file.?.output = .{ .from = .search }; - try std.testing.expectEqualStrings(tagline.locations_pane_tail, tagline.curTail(out)); + try std.testing.expectEqualStrings(tagline.locations_pane_tail, tagline.kindTail(out)); + try std.testing.expectEqualStrings(" Del", tagline.computedWords(out)); - // A scratch is an output buffer that wears the FILE tails. + // A scratch is an output buffer that has the FILE words. out.file.?.output = .{ .from = .{ .cmd = std.meta.stringToEnum(pardes.Builtin, "New").? } }; - try std.testing.expectEqualStrings(" Save Term Collapse Follow Del", tagline.curTail(out)); + try std.testing.expectEqualStrings(" Save Term Collapse Follow Del", tagline.kindTail(out)); // An image's bytes on disk already are what they are: nothing of the // pane's own is unwritten, so the word is absent and inert. const img_id = p.freeSlot().?; const img = try pardes.Kind.open(p, img_id, pardes.Kind.test_kind.of(p), "/tmp/pardes-tag.ppm", ""); - try std.testing.expectEqualStrings(" Term Collapse Del", tagline.curTail(img)); + try std.testing.expectEqualStrings(" Del", tagline.kindTail(img)); + try std.testing.expectEqualStrings(" Del", tagline.computedWords(img)); try std.testing.expect(p.executeBuiltinLine(img_id, "Save")); try std.testing.expect(img.prompt != .save); var buf: [256]u8 = undefined; diff --git a/core/File.zig b/core/File.zig index d16b0c73..d54d5011 100644 --- a/core/File.zig +++ b/core/File.zig @@ -60,35 +60,39 @@ pub const History = struct { } }; -/// Owned syntax results: a text's declarations at a revision. +/// Owned syntax results: a text's declarations and symbols at a revision. pub const ContextCache = struct { /// Its revision is dumped and digested: a worker's parse is an input, /// which a client joined since never saw, and a step reads what it - /// left (Query.ownerDecls). The declarations are made again from the - /// text at a load (`reload`), with the allocator that made them. - pub const replica = .{ .local = .{"allocator"}, .derived = .{"declarations"} }; + /// left (Query.ownerDecls, the Symbols source). The declarations and + /// symbols are made again from the text at a load (`reload`), with the + /// allocator that made them. + pub const replica = .{ .local = .{"allocator"}, .derived = .{ "declarations", "symbols" } }; allocator: ?std.mem.Allocator = null, declarations: []syntax.ContextDeclaration = &.{}, + symbols: []syntax.Symbol = &.{}, revision: ?u32 = null, pub fn deinit(self: *ContextCache) void { - if (self.allocator) |gpa| gpa.free(self.declarations); + if (self.allocator) |gpa| { + gpa.free(self.declarations); + gpa.free(self.symbols); + } self.* = .{}; } - /// A loaded text's (its revision the dump's): its declarations parsed - /// again where they are of the text it has. + /// A loaded text's (its revision the dump's): its context parsed + /// again where it is of the text it has. pub fn reload(self: *ContextCache, gpa: std.mem.Allocator, path: []const u8, content: []const u8, revision: u32) void { const at = self.revision orelse return; if (at != revision) return; - const declarations = syntax.contextDeclarations(gpa, path, content) catch return; - self.replace(gpa, declarations, at); + self.replace(gpa, syntax.context(gpa, path, content) catch return, at); } - /// Takes ownership of declarations allocated by gpa. - pub fn replace(self: *ContextCache, gpa: std.mem.Allocator, declarations: []syntax.ContextDeclaration, revision: u32) void { + /// Takes ownership of a context allocated by gpa. + pub fn replace(self: *ContextCache, gpa: std.mem.Allocator, made: syntax.Context, revision: u32) void { self.deinit(); - self.* = .{ .allocator = gpa, .declarations = declarations, .revision = revision }; + self.* = .{ .allocator = gpa, .declarations = made.declarations, .symbols = made.symbols, .revision = revision }; } }; @@ -2197,12 +2201,17 @@ pub fn unchain(pane: *Pane) void { dropUnfollow(pane); } -/// The Unfollow word Follow gave a pane's tag (builtins.Follow), gone. +/// The Unfollow word Follow gave a pane's tag (builtins.Follow), gone, with +/// the blank before it (after it, first in the tag's own text). fn dropUnfollow(pane: *Pane) void { const own = pane.tag.own orelse return; - const at = std.mem.indexOf(u8, own, " Unfollow") orelse return; - const end = at + " Unfollow".len; - if (end < own.len and std.mem.indexOfScalar(u8, " \t\n", own[end]) == null) return; + const word = std.mem.indexOf(u8, own, "Unfollow") orelse return; + const word_end = word + "Unfollow".len; + const blank_after = word_end < own.len and std.mem.indexOfScalar(u8, " \t\n", own[word_end]) != null; + if (word_end < own.len and !blank_after) return; + if (word > 0 and own[word - 1] != ' ') return; + const at = if (word > 0) word - 1 else word; + const end = if (word == 0 and blank_after) word_end + 1 else word_end; const cut = std.mem.concat(pane.gpa, u8, &.{ own[0..at], own[end..] }) catch return; pane.gpa.free(own); pane.tag.own = cut; @@ -2496,8 +2505,7 @@ pub fn changed(p: *Pardes, id: u8, bytes: []const u8) void { pub fn refreshContext(p: *Pardes, pane: *Pane, f: *State) void { if (!f.tree_context or !supportsContext(pane) or f.context.revision == f.revision) return; // The file's declarations, in its lines (the layer's are none of it). - const declarations = syntax.contextDeclarations(p.tree_sitter_gpa, f.path, fileText(f, p.scratch.allocator()) catch return) catch return; - f.context.replace(p.tree_sitter_gpa, declarations, f.revision); + f.context.replace(p.tree_sitter_gpa, syntax.context(p.tree_sitter_gpa, f.path, fileText(f, p.scratch.allocator()) catch return) catch return, f.revision); } pub fn refreshHighlights(p: *Pardes) void { @@ -2923,7 +2931,8 @@ pub const Layers = struct { pub const SynStyle = struct { fg: [3]u8, bold: bool }; pub fn synStyle(p: *Pardes, sy: syntax.Syn) ?SynStyle { - return .{ .fg = Colors.synInk(p.theme(), sy) orelse return null, .bold = false }; + if (sy == .none) return null; + return .{ .fg = p.chrome().syntax[@intFromEnum(sy)], .bold = false }; } /// syntax colors: recolor each content cell from its tree-sitter style byte; @@ -2946,9 +2955,9 @@ pub fn recolorSyntax(p: *Pardes, s: *Surface, pane: *Pane, f: *State, r: pardes. const tz_recolor = tracy.zone(@src(), "synRecolor"); defer tz_recolor.end(); // A row whose first byte names a hue (syntax.ground_add, _del): its - // grounds, the theme's, worked out once a frame and only for one. - var grounds: ?Colors.Grounds = null; - const ink = ansi.inkOf(p.theme()); + // grounds, the chrome's (R10). + const chrome = p.chrome(); + const ink = ansi.inkOf(p); var filtered_storage: pardes.Term.Filter = undefined; const filtered: ?*pardes.Term.Filter = if (pane.tty_filter and spans.len > 0) blk: { filtered_storage = pardes.Term.filter(&ink, &p.tty_filter_palette); @@ -2986,14 +2995,11 @@ pub fn recolorSyntax(p: *Pardes, s: *Surface, pane: *Pane, f: *State, r: pardes. const row_index: usize = @intCast(@max(0, pane.wrapAt(p.settings.tab, vr).line)); const metadata: ?locations.Row = if (row_index < f.location_rows.len) f.location_rows[row_index] else null; const decoration = Output.decorateRow(f.output, line, metadata); - const chrome: ?*const pardes.ChromeTheme = if (decoration.plain()) null else p.bodyChrome(); + const decorated = !decoration.plain(); // The row's first byte: its hue and its ground, on every wrapped // row of it (syntax.ground_add). const lead: u8 = if (base >= highlight_start and base - highlight_start < highlights.len) highlights[base - highlight_start] else 0; - const tint: ?Colors.Grounds.Ground = if (lead & (syntax.ground_add | syntax.ground_del) == 0) null else (grounds orelse ground: { - grounds = .of(p.theme()); - break :ground grounds.?; - }).forStyle(lead); + const tint: ?*const Colors.Chrome.Diff = if (lead & syntax.ground_add != 0) &chrome.add else if (lead & syntax.ground_del != 0) &chrome.del else null; // 2, the patch: the row's ground. if (tint) |t| if (prefix_width < tw) { const ground: ?[3]u8 = if (lead & syntax.ground_emph != 0) t.row else if (lead & syntax.ground_line != 0) t.line else null; @@ -3010,7 +3016,7 @@ pub fn recolorSyntax(p: *Pardes, s: *Surface, pane: *Pane, f: *State, r: pardes. var c: usize = 0; const pad: usize = if (vr < pane.wrap_n) pane.wrap_pad[vr] else 0; for (0..@min(pad, tw -| prefix_width)) |col| { - s.at(tx + @as(u16, @intCast(prefix_width + col)), body_y + vr).style.fg = .{ .rgb = p.bodyChrome().diagnostic_info }; + s.at(tx + @as(u16, @intCast(prefix_width + col)), body_y + vr).style.fg = .{ .rgb = chrome.page.dim }; } var screen_c: usize = pad; var table_buf: [Tables.max_pads]Tables.Pad = undefined; @@ -3058,7 +3064,7 @@ pub fn recolorSyntax(p: *Pardes, s: *Surface, pane: *Pane, f: *State, r: pardes. } // Results keep their exact live text. Only the location, // matched source range and diagnostic label gain emphasis. - if (if (chrome) |ch| decoration.styleAt(ch, hs + c) else null) |style| { + if (if (decorated) decoration.styleAt(chrome, hs + c) else null) |style| { var fill: usize = 0; while (fill < cells and prefix_width + screen_c + fill < tw) : (fill += 1) { const cell = s.at(tx + @as(u16, @intCast(prefix_width + screen_c + fill)), body_y + vr); @@ -3110,6 +3116,7 @@ pub fn paintWordSelection( word_lo: i32, word_hi: i32, bg: [3]u8, + fg: ?[3]u8, ) void { const tx = r.x + config.GUTTER; const tw = r.w - config.GUTTER; @@ -3128,7 +3135,7 @@ pub fn paintWordSelection( const c1 = @as(i32, prefix_width) + here.pad + displayEndOffset(p.settings.tab, pane, row, here.at, hi - 1); const col = @max(@as(i32, prefix_width), c0); const end = @min(c1 + 1, @as(i32, tw)); - if (col < end) s.tint(tx + @as(u16, @intCast(col)), body_y + @as(u16, @intCast(vr)), @intCast(end - col), bg, null); + if (col < end) s.tint(tx + @as(u16, @intCast(col)), body_y + @as(u16, @intCast(vr)), @intCast(end - col), bg, fg); } } @@ -3621,12 +3628,13 @@ test "context cache frees each allocation with its original allocator" { defer std.testing.expect(second.deinit() == .ok) catch @panic("second allocator leaked"); var cache: ContextCache = .{}; defer cache.deinit(); - cache.replace(first.allocator(), try first.allocator().alloc(syntax.ContextDeclaration, 1), 1); - cache.replace(second.allocator(), try second.allocator().alloc(syntax.ContextDeclaration, 2), 2); + cache.replace(first.allocator(), .{ .declarations = try first.allocator().alloc(syntax.ContextDeclaration, 1), .symbols = try first.allocator().alloc(syntax.Symbol, 1) }, 1); + cache.replace(second.allocator(), .{ .declarations = try second.allocator().alloc(syntax.ContextDeclaration, 2), .symbols = try second.allocator().alloc(syntax.Symbol, 2) }, 2); try std.testing.expectEqual(@as(?u32, 2), cache.revision); cache.deinit(); try std.testing.expect(cache.allocator == null); try std.testing.expectEqual(@as(usize, 0), cache.declarations.len); + try std.testing.expectEqual(@as(usize, 0), cache.symbols.len); } /// The inks of row `row`'s first `n` text cells of pane `id` as `s` draws them. diff --git a/core/Handover.zig b/core/Handover.zig index 6f7340b2..f60ce72b 100644 --- a/core/Handover.zig +++ b/core/Handover.zig @@ -628,6 +628,10 @@ test "a column let go over another window goes beside the column the pointer is const gpa = std.testing.allocator; const from = try twoPanes(gpa); defer from.deinit(); + // A column's grip is in the column row, which a second column brings + // (UX K'2). + try std.testing.expect(from.executeBuiltinLine(0, "Newcol")); + from.sync(); const r = from.view().rects[0]; const c = layout.findPane(from, 0).?.col; from.update(.{ .mouse = .{ .button = .left, .kind = .press, .col = from.view().col_x[c], .row = from.topBarHeight() } }); diff --git a/core/Kind.zig b/core/Kind.zig index e220ead7..4841a55c 100644 --- a/core/Kind.zig +++ b/core/Kind.zig @@ -325,10 +325,10 @@ pub fn reopen(p: *Pardes, id: usize, s: *Slot, bytes: ?[]const u8) bool { if (s.plain) |b| if (b.len > 0) s.gpa.free(b); s.plain = &.{}; } + // Its tag's computed words (UX K'3): its words, then Del. var w: std.Io.Writer = .fixed(&s.tail.bytes); - w.writeAll(" Term") catch {}; for (p.kinds.words[0..p.kinds.nwords]) |*kw| if (kw.kind == k and kw.opens == 0) w.print(" {s}", .{kw.name.slice()}) catch {}; - w.writeAll(" Collapse Del") catch {}; + w.writeAll(" Del") catch {}; s.tail.len = @intCast(w.buffered().len); } s.opened = if (bytes) |b| std.hash.Wyhash.hash(0, b) else 0; diff --git a/core/Messages.zig b/core/Messages.zig index e05961b5..fb2c3cde 100644 --- a/core/Messages.zig +++ b/core/Messages.zig @@ -435,6 +435,18 @@ pub fn ink(chrome: *const pardes.colors.ChromeTheme, kind: Kind) [3]u8 { }; } +/// A message's ink on a ground of the chrome (R9): an error's, a warning's +/// and a question's their severity's held there (a question info's), an +/// echo, a notice and progress the ground's dim ink. +pub fn inkOn(inks: *const pardes.colors.Chrome.Inks, kind: Kind) [3]u8 { + return switch (kind) { + .@"error" => inks.severity[0], + .warn => inks.severity[1], + .question => inks.severity[2], + .echo, .notice, .progress => inks.dim, + }; +} + /// The places a compiler's report names put on `s`: each /// `path:line:col: error|warning|note: words` row (a relative path is /// `dir`'s), its words there, each place once, and the rows after the @@ -1554,7 +1566,8 @@ test "a question never adds a row to its tag: at every width the asking tag take } test "a file changed on disk under unsaved text asks in its tag and never takes the keyboard: SPC e's keyboard answers, d shows the disk's lines as ghosts, Esc leaves it waiting, B2 on Reload reads it again" { - const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 20 }); + // Wide: the tag at rest one row (UX K'3), the question whole in it. + const p = try Pardes.init(std.testing.allocator, .{ .cols = 200, .rows = 20 }); defer p.deinit(); var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); diff --git a/core/Names.zig b/core/Names.zig index 01dbecf0..9105e3c4 100644 --- a/core/Names.zig +++ b/core/Names.zig @@ -50,6 +50,9 @@ pub const Cand = struct { /// What the row is of: a line of the owner (Symbols, 1-based), a /// pane's serial (Panes); 0 for a path. ref: u32 = 0, + /// Its group: the hits stay in their groups' order, scored within + /// each (a Symbols row's kind, UX DESIGN N3); 0 for every other source. + group: u8 = 0, }; pub const Hit = struct { cand: u32, score: i32 }; @@ -189,9 +192,17 @@ pub fn reachTo(n: *Names, rows: usize) void { n.gen +%= 1; } -/// Hit `a` goes before `b`: the higher score, then the shorter key, then -/// the candidate added first. +/// Hit `a` goes before `b`: the lower group, then `better`. fn before(cands: []const Cand, a: Hit, b: Hit) bool { + const ga = cands[a.cand].group; + const gb = cands[b.cand].group; + if (ga != gb) return ga < gb; + return better(cands, a, b); +} + +/// Hit `a` matched better than `b`: the higher score, then the shorter +/// key, then the candidate added first. +fn better(cands: []const Cand, a: Hit, b: Hit) bool { if (a.score != b.score) return a.score > b.score; const la = cands[a.cand].key_len; const lb = cands[b.cand].key_len; @@ -232,6 +243,22 @@ fn sink(heap: []Hit, cands: []const Cand, from: usize) void { } } +/// The row of the hit the query matched best, wherever its group puts it: +/// where a list's cursor starts (UX DESIGN N3); 0 for an empty query, +/// whose rows are the source's order. Its rows up to it are sorted once +/// `reachTo` has gone past it. +pub fn bestRow(n: *const Names) usize { + const hits = n.hits.items; + if (hits.len == 0 or std.mem.trim(u8, n.queryText(), " ").len == 0) return 0; + var top = hits[0]; + for (hits[1..]) |h| if (better(n.cands.items, h, top)) { + top = h; + }; + var at: usize = 0; + for (hits) |h| at += @intFromBool(before(n.cands.items, h, top)); + return at; +} + /// The row of hit `i` and, in `marks`, the bytes of it the query matched. pub fn row(n: *const Names, i: usize, marks: []u16, nmarks: *usize) []const u8 { const c = n.cands.items[n.hits.items[i].cand]; diff --git a/core/Output.zig b/core/Output.zig index fe1543fe..f0b32c4e 100644 --- a/core/Output.zig +++ b/core/Output.zig @@ -70,27 +70,20 @@ const RowDecoration = struct { return row.guide_end == 0 and !row.declaration and row.location_end == 0 and row.prefix_end == 0 and row.mark_end <= row.mark_start; } - /// `chrome` is the theme's own (Pardes.bodyChrome): body paper changes - /// immediately, so its ink must change with it even while the - /// surrounding tags are still fading. Once a frame, never a grapheme: - /// working it out takes the contrast searches' pow calls. - pub fn styleAt(row: RowDecoration, chrome: *const pardes.ChromeTheme, byte: usize) ?pardes.CellStyle { + /// On the page (`chrome`, Pardes.chrome): a tree's guides in the dim + /// ink, a location in the line numbers', the match a hit, a + /// diagnostic's label in its severity's ink (R8, R9). + pub fn styleAt(row: RowDecoration, chrome: *const pardes.colors.Chrome, byte: usize) ?pardes.CellStyle { if (row.plain()) return null; - if (byte < row.guide_end) return .{ .fg = .{ .rgb = chrome.diagnostic_info } }; + if (byte < row.guide_end) return .{ .fg = .{ .rgb = chrome.page.dim } }; if (row.declaration or byte < @max(row.location_end, row.prefix_end)) - return .{ .fg = .{ .rgb = chrome.lineno } }; + return .{ .fg = .{ .rgb = chrome.line_number } }; if (byte < row.mark_start or byte >= row.mark_end) return null; if (row.severity == .none) return .{ - .fg = .{ .rgb = chrome.search_fg }, - .bg = .{ .rgb = chrome.search_bg }, + .fg = .{ .rgb = chrome.page.text }, + .bg = .{ .rgb = chrome.hit }, }; - return .{ .fg = .{ .rgb = switch (row.severity) { - .err => chrome.diagnostic_error, - .warning => chrome.diagnostic_warning, - .info => chrome.diagnostic_info, - .hint => chrome.diagnostic_hint, - .none => unreachable, - } }, .bold = true }; + return .{ .fg = .{ .rgb = chrome.page.severity[@intFromEnum(row.severity) - 1] }, .bold = true }; } }; @@ -198,11 +191,15 @@ pub fn traits(o: Origin) Traits { }; } +/// A list laid out as Locations (each place's lines from its file, in +/// their order): not a file's symbols, a row each in their own order (UX +/// DESIGN N: types, functions, fields, the rest). pub fn usesLocationsConfig(from: Origin) bool { const tr = traits(from); return tr.steps and !tr.commands and from != .kind and !std.meta.eql(from, Origin{ .query = .completion }) and - !std.meta.eql(from, Origin{ .query = .callstack }); + !std.meta.eql(from, Origin{ .query = .callstack }) and + !std.meta.eql(from, Origin{ .query = .document_symbols }); } pub fn fileTraits(out: ?State) Traits { @@ -244,6 +241,8 @@ pub fn isResultRow(file: *const File.State, row: usize) bool { return !locations.isContextLine(modal.lineSlice(file.content, row)); } +/// A language server's places in the order of their places; a file's +/// symbols stay in theirs (lsp_client: types, functions, fields, the rest). fn sortResults(arena: std.mem.Allocator, from: Origin, content: []u8, anchor: ?usize) !?usize { switch (from) { .search => {}, @@ -258,7 +257,6 @@ fn sortResults(arena: std.mem.Allocator, from: Origin, content: []u8, anchor: ?u .outgoing_calls, .supertypes, .subtypes, - .document_symbols, .workspace_symbols, .diagnostics, .workspace_diagnostics, diff --git a/core/Pick.zig b/core/Pick.zig index 5951f925..c05ed084 100644 --- a/core/Pick.zig +++ b/core/Pick.zig @@ -482,7 +482,10 @@ pub fn filter(p: *Pardes, pk: *Pick) void { const q = std.mem.trim(u8, p.view().tag_state.field.text(), " "); p.view().tag_state.rows.at = 0; pk.shown = no_row; - if (fuzzy(pk)) return pk.names.typed(p.gpa, q); + if (fuzzy(pk)) { + pk.names.typed(p.gpa, q); + return toBest(p, pk); + } if (pk.source == .grep) { pk.found.clearRetainingCapacity(); pk.found_bytes.clearRetainingCapacity(); @@ -551,15 +554,31 @@ pub fn declsArrived(p: *Pardes, serial: u32) void { Query.gather(p, &pk.names, .symbols, pk.dir.slice(), null, p.paneBySerial(serial)); pk.names.typed(p.gpa, pk.names.queryText()); pk.names.rescore(p.gpa); + if (live(p) == pk) toBest(p, pk); }; } +/// The live picker's cursor on its best match, wherever its group puts it +/// (UX DESIGN N3: a Symbols list stays grouped while typed), its rows +/// sorted as far as the band shows past it. +fn toBest(p: *Pardes, pk: *Pick) void { + const at = pk.names.bestRow(); + pk.names.reachTo(at + Band.Cursor.shown); + p.view().tag_state.rows.at = @intCast(@min(at, std.math.maxInt(u16))); +} + /// After every step: each live picker's names scored on (a frame's count), /// and on a frame of its own after the cursor stood, the preview of the /// current row. pub fn produceAll(p: *Pardes, tick: bool) void { for (p.picks) |slot| if (slot) |pk| if (pk.unrolled) { - if (pk.names.busy()) pk.names.rescore(p.gpa); + if (pk.names.busy()) { + // A cursor on the best match follows it while the rest are + // scored. + const on_best = live(p) == pk and p.view().tag_state.rows.at == pk.names.bestRow(); + pk.names.rescore(p.gpa); + if (on_best) toBest(p, pk); + } // A theme's preview in the step of the key that moved to it. if (pk.source == .themes) pardes.colors.previewTheme(p, refAt(p, pk)); if (tick) preview(p, pk); @@ -621,7 +640,7 @@ const Target = union(enum) { none, place: struct { path: []const u8, at: look.Sp /// Row `i` as the band shows it and what it points at, its text in /// `arena`. -const Row = struct { text: []const u8, key: u8 = 0, pre: u16 = 0, faint: u16 = 0, dim: bool = false, marks: []const u16 = &.{}, target: Target = .none, meta: []const u8 = "" }; +const Row = struct { text: []const u8, key: u8 = 0, kind: u8 = 0, pre: u16 = 0, faint: u16 = 0, quiet: [2]u16 = .{ 0, 0 }, dim: bool = false, marks: []const u16 = &.{}, target: Target = .none, meta: []const u8 = "" }; fn rowAt(p: *Pardes, pk: *const Pick, arena: std.mem.Allocator, i: usize) std.mem.Allocator.Error!Row { const dir = pk.dir.slice(); @@ -687,8 +706,22 @@ fn rowAt(p: *Pardes, pk: *const Pick, arena: std.mem.Allocator, i: usize) std.me row.dim = p.paneBySerial(cand.ref) == null; row.target = .{ .pane = cand.ref }; }, + // ` 12 m Counts.lines : usize = 0` (Query.gather): the line its + // meta, the mark in the keyword's ink, the qualifier and what + // follows the name dim (UX DESIGN N4). .symbols => { - row.pre = 6; + const line = 8; + if (text.len <= line or cand.key < line) return row; + row.text = text[line..]; + row.meta = std.mem.trimStart(u8, text[0..6], " "); + const marks_in = try arena.alloc(u16, row.marks.len); + for (marks_in, row.marks) |*m, at| m.* = at -| line; + row.marks = marks_in; + const name_at = cand.key - line; + row.kind = @intCast(name_at - 1); + row.pre = @intCast(name_at); + row.faint = cand.base; + if (name_at + cand.key_len < row.text.len) row.quiet = .{ @intCast(name_at + cand.key_len), @intCast(row.text.len) }; const owner = p.panes[p.paneBySerial(pk.owner) orelse return row] orelse return row; const f = owner.file orelse return row; row.target = .{ .place = .{ .path = f.path, .at = .{ .line = cand.ref } } }; @@ -878,7 +911,7 @@ pub fn steps(p: *Pardes, arena: std.mem.Allocator) ![]Band.Step { const rows = try arena.alloc(Band.Row, w.hi - w.lo); for (rows, w.lo..) |*row, i| { const r = try rowAt(p, pk, arena, i); - row.* = .{ .text = r.text, .key = r.key, .on = i == s.rows.at, .mark = marked(pk, idOf(pk, i)) != null, .dim = r.dim, .pre = r.pre, .faint = r.faint, .marks = r.marks, .index = @intCast(i), .meta = r.meta }; + row.* = .{ .text = r.text, .key = r.key, .kind = r.kind, .on = i == s.rows.at, .mark = marked(pk, idOf(pk, i)) != null, .dim = r.dim, .pre = r.pre, .faint = r.faint, .quiet = r.quiet, .marks = r.marks, .index = @intCast(i), .meta = r.meta }; } // A place's text (a Grep's line, a list's): its `path:line` in the dim // ink and the text after it in one column, the widest place shown @@ -1285,8 +1318,8 @@ pub fn ghosts(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: if (rows <= first) return; const w: usize = s.cols; const old = try arena.dupe(Cell, s.cells[(y0 + first) * w .. (y0 + rows) * w]); - const grounds = colors.Grounds.of(p.theme()); - const ink = p.theme().fg orelse p.theme().tag_fg; + const chrome = p.chrome(); + const ink = chrome.page.text; const x0 = r.x + config.GUTTER + File.gutterWidth(pane); const width = r.w -| (x0 - r.x); var out: usize = first; @@ -1303,15 +1336,15 @@ pub fn ghosts(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: if (out >= rows) break; const y: u16 = @intCast(y0 + out); s.fill(0, y, @intCast(s.cols), 1, .{}); - s.fill(x0, y, width, 1, .{ .bg = .{ .rgb = grounds.add.row } }); - _ = s.print(x0, y, width, l, .{ .fg = .{ .rgb = ink }, .bg = .{ .rgb = grounds.add.row } }); + s.fill(x0, y, width, 1, .{ .bg = .{ .rgb = chrome.add.row } }); + _ = s.print(x0, y, width, l, .{ .fg = .{ .rgb = ink }, .bg = .{ .rgb = chrome.add.row } }); out += 1; }; } } if (out >= rows) break; @memcpy(s.cells[(y0 + out) * w ..][0..w], old[(vr - first) * w ..][0..w]); - if (g < groups.items.len and line >= groups.items[g].lo and line < groups.items[g].hi) s.tint(x0, @intCast(y0 + out), width, grounds.del.row, null); + if (g < groups.items.len and line >= groups.items[g].lo and line < groups.items[g].hi) s.tint(x0, @intCast(y0 + out), width, chrome.del.row, null); out += 1; } } @@ -1524,6 +1557,7 @@ fn refine(p: *Pardes, pk: *Pick, drop: bool) void { if (drop and (if (pk.marks.items.len > 0) marked(pk, h.cand) != null else h.cand == current)) continue; const c = pk.names.cands.items[h.cand]; next.add(p.gpa, pk.names.bytes.items[c.start..][0..c.len], c.key, c.key_len, c.base, c.ref) catch break; + next.cands.items[next.cands.items.len - 1].group = c.group; } } else { var arena = std.heap.ArenaAllocator.init(p.gpa); @@ -1623,7 +1657,7 @@ fn keep(p: *Pardes, pk: *Pick) void { const row = rowAt(p, pk, arena.allocator(), i) catch break; switch (row.target) { .place => |t| if (pk.source == .symbols) - out.writer.print("{s}:{d} {s}\n", .{ std.Io.Dir.path.basename(t.path), t.at.line, std.mem.trimStart(u8, row.text, " 0123456789") }) catch break + out.writer.print("{s}:{d} {s}\n", .{ std.Io.Dir.path.basename(t.path), t.at.line, row.text }) catch break else out.writer.print("{s}\n", .{row.text}) catch break, else => out.writer.print("{s}\n", .{row.text}) catch break, @@ -2697,15 +2731,15 @@ test "code actions: a picker in the asking pane's tag, the one under the cursor const r = p.view().rects[id]; const x = r.x + config.GUTTER + File.gutterWidth(pane); const y = p.bodyTop(pane, r); - const grounds = colors.Grounds.of(p.theme()); + const chrome = p.chrome(); for ([_][]const u8{ "o", "t", "t", "t" }, [_][]const u8{ "n", "w", "w", "h" }, 0..) |c0, c1, row| { try std.testing.expectEqualStrings(c0, shot.at(x, y + @as(u16, @intCast(row))).grapheme()); try std.testing.expectEqualStrings(c1, shot.at(x + 1, y + @as(u16, @intCast(row))).grapheme()); } try std.testing.expectEqualStrings("a", shot.at(x + 4, y + 1).grapheme()); try std.testing.expectEqualStrings("s", shot.at(x + 4, y + 2).grapheme()); - try std.testing.expectEqual(pardes.Color{ .rgb = grounds.del.row }, shot.at(x, y + 1).style.bg); - try std.testing.expectEqual(pardes.Color{ .rgb = grounds.add.row }, shot.at(x, y + 2).style.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = chrome.del.row }, shot.at(x, y + 1).style.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = chrome.add.row }, shot.at(x, y + 2).style.bg); try std.testing.expectEqualStrings("one\ntwo add\nthree\n", pane.file.?.content); // An action lands nowhere: no landing line, no `▸` before the line it // changes, no sentence of where Enter lands (UX D7's are a jump's; an @@ -2722,10 +2756,10 @@ test "code actions: a picker in the asking pane's tag, the one under the cursor frame = std.heap.ArenaAllocator.init(std.testing.allocator); shot = try p.render(frame.allocator()); try std.testing.expectEqualStrings("/", shot.at(x, y).grapheme()); - try std.testing.expectEqual(pardes.Color{ .rgb = grounds.add.row }, shot.at(x, y).style.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = chrome.add.row }, shot.at(x, y).style.bg); try std.testing.expectEqualStrings("o", shot.at(x, y + 1).grapheme()); - try std.testing.expect(!std.meta.eql(pardes.Color{ .rgb = grounds.del.row }, shot.at(x, y + 1).style.bg)); - try std.testing.expect(!std.meta.eql(pardes.Color{ .rgb = p.chromeTheme().roles.hit }, shot.at(x, y + 1).style.bg)); + try std.testing.expect(!std.meta.eql(pardes.Color{ .rgb = chrome.del.row }, shot.at(x, y + 1).style.bg)); + try std.testing.expect(!std.meta.eql(pardes.Color{ .rgb = p.chrome().hit }, shot.at(x, y + 1).style.bg)); // `3`: the rename applied, the tag at rest; one undo takes it back. p.update(.{ .key = .{ .cp = '3', .text = "3" } }); try std.testing.expectEqual(TagState.Kind.rest, s.kind); @@ -2832,16 +2866,16 @@ test "a picker's preview is legible as one (UX D7): its landing line on the hit }; try std.testing.expectEqual(@as(?u16, @intCast((pane.rows + 2) / 3)), at); const y = body_y + at.?; - const roles = &p.chromeTheme().roles; + const c = p.chrome(); const tx = r.x + pardes.config.GUTTER; const gutter = File.gutterWidth(pane); // Its text on the hit ground across the row; the row above as it was. - for (gutter..r.w - pardes.config.GUTTER) |x| try std.testing.expectEqual(pardes.Color{ .rgb = roles.hit }, s.at(tx + @as(u16, @intCast(x)), y).style.bg); - try std.testing.expect(!std.meta.eql(s.at(tx + gutter + 2, y - 1).style.bg, pardes.Color{ .rgb = roles.hit })); + for (gutter..r.w - pardes.config.GUTTER) |x| try std.testing.expectEqual(pardes.Color{ .rgb = c.hit }, s.at(tx + @as(u16, @intCast(x)), y).style.bg); + try std.testing.expect(!std.meta.eql(s.at(tx + gutter + 2, y - 1).style.bg, pardes.Color{ .rgb = c.hit })); // `▸` in the key ink in the gutter's cell after the number. const mark = s.at(tx + gutter - 1, y); try std.testing.expectEqualStrings("▸", mark.grapheme()); - try std.testing.expectEqual(pardes.Color{ .rgb = roles.key }, mark.style.fg); + try std.testing.expectEqual(pardes.Color{ .rgb = c.page.key }, mark.style.fg); // The notice row: where Enter lands, the owner's address a word in it. var buf: [pardes.Messages.notice_row_cap]u8 = undefined; const said = pardes.Messages.noticeRow(p, 120, &buf); @@ -3396,6 +3430,217 @@ test "Ctrl-r in a picker unrolls its source's earlier queries (UX L2's last line p.update(.{ .key = .{ .cp = Key.escape } }); } +/// A Symbols picker opened from a file pane whose path is `name` and text +/// `text`, its symbols parsed (small: here and now), and the pane. +fn openSymbols(p: *Pardes, name: []const u8, text: []const u8) !*Pane { + const pane = try p.setTestFile(text); + p.gpa.free(pane.file.?.path); + pane.file.?.path = try p.gpa.dupe(u8, name); + open(p, p.view().active, .symbols, "", "", ""); + settle(p); + return pane; +} + +/// The live picker's rows, `meta text` a line each. +fn rowLines(p: *Pardes, a: std.mem.Allocator) ![]const u8 { + const pk = live(p).?; + var out: std.ArrayList(u8) = .empty; + for (0..count(p, pk)) |i| { + const r = try rowAt(p, pk, a, i); + try out.print(a, "{s: >2} {s}\n", .{ r.meta, r.text }); + } + return out.items; +} + +const counts_zig = + \\const std = @import("std"); + \\pub const Counts = struct { + \\ lines: usize = 0, + \\ words: usize = 0, + \\ pub const zero: Counts = .{}; + \\ pub fn add(c: *Counts, text: []const u8) void { + \\ const local = text.len; + \\ c.lines += local; + \\ } + \\}; + \\const Mode = enum { fast, slow }; + \\var hits: u32 = 0; + \\pub fn count(text: []const u8) Counts { + \\ return .{ .lines = text.len }; + \\} + \\test "count.add" {} + \\ +; + +test "Symbols (UX DESIGN N): a Zig file's rows types, functions, fields, then the rest, each in the text's order with the field empty; a row its kind's mark, its name qualified, what its first line says after it, its line the meta; the mark in the keyword's ink, the qualifier and the rest dim" { + const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 140, .rows = 50 }); + defer p.deinit(); + p.settings.jumps = .walk; + var frame = std.heap.ArenaAllocator.init(std.testing.allocator); + defer frame.deinit(); + const a = frame.allocator(); + _ = try openSymbols(p, "/w6/counts.zig", counts_zig); + try std.testing.expectEqualStrings( + \\ 2 t Counts = struct + \\11 t Mode = enum { fast, slow } + \\ 6 f Counts.add (c: *Counts, text: []const u8) void + \\13 f count (text: []const u8) Counts + \\ 3 m Counts.lines : usize = 0 + \\ 4 m Counts.words : usize = 0 + \\11 m Mode.fast + \\11 m Mode.slow + \\ 1 n std = @import("std") + \\ 5 c Counts.zero : Counts = .{} + \\12 v hits : u32 = 0 + \\16 · "count.add" + \\ + , try rowLines(p, a)); + // The qualifier dim, `Counts.`; a name holding a `.` none of it. + try std.testing.expectEqual(@as(u16, "Counts.".len), (try rowAt(p, live(p).?, a, 4)).faint); + try std.testing.expectEqual(@as(u16, 0), (try rowAt(p, live(p).?, a, 11)).faint); + // Drawn: `m Counts.lines : usize = 0` (not the cursor's row). + const pane = p.panes[p.paneBySerial(live(p).?.landing).?].?; + _ = try p.render(a); + const layer = &p.surface.tag_layers[pardes.BAND_LAYER]; + const roles = &p.chromeTheme().roles; + const inks = roles.on(if (Trail.reading(p, pane)) .reading_focused else .focused); + var found = false; + for (0..layer.rows) |y| { + const cells = layer.cells[y * layer.cols ..][0..layer.cols]; + var text: std.ArrayList(u8) = .empty; + var at: std.ArrayList(usize) = .empty; + for (cells, 0..) |c, x| { + try at.append(a, text.items.len); + try text.appendSlice(a, c.grapheme()); + _ = x; + } + const from = std.mem.indexOf(u8, text.items, "m Counts.lines") orelse continue; + var x: usize = 0; + while (at.items[x] < from) x += 1; + try std.testing.expectEqual(pardes.Color{ .rgb = p.chrome().on(.focus).kind }, cells[x].style.fg); + try std.testing.expectEqual(pardes.Color{ .rgb = inks.dim }, cells[x + 2].style.fg); + try std.testing.expectEqual(pardes.Color{ .rgb = inks.text }, cells[x + 9].style.fg); + try std.testing.expectEqual(pardes.Color{ .rgb = inks.dim }, cells[x + 16].style.fg); + // Its line at the row's right end, dim. + const three = std.mem.lastIndexOfScalar(u8, text.items, '3').?; + var m: usize = 0; + while (at.items[m] < three) m += 1; + try std.testing.expect(m > x + 30); + try std.testing.expectEqual(pardes.Color{ .rgb = inks.dim }, cells[m].style.fg); + found = true; + } + try std.testing.expect(found); +} + +test "Symbols (UX DESIGN N3): typed, the rows stay grouped, scored within each group, and the cursor starts on the best match wherever its group puts it; the name alone is matched, never the signature" { + const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 140, .rows = 50 }); + defer p.deinit(); + p.settings.jumps = .walk; + var frame = std.heap.ArenaAllocator.init(std.testing.allocator); + defer frame.deinit(); + const a = frame.allocator(); + const pane = try openSymbols(p, "/w6/counts.zig", counts_zig); + for ("count") |c| p.update(.{ .key = .{ .cp = c, .text = &[_]u8{c} } }); + settle(p); + const rows = try rowLines(p, a); + try std.testing.expect(std.mem.startsWith(u8, rows, + \\ 2 t Counts = struct + \\13 f count (text: []const u8) Counts + \\ 6 f Counts.add (c: *Counts, text: []const u8) void + \\ 3 m Counts.lines : usize = 0 + \\ 4 m Counts.words : usize = 0 + \\ + )); + // `count` matched best: the cursor on it, not on the first row, and + // the count says where it is. + const s = &p.view().tag_state; + try std.testing.expectEqual(@as(u16, 1), s.rows.at); + const h = (try head(p, a, p.panes[p.paneBySerial(live(p).?.landing).?].?)).?; + try std.testing.expect(std.mem.indexOf(u8, h.text, "2/7") != null); + // Enter lands on its line. + _ = pane; + // `u8` is in signatures only: nothing matches. + for (0..5) |_| p.update(.{ .key = .{ .cp = pardes.Key.backspace } }); + for ("u8") |c| p.update(.{ .key = .{ .cp = c, .text = &[_]u8{c} } }); + settle(p); + try std.testing.expectEqual(@as(usize, 0), count(p, live(p).?)); +} + +test "Symbols (UX DESIGN N): a C++ file's rows by its kind table, members named in their class and namespace, a function's locals none" { + const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 140, .rows = 50 }); + defer p.deinit(); + p.settings.jumps = .walk; + var frame = std.heap.ArenaAllocator.init(std.testing.allocator); + defer frame.deinit(); + _ = try openSymbols(p, "/w6/parser.cc", + \\#define LIMIT 4 + \\namespace torque { + \\class Parser : public Base { + \\ public: + \\ Parser(); + \\ int Parse(int depth) const { return depth; } + \\ int depth_; + \\}; + \\enum class Kind { kA, kB }; + \\int Parser::Run(int n) { int local = n; return local; } + \\static int counter = 0; + \\const int limit = 4; + \\using Alias = int; + \\} + \\ + ); + try std.testing.expectEqualStrings( + \\ 3 t torque.Parser : public Base + \\ 9 t torque.Kind + \\13 t torque.Alias = int + \\ 5 f torque.Parser.Parser () + \\ 6 f torque.Parser.Parse (int depth) const + \\10 f torque.Parser::Run (int n) + \\ 7 m torque.Parser.depth_ + \\ 9 m torque.Kind.kA + \\ 9 m torque.Kind.kB + \\ 1 · LIMIT 4 + \\ 2 n torque + \\11 v torque.counter = 0 + \\12 c torque.limit = 4 + \\ + , try rowLines(p, frame.allocator())); +} + +test "Symbols: every row is ordinary text: no header rows, the cursor steps onto each in turn, the band shows each row's text, and C-q keeps them in a +Search with the mark a word" { + const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 140, .rows = 50 }); + defer p.deinit(); + p.settings.jumps = .walk; + var frame = std.heap.ArenaAllocator.init(std.testing.allocator); + defer frame.deinit(); + const a = frame.allocator(); + _ = try openSymbols(p, "/w6/counts.zig", counts_zig); + const pk = live(p).?; + const n = count(p, pk); + try std.testing.expectEqual(@as(usize, 12), n); + const s = &p.view().tag_state; + for (0..n) |i| { + try std.testing.expectEqual(@as(u16, @intCast(i)), s.rows.at); + const r = try rowAt(p, pk, a, i); + const host = p.paneBySerial(pk.landing).?; + const band = (try Band.of(p, a, p.panes[host].?, host)).?; + var shown = false; + for (0..band.height) |y| { + const ln = try band.line(a, p.settings.tab, @intCast(y)); + shown = shown or std.mem.indexOf(u8, ln.text, r.text) != null; + } + try std.testing.expect(shown); + p.update(.{ .key = .{ .cp = pardes.Key.down } }); + } + p.update(.{ .key = .{ .cp = 'q', .ctrl = true } }); + var kept: ?[]const u8 = null; + for (p.panes) |slot| if (slot) |tp| if (tp.file) |f| if (std.mem.startsWith(u8, f.content, "Symbols ")) { + kept = f.content; + }; + try std.testing.expect(std.mem.indexOf(u8, kept.?, "\ncounts.zig:3 m Counts.lines : usize = 0\n") != null); + try std.testing.expect(std.mem.indexOf(u8, kept.?, "\ncounts.zig:2 t Counts = struct\n") != null); +} + test "Find and Grep search the work tree (W8): from a pane deep in a repo Find lists the files from its root and `sub/name` narrows it, a leading directory narrows Grep, and outside a repo they search the pane's directory" { const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 30 }); defer p.deinit(); diff --git a/core/Pipe.zig b/core/Pipe.zig index 1ef2e4ea..e94d2099 100644 --- a/core/Pipe.zig +++ b/core/Pipe.zig @@ -480,8 +480,9 @@ test "| in a tag pipes the tag's own text, and undo there brings it back" { defer p.deinit(); while (p.nextEffect()) |_| {} const pane = try p.setTestFile("body\n"); - for ("::") |c| p.update(.{ .key = .{ .cp = c } }); // the tag (`:` on the empty `:` field), on Save - p.update(.{ .key = .{ .cp = 'e' } }); // Save selected + pane.tag.own = try gpa.dupe(u8, "Look here"); // the user's text (UX K'1) + for ("::") |c| p.update(.{ .key = .{ .cp = c } }); // the tag (`:` on the empty `:` field), on its own text + p.update(.{ .key = .{ .cp = 'e' } }); // Look selected p.update(.{ .key = .{ .cp = '|' } }); try std.testing.expect(pane.focus == .tag and pane.prompt == .pipe and pane.prompt_for == .tag); p.update(.{ .key = .{ .cp = 't', .text = "tr a-z A-Z" } }); @@ -490,13 +491,13 @@ test "| in a tag pipes the tag's own text, and undo there brings it back" { const id = nextPipeEffect(p) orelse return error.MissingPipeEffect; const request = p.pipe.pipeRequest(id) orelse return error.MissingPipeRequest; try std.testing.expectEqual(@as(usize, 1), request.inputs.len); - try std.testing.expectEqualSlices(u8, "Save", request.inputs[0]); - const outputs: []const []const u8 = &.{"SAVE"}; + try std.testing.expectEqualSlices(u8, "Look", request.inputs[0]); + const outputs: []const []const u8 = &.{"LOOK"}; p.update(.{ .pipe_resp = .{ .id = id, .success = true, .outputs = outputs } }); - try std.testing.expect(std.mem.startsWith(u8, pardes.tagline.curTail(pane), " SAVE ")); + try std.testing.expectEqualStrings("LOOK here", pardes.tagline.curTail(pane)); try std.testing.expectEqualStrings("body\n", pane.file.?.content); p.update(.{ .key = .{ .cp = 'u' } }); - try std.testing.expect(std.mem.startsWith(u8, pardes.tagline.curTail(pane), " Save ")); + try std.testing.expectEqualStrings("Look here", pardes.tagline.curTail(pane)); } test "$ keeps the selections the command exits 0 on, and a real shell gives that verdict" { diff --git a/core/Places.zig b/core/Places.zig index 8563d7c8..b4ef17aa 100644 --- a/core/Places.zig +++ b/core/Places.zig @@ -659,19 +659,17 @@ pub fn origin(set: *const Places, pane: *Pane) usize { } /// Every place on the rows shown, tinted over the text: the hit ground, -/// the current one the current hit's (colors.Roles, UX D4, D14). +/// the current one solid in the hue with the page's ink (R8, UX D14); a +/// search prompt's pattern that is no regex, its last places dimmed: the +/// current on the hit ground, the rest faint. pub fn paint(set: *Places, p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, body_h: u16) void { if (!set.shows(pane)) return; const f = &pane.file.?; - const th = p.theme(); - const roles = &p.chromeTheme().roles; - var strong = roles.hit_current; - var quiet = roles.hit; - // A search prompt's pattern that is no regex: its last places, dimmed. - if (pardes.Prompt.dims(p, pane)) { - strong = quiet; - quiet = colors.mix(th.bg orelse th.tag_bg, quiet); - } + const c = p.chrome(); + const dim = pardes.Prompt.dims(p, pane); + const strong = if (dim) c.hit else c.hit_current; + const strong_ink: ?[3]u8 = if (dim) null else c.hit_current_text; + const quiet = if (dim) c.hit_faint else c.hit; const hits = set.hits.items; if (hits.len == 0) return; const nlines = File.nlines(p.gpa, f); @@ -697,7 +695,7 @@ pub fn paint(set: *Places, p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, const b = @min(hits[i].end, le) - ls; if (b <= a) continue; const current = set.current != null and set.current.? == i; - File.paintWordSelection(p, s, pane, r, line, @intCast(a), @intCast(b), if (current) strong else quiet); + File.paintWordSelection(p, s, pane, r, line, @intCast(a), @intCast(b), if (current) strong else quiet, if (current) strong_ink else null); } } } @@ -903,3 +901,42 @@ test "a session's places loaded from its dump find what an edit makes as the ses b.panes[b.view().active].?.file.?.mtime = a.panes[a.view().active].?.file.?.mtime; try std.testing.expectEqual(pardes.walk.digest(Pardes, a), pardes.walk.digest(Pardes, b)); } + +test "places: each on the hit ground in its text's own ink, the current one solid, the hue its ground and the page its ink (R8, G7), the selection over it; a search whose field is no regex dims them, the rest faint" { + const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 24 }); + defer p.deinit(); + colors.setThemeIndex(p, colors.themeIndex("orchard").?); + const pane = try p.setTestFile("alpha beta\ngamma alpha\nb\nb\nb\nb\nb\nb\nb\nzeta alpha\n"); + // Landed on the first, the caret then moved off it: the places stay. + typeKeys(p, "/alpha"); + p.update(.{ .key = .{ .cp = pardes.Key.enter } }); + typeKeys(p, "j"); + try std.testing.expect(pane.places.shows(pane)); + try std.testing.expectEqual(@as(?usize, 0), pane.places.current); + const c = p.chrome(); + var frame: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer frame.deinit(); + const r = p.view().rects[0]; + const x = r.x + pardes.config.GUTTER + File.gutterWidth(pane); + const y = p.bodyTop(pane, r); + var s = try p.render(frame.allocator()); + for (0..5) |i| { + const current = s.at(x + @as(u16, @intCast(i)), y).style; + try std.testing.expectEqual(pardes.Color{ .rgb = c.hit_current }, current.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = c.hit_current_text }, current.fg); + const other = s.at(x + 6 + @as(u16, @intCast(i)), y + 1).style; + try std.testing.expectEqual(pardes.Color{ .rgb = c.hit }, other.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = c.page.text }, other.fg); + } + // Searched again from line 2: its place current and selected, drawn as + // the place (body_layer: one meaning, one look); then `(`, no regex: the + // others faint (line 10's: the prompt's words lie over the top rows). + typeKeys(p, "/alpha"); + try std.testing.expectEqual(@as(?usize, 1), pane.places.current); + s = try p.render(frame.allocator()); + for (0..4) |i| try std.testing.expectEqual(pardes.Color{ .rgb = c.hit_current }, s.at(x + 6 + @as(u16, @intCast(i)), y + 1).style.bg); + typeKeys(p, "("); + try std.testing.expect(pardes.Prompt.dims(p, pane)); + s = try p.render(frame.allocator()); + for (5..10) |i| try std.testing.expectEqual(pardes.Color{ .rgb = c.hit_faint }, s.at(x + @as(u16, @intCast(i)), y + 9).style.bg); +} diff --git a/core/Prompt.zig b/core/Prompt.zig index b76b2d9a..49a9645d 100644 --- a/core/Prompt.zig +++ b/core/Prompt.zig @@ -874,7 +874,7 @@ pub fn paintGutter(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, body_h: const tab = p.settings.tab; const x = gutterX(pane, r); const y = p.bodyTop(pane, r); - const ink = p.chromeTheme().roles.key; + const ink = p.chrome().page.key; const nlines = File.nlines(p.gpa, f); // `▸` on the current place's line alone: the lines with places are the // rail's ticks (Places.addTicks), never glyphs of their own (UX D14). @@ -953,8 +953,8 @@ pub fn ghosts(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: if (rows <= first) return; const w: usize = s.cols; const old = try arena.dupe(Cell, s.cells[(y0 + first) * w .. (y0 + rows) * w]); - const grounds = colors.Grounds.of(p.theme()); - const ink = p.theme().fg orelse p.theme().tag_fg; + const chrome = p.chrome(); + const ink = chrome.page.text; const x0 = r.x + config.GUTTER + File.gutterWidth(pane); const width = r.w -| (x0 - r.x); const ranges = live_run.ranges[0..live_run.nranges]; @@ -969,18 +969,18 @@ pub fn ghosts(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: // `!`: its output before the selection's first line. var j = k; if (how == .insert and opens) while (j < ranges.len and lineAt(index, @min(ranges[j].anchor, ranges[j].head)) == line) : (j += 1) { - out = ghostRows(s, live_run, j, out, rows, y0, x0, width, grounds.add.row, ink); + out = ghostRows(s, live_run, j, out, rows, y0, x0, width, chrome.add.row, ink); }; if (out >= rows) break; @memcpy(s.cells[(y0 + out) * w ..][0..w], old[(vr - first) * w ..][0..w]); j = k; while (j < ranges.len and lineAt(index, @min(ranges[j].anchor, ranges[j].head)) <= line) : (j += 1) { - if (how == .replace and outcome(live_run, j) == 0) s.tint(x0, @intCast(y0 + out), width, grounds.del.row, null); + if (how == .replace and outcome(live_run, j) == 0) s.tint(x0, @intCast(y0 + out), width, chrome.del.row, null); } out += 1; // `|` and `A-!`: after the selection's last line. if (how != .insert and closes) while (k < ranges.len and lineAt(index, @max(ranges[k].anchor, ranges[k].head) -| 1) == line) : (k += 1) { - out = ghostRows(s, live_run, k, out, rows, y0, x0, width, grounds.add.row, ink); + out = ghostRows(s, live_run, k, out, rows, y0, x0, width, chrome.add.row, ink); }; } // What was pushed past the view leaves blank rows behind it, none. @@ -1027,7 +1027,7 @@ fn fence(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, body_h: u16) void if (snap.len == 0) return; const x = gutterX(pane, r); const y = p.bodyTop(pane, r); - const ink = p.chromeTheme().box; + const ink = p.chrome().page.key; const nlines = File.nlines(p.gpa, f); const op = p.view().tag_state.prompt.op; var kept: [Text.max_selections]modal.Selection = undefined; @@ -1500,12 +1500,12 @@ test "/ searches the body as it is typed: the current place selected, `▸` in t { const s = try p.render(frame.allocator()); const r = p.view().rects[0]; - const roles = &p.chromeTheme().roles; + const c = p.chrome(); const x = r.x + config.GUTTER + File.gutterWidth(pane); const y = p.bodyTop(pane, r); - try std.testing.expectEqual(pardes.Color{ .rgb = roles.key }, s.at(x - 1 - File.laneCells(pane) - pane.layers.heat, y + 2).style.fg); + try std.testing.expectEqual(pardes.Color{ .rgb = c.page.key }, s.at(x - 1 - File.laneCells(pane) - pane.layers.heat, y + 2).style.fg); // Line 1's place (`dirty` at its start) on the hit ground. - try std.testing.expectEqual(pardes.Color{ .rgb = roles.hit }, s.at(x, y).style.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = c.hit }, s.at(x, y).style.bg); } p.update(.{ .key = .{ .cp = Key.enter } }); try std.testing.expectEqual(TagState.Kind.rest, p.view().tag_state.kind); @@ -1651,8 +1651,10 @@ test "a pipe prompt runs a known filter live, a run a selection: the outputs gho const x = r.x + config.GUTTER + File.gutterWidth(pane); const y = p.bodyTop(pane, r); for ([_][]const u8{ "b", "B", "a", "A", "c" }, 0..) |want, row| try std.testing.expectEqualStrings(want, s.at(x, y + @as(u16, @intCast(row))).grapheme()); - try std.testing.expectEqual(pardes.Color{ .rgb = colors.Grounds.of(p.theme()).del.row }, s.at(x, y).style.bg); - try std.testing.expectEqual(pardes.Color{ .rgb = colors.Grounds.of(p.theme()).add.row }, s.at(x, y + 1).style.bg); + // On the chrome's diff rows (R10), the ghost in the page's text. + try std.testing.expectEqual(pardes.Color{ .rgb = p.chrome().del.row }, s.at(x, y).style.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = p.chrome().add.row }, s.at(x, y + 1).style.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = p.chrome().page.text }, s.at(x, y + 1).style.fg); try std.testing.expectEqualStrings("b\na\nc\n", pane.file.?.content); // Enter: what the live run made, applied. p.update(.{ .key = .{ .cp = Key.enter } }); diff --git a/core/Query.zig b/core/Query.zig index 1a420a68..f9651faf 100644 --- a/core/Query.zig +++ b/core/Query.zig @@ -471,8 +471,8 @@ fn makeNameRows(p: *Pardes, id: usize) !void { var rows: std.ArrayList(locations.Row) = .empty; var spans: std.ArrayList(pardes.Term.Span) = .empty; errdefer spans.deinit(p.gpa); - const chrome = p.bodyChrome(); - const tint: pardes.CellStyle = .{ .fg = .{ .rgb = chrome.search_fg }, .bg = .{ .rgb = chrome.search_bg }, .bold = true }; + const chrome = p.chrome(); + const tint: pardes.CellStyle = .{ .fg = .{ .rgb = chrome.page.text }, .bg = .{ .rgb = chrome.hit }, .bold = true }; const shown = @min(q.names.hits.items.len, Names.max_rows); var marks: [Names.max_query * 4]u16 = undefined; const base = lineOne(rp.file.?.content).len + 1; @@ -510,7 +510,7 @@ fn makeNameRows(p: *Pardes, id: usize) !void { // A closed pane's row is dimmer, the gutter's colour, between its // marks (spans are walked in order, never overlapping). const dim = q.source == .panes and p.paneBySerial(cand.ref) == null; - const dimmed: pardes.CellStyle = .{ .fg = .{ .rgb = chrome.lineno } }; + const dimmed: pardes.CellStyle = .{ .fg = .{ .rgb = chrome.line_number } }; var gap: usize = 0; var k: usize = 0; while (k < nmarks) { @@ -530,8 +530,9 @@ fn makeNameRows(p: *Pardes, id: usize) !void { f.pager_spans = spans.toOwnedSlice(p.gpa) catch &.{}; q.total = q.names.hits.items.len; q.more = q.names.busy() or p.stream.busyFor(rp.serial); - // The best is current until a step or a click moves it. - q.current = if (shown > 0) 0 else null; + // The best is current until a step or a click moves it: in a grouped + // list (Symbols) wherever its group puts it. + q.current = if (shown > 0) @min(q.names.bestRow(), shown - 1) else null; countCurrent(q); showCurrent(p.settings.tab, rp); if (q.current == null) blankPreview(p, id) else showTarget(p, id); @@ -771,23 +772,54 @@ pub fn gather(p: *Pardes, names: *Names, source: Source, dir: []const u8, self: const oid = owner_id orelse return; const owner = p.panes[oid].?; const f = if (owner.file) |*file| file else return; - const decls = ownerDecls(f) orelse { + if (f.context.revision != f.revision) { // Parsed on the worker; listed when it is done (declsArrived). Stream.parseFor(p, oid); return; - }; - for (decls) |d| { - const header = f.content[d.start_byte..@min(d.header_end_byte, f.content.len)]; - const first = std.mem.trim(u8, header[0 .. std.mem.indexOfScalar(u8, header, '\n') orelse header.len], " \t\r"); - var buf: [256 + 16]u8 = undefined; - const row = std.fmt.bufPrint(&buf, "{d: >6} {s}", .{ d.start_line + 1, first[0..@min(first.len, 240)] }) catch continue; - names.add(gpa, row, 8, row.len - 8, 0, @intCast(d.start_line + 1)) catch break; } + // The file's text, which was parsed (the `Changes` layer's lines + // are none of it). + const text = File.fileText(f, p.scratch.allocator()) catch return; + const symbols = f.context.symbols; + // A row a symbol, ` 12 m Counts.lines : usize = 0`: its + // line, its mark, its name qualified by the ones it is in, then + // what its first line says after the name; types, functions, + // fields, then the rest, each in the text's order (UX DESIGN N). + // The qualified name alone is matched, its own name the + // basename. + for (0..4) |group| for (symbols) |sym| { + if (sym.kind.group() != group or sym.kind == .scope or sym.end > text.len) continue; + var buf: [512]u8 = undefined; + var row: std.Io.Writer = .fixed(&buf); + row.print("{d: >6} {s} ", .{ sym.line + 1, sym.kind.mark() }) catch continue; + const key_at = row.end; + qualify(&row, symbols, text, sym.parent, 4) catch continue; + // The name its basename: the qualifier dim (Pick.rowAt). + const base = row.end - key_at; + row.writeAll(text[sym.name_start..sym.name_end]) catch continue; + const key_len = row.end - key_at; + const rest = text[sym.name_end..@max(sym.name_end, sym.end)]; + var detail = std.mem.trim(u8, rest[0 .. std.mem.indexOfScalar(u8, rest, '\n') orelse rest.len], " \t\r"); + detail = std.mem.trimEnd(u8, std.mem.trimEnd(u8, detail, "{,;"), " \t"); + if (detail.len > 0) row.print(" {s}", .{detail[0..@min(detail.len, buf.len - row.end -| 2)]}) catch {}; + names.add(gpa, row.buffered(), key_at, key_len, @intCast(base), sym.line + 1) catch break; + names.cands.items[names.cands.items.len - 1].group = @intCast(group); + }; }, else => {}, } } +/// The names of the symbols `parent` (an index + 1) is in, outermost +/// first, each with its `.`: `Outer.Inner.` (the `depth` innermost). +fn qualify(w: *std.Io.Writer, symbols: []const syntax.Symbol, text: []const u8, parent: u32, depth: u8) std.Io.Writer.Error!void { + if (parent == 0 or parent > symbols.len or depth == 0) return; + const up = symbols[parent - 1]; + if (up.name_end > text.len) return; + try qualify(w, symbols, text, up.parent, depth - 1); + try w.print("{s}.", .{text[up.name_start..up.name_end]}); +} + /// What a Panes row of a closed pane ends with. const closed_word = " (closed)"; @@ -2093,8 +2125,7 @@ pub fn tagPrefix(q: *const Query, arena: std.mem.Allocator, path: []const u8) er pub fn paintMark(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, body_h: u16) void { const q = pane.query orelse return; const c = q.current orelse return; - const th = p.theme(); - const mark = colors.mix(th.bg orelse th.tag_bg, th.sel_bg); + const mark = p.chrome().selection_secondary; const tx = r.x + config.GUTTER; const tw = r.w -| config.GUTTER; const col = File.gutterWidth(pane); @@ -2107,13 +2138,11 @@ pub fn paintMark(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, body_h: u /// The other places on a hit row's line tinted, from the pane its rows are /// in (the first is the row's own mark, Output.decorateRow): the current -/// one strongest, as in that pane's text. +/// one solid, as in that pane's text (Places.paint). pub fn paint(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, body_h: u16) void { const q = pane.query orelse return; const f = if (pane.file) |*file| file else return; - const th = p.theme(); - const strong = p.chromeTheme().search_bg; - const quiet = colors.mix(th.bg orelse th.tag_bg, strong); + const c = p.chrome(); var vr: i32 = 0; var last: i32 = -1; while (vr < body_h) : (vr += 1) { @@ -2145,7 +2174,7 @@ pub fn paint(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, body_h: u16) const b = @min(line.len, meta.code_start + (@min(h.end, next) - ls - meta.source_column)); if (b <= a or a >= line.len) continue; const current = set.current != null and set.current.? == hi; - File.paintWordSelection(p, s, pane, r, row, @intCast(a), @intCast(b), if (current) strong else quiet); + File.paintWordSelection(p, s, pane, r, row, @intCast(a), @intCast(b), if (current) c.hit_current else c.hit, if (current) c.hit_current_text else null); } } } @@ -2816,3 +2845,48 @@ test "Grep: a row whose numbers a Found cannot hold (a column past u32) is passe // Taken or passed over, each: never cast (main: Query.zig:1267). try std.testing.expect(q.found.items.len <= 3); } + +test "a query pane's hits are the body's: a row's match on the hit ground in the text's ink, the owner's current place solid in the hue with the page's ink, the current row marked with the selection's faint half" { + const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 40 }); + defer p.deinit(); + p.settings.jumps = .@"new-pane"; + colors.setThemeIndex(p, colors.themeIndex("orchard").?); + const pane = try p.setTestFile("alpha one alpha\nbeta\ngamma alpha\n"); + slash(p, "/alpha"); + const qid = queryPane(p).?; + const qp = p.panes[qid].?; + try std.testing.expectEqual(@as(?usize, 0), qp.query.?.current); + try std.testing.expectEqual(@as(?usize, 0), pane.places.current); + var frame = std.heap.ArenaAllocator.init(std.testing.allocator); + defer frame.deinit(); + const s = try p.render(frame.allocator()); + const c = p.chrome(); + const r = p.view().rects[qid]; + // Row 1 (line 1 is the query) the first place's line, row 2 the third's. + var rows: [2][]const u8 = undefined; + for (&rows, 1..) |*row, k| { + var text: std.ArrayList(u8) = .empty; + for (0..r.w) |x| try text.appendSlice(frame.allocator(), s.at(r.x + @as(u16, @intCast(x)), p.bodyTop(qp, r) + @as(u16, @intCast(k))).grapheme()); + row.* = text.items; + } + const y = p.bodyTop(qp, r) + 1; + const first = std.mem.indexOf(u8, rows[0], "alpha").?; + const second = std.mem.lastIndexOf(u8, rows[0], "alpha").?; + const third = std.mem.indexOf(u8, rows[1], "alpha").?; + try std.testing.expect(second > first + 5); + for (0..5) |i| { + const current = s.at(r.x + @as(u16, @intCast(first + i)), y).style; + try std.testing.expectEqual(pardes.Color{ .rgb = c.hit_current }, current.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = c.hit_current_text }, current.fg); + const other = s.at(r.x + @as(u16, @intCast(second + i)), y).style; + try std.testing.expectEqual(pardes.Color{ .rgb = c.hit }, other.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = c.page.text }, other.fg); + const below = s.at(r.x + @as(u16, @intCast(third + i)), y + 1).style; + try std.testing.expectEqual(pardes.Color{ .rgb = c.hit }, below.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = c.page.text }, below.fg); + } + // The current row's mark between its places and to its end; none below. + try std.testing.expectEqual(pardes.Color{ .rgb = c.selection_secondary }, s.at(r.x + @as(u16, @intCast(first + 6)), y).style.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = c.selection_secondary }, s.at(r.x + r.w - 2, y).style.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = c.page.ground }, s.at(r.x + r.w - 2, y + 1).style.bg); +} diff --git a/core/Stream.zig b/core/Stream.zig index 93be5c1f..4691e192 100644 --- a/core/Stream.zig +++ b/core/Stream.zig @@ -67,10 +67,11 @@ pub const Batch = struct { end: ?End = null, /// A parse's own time on the worker (`parse_ns`). took_ns: u64 = 0, - /// A parse's answer (`parseFor`): the declarations of pane `serial`'s - /// text at `revision`. + /// A parse's answer (`parseFor`): the declarations and symbols of pane + /// `serial`'s text at `revision`. parsed: ?struct { serial: u32, revision: u32 } = null, decls: []syntax.ContextDeclaration = &.{}, + symbols: []syntax.Symbol = &.{}, /// A paint's answer (`paintAhead`): the colours of pane `serial`'s text /// at `revision` from byte `start`, one syntax.Syn a byte. painted: ?struct { serial: u32, revision: u32, start: usize } = null, @@ -83,6 +84,7 @@ pub const Batch = struct { pub fn deinit(b: *const Batch, gpa: std.mem.Allocator) void { gpa.free(b.rows); gpa.free(b.decls); + gpa.free(b.symbols); gpa.free(b.styles); } }; @@ -480,9 +482,9 @@ pub fn parseFor(p: *Pardes, id: usize) void { fn parseWork(io: std.Io, job: *TextJob, ctx: ?*anyopaque, sink: Sink) void { const began = std.Io.Clock.awake.now(io); - const decls: []syntax.ContextDeclaration = syntax.declarationsApart(job.out, job.path, job.source, &job.stop) catch @constCast(&[_]syntax.ContextDeclaration{}); + const made: syntax.Context = syntax.contextApart(job.out, job.path, job.source, &job.stop) catch .{}; const took: u64 = @intCast(@max(0, began.durationTo(std.Io.Clock.awake.now(io)).nanoseconds)); - _ = sink(ctx, .{ .gen = job.gen, .decls = decls, .parsed = .{ .serial = job.serial, .revision = job.revision }, .end = .done, .took_ns = took }); + _ = sink(ctx, .{ .gen = job.gen, .decls = made.declarations, .symbols = made.symbols, .parsed = .{ .serial = job.serial, .revision = job.revision }, .end = .done, .took_ns = took }); } fn now() u64 { @@ -732,12 +734,15 @@ fn receiveParse(p: *Pardes, b: *const Batch, serial: u32, revision: u32) void { t.job.deinit(); }; s.parse_ns = b.took_ns; - if (p.paneBySerial(serial)) |id| if (p.panes[id].?.file) |*f| if (f.revision == revision and b.decls.len > 0) { - if (p.tree_sitter_gpa.dupe(syntax.ContextDeclaration, b.decls)) |copy| { - f.context.replace(p.tree_sitter_gpa, copy, revision); - panes.Query.declsArrived(p, serial); - panes.Pick.declsArrived(p, serial); - } else |_| {} + if (p.paneBySerial(serial)) |id| if (p.panes[id].?.file) |*f| if (f.revision == revision and (b.decls.len > 0 or b.symbols.len > 0)) kept: { + const decls = p.tree_sitter_gpa.dupe(syntax.ContextDeclaration, b.decls) catch break :kept; + const symbols = p.tree_sitter_gpa.dupe(syntax.Symbol, b.symbols) catch { + p.tree_sitter_gpa.free(decls); + break :kept; + }; + f.context.replace(p.tree_sitter_gpa, .{ .declarations = decls, .symbols = symbols }, revision); + panes.Query.declsArrived(p, serial); + panes.Pick.declsArrived(p, serial); }; p.needs_frame = true; // A `Churn` waiting on these declarations (jj.zig). @@ -1452,7 +1457,7 @@ test "Stream: a Grep stops at its 2000 lines and waits; More in the query pane's p.update(.tick); try testing.expectEqual(@as(usize, soft_cap), qp.query.?.found.items.len); try testing.expect(qp.query.?.capped); - try testing.expectEqualStrings(" More Del", @import("tagline.zig").curTail(qp)); + try testing.expectEqualStrings(" More Del", @import("tagline.zig").computedWords(qp)); pardes.exec.runBuiltin(p, .More, qid, "", null); try shell.finish(p, 20_000); p.update(.tick); diff --git a/core/Tables.zig b/core/Tables.zig index a0256d8a..99e464ac 100644 --- a/core/Tables.zig +++ b/core/Tables.zig @@ -645,16 +645,16 @@ fn glyph(cell: *Cell, g: []const u8) void { /// A pane's table rows drawn as tables: every unescaped `|` a rule, the /// delimiter row one rule across (its dashes, its blanks and its pads, its /// `:` kept in the rule's colour, since they say the alignment), the header -/// row bold on the tag's ground, as compact context rows are. Only glyphs +/// row bold on the tag's ground, as compact context rows are, the rules in +/// the page's rule ink (R11). Only glyphs /// and colours change, on the cells the row has: where each byte is and how /// wide is fillBody's, so nothing is drawn over anything, B1 on a rule is /// B1 on its `|`, and a selection's tint lies over the rules as over text. pub fn paint(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, tx: u16, tw: u16, body_h: u16) void { const f = if (pane.file) |*file| file else return; if (f.tables.list.items.len == 0) return; - const th = p.theme(); - const rule_fg: Color = .{ .rgb = th.border orelse th.lineno }; - const head_bg: Color = .{ .rgb = th.tag_bg }; + const rule_fg: Color = .{ .rgb = p.chrome().page.rule }; + const head_bg: Color = .{ .rgb = p.chrome().tag[0].ground }; const prefix: usize = File.gutterWidth(pane); const body_y = p.bodyTop(pane, r); var vr: u16 = 0; diff --git a/core/TagState.zig b/core/TagState.zig index 3bf67e5e..c754e468 100644 --- a/core/TagState.zig +++ b/core/TagState.zig @@ -339,9 +339,16 @@ fn reaches(p: *const Pardes, root: Root, path: []const u8, leaf: bool) bool { /// the keyboard). The pane's state, not the view's keyboard: every view /// shows it; not while the tag has the keyboard, whose own text is edited /// then. +/// A question waits on pane `pane` at rest, its keyboard not in its tag: +/// its tag says it after the path, in place of the tag's computed words +/// and own text (UX D13, K'3). +pub fn asks(p: *const Pardes, pane: *const Pane) bool { + return pane.focus != .tag and pane.prompt != .name and p.messages.waiting(pane) != null; +} + fn asking(p: *Pardes, arena: std.mem.Allocator, pane: *Pane) !?Head { - if (pane.focus == .tag or pane.prompt == .name) return null; - const i = p.messages.waiting(pane) orelse return null; + if (!asks(p, pane)) return null; + const i = p.messages.waiting(pane).?; const said = &p.messages.live[i]; var b: Builder = .{ .arena = arena }; // In the rows the tag takes at rest (UX D13: a question never adds a @@ -350,7 +357,7 @@ fn asking(p: *Pardes, arena: std.mem.Allocator, pane: *Pane) !?Head { // always show. const tab = p.settings.tab; const id = panes.paneIdOf(p, pane) orelse return null; - const room = @as(usize, @import("layout.zig").wantedTagRows(p, id)) * tagline.tagWidth(p, id) -| panes.File.displayWidth(tab, try tagline.restPrefix(p, arena, pane)); + const room = @as(usize, @import("layout.zig").wantedTagRows(p, id)) * tagline.tagWidth(p, id) -| panes.File.displayWidth(tab, try tagline.prefixIn(p, arena, pane)); const hint = if (p.view().answering == pane.serial) "· Esc later" else "· SPC e to answer"; var answers: usize = 2; // ` ▸`, then each ` k word ` for (said.asks.answers()) |a| answers += 3 + panes.File.displayWidth(tab, a.word) + 1; @@ -1321,6 +1328,8 @@ test "a tag out of rest keeps exactly its rows at rest: a level shorter than its defer p.deinit(); _ = try p.setTestFile("one\n"); const pane = p.panes[p.view().active].?; + // Its own text past a row: the tag takes two (UX K'1). + pane.tag.own = try p.gpa.dupe(u8, "words of the user's own that run on past a row"); p.sync(); const rows, const tag_rows = .{ pane.rows, pane.tag_rows }; try std.testing.expect(tag_rows > 1); diff --git a/core/Trail.zig b/core/Trail.zig index 9b0d64ea..e42ab1e2 100644 --- a/core/Trail.zig +++ b/core/Trail.zig @@ -714,7 +714,7 @@ test "a file's pane is reading, its tag in the reading tint with Keep after its // Under Jumps new-pane nothing reads: the tag as it always was. p.settings.jumps = .@"new-pane"; try std.testing.expect(!reading(p, pane)); - try std.testing.expectEqualStrings("/test.txt Save Term Collapse Follow Del", try tagOf(p, pane)); + try std.testing.expectEqualStrings("/test.txt Del ", try tagOf(p, pane)); try std.testing.expectEqual(pardes.Color{ .rgb = p.chromeTheme().tag_active_bg }, try tagGroundOf(p, &arena, 0)); p.settings.jumps = .walk; // Typed into: held from now on, though Undo takes the text back. @@ -766,7 +766,7 @@ const Fixture = struct { for ([_][]const u8{ "search.zig", "rank.zig", "place.zig" }) |name| try f.tmp.dir.writeFile(std.testing.io, .{ .sub_path = name, .data = w.buffered() }); f.dir = f.dir_buf[0..try f.tmp.dir.realPath(std.testing.io, &f.dir_buf)]; - f.p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 120, .rows = rows }); + f.p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 200, .rows = rows }); errdefer f.p.deinit(); _ = try f.p.setTestFile("scratch\n"); f.p.settings.jumps = .@"new-pane"; @@ -869,7 +869,7 @@ test "a Look from inside the reader at a file its held pane shows focuses the he test "the reader of a held pane too short to halve goes to the bottom of the next column, of the previous one from the last" { var f: Fixture = .{ .p = undefined, .tmp = undefined }; - try f.init(24); + try f.init(20); defer f.deinit(); const col = layout.findPane(f.p, f.held).?.col; try std.testing.expect(f.p.view().rects[f.held].h / 2 < f.p.panes[f.held].?.tag_rows + layout.reader_keeps); @@ -946,7 +946,7 @@ test "the session of pick-ui §6.7: four jumps across three files, back by a cli // makes a new reader. pardes.exec.runBuiltin(p, .Keep, r, "Keep", null); p.sync(); - try std.testing.expect(std.mem.startsWith(u8, try tagOf(p, p.panes[r].?), try std.fmt.bufPrint(&buf, "{s}/rank.zig Save", .{f.dir}))); + try std.testing.expect(std.mem.startsWith(u8, try tagOf(p, p.panes[r].?), try std.fmt.bufPrint(&buf, "{s}/rank.zig Del ", .{f.dir}))); f.look(f.held, "place.zig", 20); const fresh = p.view().active; try std.testing.expect(fresh != r and fresh != f.held and p.panes[r] != null); diff --git a/core/ansi.zig b/core/ansi.zig index e4fbf5da..3fb866fc 100644 --- a/core/ansi.zig +++ b/core/ansi.zig @@ -20,33 +20,12 @@ const Surface = pardes.Surface; const BodyWalk = @import("body_layer.zig").BodyWalk; const EditBuffer = panes.Text.EditBuffer; -/// The theme's colours as a terminal's paint takes them. -pub fn inkOf(theme: *const pardes.LegacyTheme) Term.Ink { - return .{ - .fg = theme.fg, - .bg = theme.bg, - .tag_fg = theme.tag_fg, - .tag_bg = theme.tag_bg, - .palette = theme.palette, - .base = theme.palette orelse .{ - theme.bg orelse theme.tag_bg, - theme.kw, - theme.str, - theme.num, - theme.box, - theme.sel_bg, - theme.comment, - theme.fg orelse theme.tag_fg, - theme.lineno, - theme.kw, - theme.str, - theme.num, - theme.scroll_thumb, - theme.sel_fg, - theme.tag_fg, - theme.fg orelse theme.tag_fg, - }, - }; +/// The theme's colours as a terminal's paint takes them (Chrome's: its page, +/// text, faint and sixteen); a theme that leaves them to the host (`dark`) +/// leaves them to a tty, and a window draws its own (DESIGN.md R14). +pub fn inkOf(p: *const Pardes) Term.Ink { + const c = p.chrome(); + return .{ .fg = c.page.text, .bg = c.page.ground, .dim = c.page.dim, .ansi = c.ansi, .host = c.host_page and !p.view().frontend.windowed }; } /// Its program's colours over the body's rows, through the theme's filter @@ -85,7 +64,7 @@ pub fn recolor(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, tx: u16, tw { const tz_paint = tracy.zone(@src(), "termPaint"); defer tz_paint.end(); - const ink = inkOf(p.theme()); + const ink = inkOf(p); Term.paint(state, &ink, &p.tty_filter_palette, pane.tty_filter, pane.scrolled_to, @intCast(lo), cols, cells, rows); } const filtered = pane.tty_filter; @@ -453,15 +432,15 @@ pub fn recolorDiffOutput(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, t } if (lo > hi) return; const styles = syntax.highlightDiffRows(arena, flat, lo, hi, true) catch return; - const tints: Colors.Grounds = .of(p.theme()); - const ink = p.theme().fg orelse p.theme().tag_fg; + const chrome = p.chrome(); const body_y = p.bodyTop(pane, r); shown = std.mem.splitScalar(u8, body, '\n'); for (views, 0..) |maybe, vr| { const line = shown.next() orelse break; const view = maybe orelse continue; const base = @intFromPtr(rows[view.row].ptr) - flat_start - lo; - const tint = if (base < styles.len) tints.forStyle(styles[base]) else null; + const lead: u8 = if (base < styles.len) styles[base] else 0; + const tint: ?Colors.Chrome.Diff = if (lead & syntax.ground_add != 0) chrome.add else if (lead & syntax.ground_del != 0) chrome.del else null; if (tint) |t| s.tint(tx, body_y + @as(u16, @intCast(vr)), tw, t.row, null); var c: usize = 0; var screen_c: usize = 0; @@ -478,7 +457,7 @@ pub fn recolorDiffOutput(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, t else if (panes.File.synStyle(p, @fromBackingInt(@intCast(style & syntax.syn_bits)))) |ss| ss else if (tint != null) - .{ .fg = ink, .bold = false } + .{ .fg = chrome.page.text, .bold = false } else null; if (paint) |ss| { diff --git a/core/body_layer.zig b/core/body_layer.zig index 513f9a6d..a1d76784 100644 --- a/core/body_layer.zig +++ b/core/body_layer.zig @@ -148,21 +148,12 @@ pub fn paintPointerSelection( } } -/// The selection colour of each pointer button's sweep: the select button's -/// and the look and exec buttons', each tinted toward its own accent. -pub fn buttonTints(th: *const colors.LegacyTheme) [3][3]u8 { - if (th.sweep_bg) |own| return own; - const accent2 = if (std.mem.eql(u8, &th.num, &th.str)) th.comment else th.num; - return .{ - colors.mix(th.sel_bg, colors.mix(th.sel_bg, th.kw)), - colors.mix(th.sel_bg, colors.mix(th.sel_bg, th.str)), - colors.mix(th.sel_bg, colors.mix(th.sel_bg, accent2)), - }; -} - -/// The ink over each button's sweep. -pub fn buttonInks(th: *const colors.LegacyTheme) [3][3]u8 { - return th.sweep_fg orelse @splat(th.sel_fg); +/// The rail's column in the theme's rail and thumb, and the column right +/// of it the page. +fn paintRail(c: *const colors.Chrome, s: *Surface, bar: pardes.Region) void { + s.fill(bar.rect.x, bar.rect.y, 1, bar.rect.h, .{ .bg = .{ .rgb = c.rail } }); + s.fill(bar.rect.x + 1, bar.rect.y, 1, bar.rect.h, .{ .bg = if (c.host_page) .default else .{ .rgb = c.page.ground } }); + s.fill(bar.rect.x, bar.rect.y + bar.thumb_y, 1, bar.thumb_h, .{ .bg = .{ .rgb = c.rail_thumb } }); } /// A pane's body, painted once. A file body with compact tree-sitter @@ -221,14 +212,7 @@ pub fn joinBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, if (layer.cursor) |cursor| if (cursor.y < viewport_rows) { s.cursor = .{ .x = body.rect.x + cursor.x, .y = body.rect.y + cursor.y, .bar = cursor.bar }; }; - const chrome = p.chromeTheme(); - const theme = p.theme(); - const pane_bg: Color = if (theme.bg) |c| .{ .rgb = c } else .default; - if (rail.rect.h > 0) { - s.fill(rail.rect.x, rail.rect.y, 1, rail.rect.h, .{ .bg = .{ .rgb = chrome.scroll_track } }); - s.fill(rail.rect.x + 1, rail.rect.y, 1, rail.rect.h, .{ .bg = pane_bg }); - s.fill(rail.rect.x, rail.rect.y + rail.thumb_y, 1, rail.thumb_h, .{ .bg = .{ .rgb = chrome.scroll_thumb } }); - } + if (rail.rect.h > 0) paintRail(p.chrome(), s, rail); } fn drawGutter(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, tx: u16, tw: u16, body_h: u16, active: bool) void { @@ -239,12 +223,13 @@ fn drawGutter(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, tx: u16, tw: const cur_line: i32 = if (active and typing_body) gcrow else std.math.minInt(i32); // the body's first row, the way renderPane derives it const body_y = p.bodyTop(pane, r); - const context_bg = p.theme().tag_bg; + const chrome = p.chrome(); + // The context rows on the tag's ground, as a header. for (0..@min(pane.context_rows, body_h)) |context_row| { for (0..tw) |col| { const cell = s.at(tx + @as(u16, @intCast(col)), body_y + @as(u16, @intCast(context_row))); cell.default = false; - cell.style.bg = .{ .rgb = context_bg }; + cell.style.bg = .{ .rgb = chrome.tag[0].ground }; cell.style.font_role = .tagline; } } @@ -259,10 +244,7 @@ fn drawGutter(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, tx: u16, tw: while (c < prefix_width and c < tw) : (c += 1) { const cell = s.at(tx + c, body_y + vr); cell.default = false; // paints blank gutter rows too - cell.style.fg = .{ .rgb = if (on_cursor) - p.theme().lineno_active orelse p.theme().lineno - else - p.theme().lineno }; + cell.style.fg = .{ .rgb = if (on_cursor) chrome.line_number_current else chrome.line_number }; cell.style.bold = on_cursor; } } @@ -280,7 +262,7 @@ fn drawWrapMarkers( ) void { if (tw <= panes.File.gutterWidth(pane) + 1) return; const body_y = p.bodyTop(pane, r); - const marker_fg = p.chromeTheme().lineno; + const marker_fg = p.chrome().line_number; var row: u16 = 0; while (row + 1 < pane.wrap_n and row + 1 < body_h) : (row += 1) { if (pane.wrap_line[row + 1] != pane.wrap_line[row] or pane.wrap_col[row] < 0) continue; @@ -292,21 +274,20 @@ fn drawWrapMarkers( } pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: Rect, id: usize, active: bool, rail: ?pardes.Region) !void { - const th = p.theme(); - const chrome = p.chromeTheme(); + const c = p.chrome(); const tx = r.x + config.GUTTER; const tw = r.w - config.GUTTER; // Below the notice bands: they are stacked at the top of the body the // way tree-sitter context rows are, so the body starts under them // rather than being painted over by them. const body_y = p.bodyTop(pane, r); - const pane_bg: Color = if (th.bg) |c| .{ .rgb = c } else .default; - const page_rgb = th.bg orelse th.tag_bg; + // A theme that leaves its page to the host leaves it its text too. + const pane_bg: Color = if (c.host_page) .default else .{ .rgb = c.page.ground }; // body: emulator rows, prompt rows hidden outside tty mode const body_h = r.h -| pane.tag_rows; const body_bottom = r.h; const body_style: CellStyle = .{ - .fg = if (th.fg) |c| .{ .rgb = c } else .default, + .fg = if (c.host_page) .default else .{ .rgb = c.page.text }, .bg = pane_bg, }; const tz_body = tracy.zone(@src(), "bodyText"); @@ -319,7 +300,7 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane // the rows, which paint over it. const sweep = pane.sel[pardes.sel_slot]; if (sweep.state != .none and (sweep.state != .done or pardes.sel_slot == 0) and @min(sweep.r0, sweep.r1) < pane.tag_rows) - paintPointerSelection(p, s, pane, r, sweep, pane.tag_rows, th.sel_bg, th.sel_fg); + paintPointerSelection(p, s, pane, r, sweep, pane.tag_rows, c.sweeps[pardes.sel_slot].ground, c.sweeps[pardes.sel_slot].text); { // The rows themselves. `bodyText` above is only the string BUILD; // this is what writes it into the surface. @@ -363,16 +344,14 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane tz_color.end(); if (pane.isTerminal()) ansi.images(p, s, pane, id, tx, tw, body_y, body_h); - const sel_btn = buttonTints(th); if (p.look_hover_preview) |preview| { if (preview.pane == id and preview.serial == pane.serial) { // Preserve body ink, then let every real user selection below // win over this quiet affordance. - const preview_bg = colors.mix(page_rgb, colors.mix(page_rgb, th.sel_bg)); if (preview.file_word) |word| - panes.File.paintWordSelection(p, s, pane, r, word.row, word.lo, word.hi, preview_bg) + panes.File.paintWordSelection(p, s, pane, r, word.row, word.lo, word.hi, c.selection_secondary, null) else if (preview.sel) |sel| - paintPointerSelection(p, s, pane, r, sel, pane.tag_rows, preview_bg, null); + paintPointerSelection(p, s, pane, r, sel, pane.tag_rows, c.selection_secondary, null); } } const modal_hover = if (p.look_hover_preview) |preview| @@ -385,7 +364,7 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane // A select sweep over the tag is the tag's selection, painted there // in the tag's own selection colours. if (b == pardes.sel_slot and @min(sl.r0, sl.r1) < pane.tag_rows) continue; - paintPointerSelection(p, s, pane, r, sl, pane.tag_rows, sel_btn[b], buttonInks(th)[b]); + paintPointerSelection(p, s, pane, r, sl, pane.tag_rows, c.sweeps[b].ground, c.sweeps[b].text); } // A selecting prompt's live result (Prompt.zig), dimmed while its // field is no regex. @@ -394,6 +373,17 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane const show_prim = (pane.body.mode == .normal and pane.body.vsel.active) or preview or (modal_hover and pane.body.vsel.active); const show_extra = pane.body.mode != .tty and pane.body.nsel > 0; + // The primary selection that is the current place (a live `/`, `n`, a + // preview select it) is drawn as that place, its solid chip, not the + // selection: one meaning, one look; the caret still shows. + const on_place = place: { + const f = pane.file orelse break :place false; + const at = pane.places.current orelse break :place false; + if (!pane.places.shows(pane) or at >= pane.places.hits.items.len) break :place false; + const range = pane.body.primaryRange(f.content, 0); + const hit = pane.places.hits.items[at]; + break :place hit.start == @min(range.anchor, range.head) and hit.end == @max(range.anchor, range.head); + }; if (show_prim or show_extra) { const vpfx: i32 = if (pane.file != null) panes.File.gutterWidth(pane) else 0; var si: usize = 0; @@ -408,14 +398,14 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane } else pane.body.sels[si]; const bnd = edit.cellBounds(sr); const hover_only = primary and modal_hover and pane.body.mode != .normal and !preview; - const bg = if (hover_only or (selecting != null and selecting.?.dim)) - colors.mix(page_rgb, colors.mix(page_rgb, th.sel_bg)) - else if (primary) - th.sel_bg - else - colors.mix(th.sel_bg, page_rgb); + // The primary on the selection in its ink; every other range, + // a hover and a dimmed preview on its faint half, the text's + // own ink kept (R7). + const full = primary and !hover_only and !(selecting != null and selecting.?.dim); + const bg = if (full) c.page.selection.ground else c.selection_secondary; var vr: i32 = 0; while (vr + @as(i32, pane.tag_rows) < @as(i32, body_bottom)) : (vr += 1) { + if (primary and on_place) break; const w = pane.wrapAt(p.settings.tab, vr); if (w.line < bnd.lo_row or w.line > bnd.hi_row) continue; const visible_line = modal.lineSlice(body, @intCast(vr)); @@ -452,7 +442,7 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane @as(i32, tw) - 1; const col: i32 = @max(cstart, vpfx); const end = @min(cend + 1, tw); - if (col < end) s.tint(tx + @as(u16, @intCast(col)), body_y + @as(u16, @intCast(vr)), @intCast(end - col), bg, if (hover_only) null else th.sel_fg); + if (col < end) s.tint(tx + @as(u16, @intCast(col)), body_y + @as(u16, @intCast(vr)), @intCast(end - col), bg, if (full) c.page.selection.text else null); } if (primary and !preview and !hover_only) continue; // the hardware cursor IS the primary's if (hover_only) continue; // quiet preview preserves the source ink @@ -473,8 +463,8 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane if (crow >= pane.tag_rows and crow < @as(i32, body_bottom) and ccol >= vpfx and ccol < tw) { const cell = s.at(tx + @as(u16, @intCast(ccol)), body_y + @as(u16, @intCast(crow - pane.tag_rows))); cell.default = false; - cell.style.bg = .{ .rgb = th.sel_fg }; - cell.style.fg = .{ .rgb = th.sel_bg }; + cell.style.bg = .{ .rgb = c.page.selection.text }; + cell.style.fg = .{ .rgb = c.page.selection.ground }; } } } @@ -492,7 +482,7 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane if (pane.jump.items.len > 0) labels: { const flat = edit.flatSurface(p.editor(), &pane.body) catch break :labels; const letters = config.jump_label_alphabet; - const style: CellStyle = .{ .fg = .{ .rgb = th.sel_fg }, .bg = .{ .rgb = th.sel_bg }, .bold = true }; + const style: CellStyle = .{ .fg = .{ .rgb = c.page.selection.text }, .bg = .{ .rgb = c.page.selection.ground }, .bold = true }; for (pane.jump.items, 0..) |word, i| { if (pane.jump_first) |first| if (i / letters.len != first) continue; var at = @min(word.anchor, word.head); @@ -563,14 +553,10 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane if (pane.file != null) try pardes.Prompt.ghosts(p, s, arena, pane, r, body_h); // A code action's edit, previewed (Pick.zig). if (pane.file != null) try pardes.Pick.ghosts(p, s, arena, pane, r, body_h); - if (rail) |bar| if (bar.rect.h > 0) { - // The rail covers the notice bands too: nothing else paints those - // two gutter columns, so a gap there keeps the frame-wide border - // fill and reads as a notch cut out of the scrollbar. - s.fill(bar.rect.x, bar.rect.y, 1, bar.rect.h, .{ .bg = .{ .rgb = chrome.scroll_track } }); - s.fill(bar.rect.x + 1, bar.rect.y, 1, bar.rect.h, .{ .bg = pane_bg }); - s.fill(bar.rect.x, bar.rect.y + bar.thumb_y, 1, bar.thumb_h, .{ .bg = .{ .rgb = chrome.scroll_thumb } }); - }; + // The rail covers the notice bands too: nothing else paints those two + // gutter columns, so a gap there keeps the frame-wide border fill and + // reads as a notch cut out of the scrollbar. + if (rail) |bar| if (bar.rect.h > 0) paintRail(c, s, bar); } /// A message at the lines it names, drawn and never written (SPEC §10.2, @@ -585,9 +571,8 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane fn messageGhosts(p: *Pardes, s: *Surface, pane: *Pane, tx: u16, tw: u16, body_y: u16, body_h: u16) void { const Messages = pardes.Messages; const f = pane.file.?; - const chrome = p.chromeTheme(); - const th = p.theme(); - const pane_bg: Color = if (th.bg) |c| .{ .rgb = c } else .default; + const page = &p.chrome().page; + const pane_bg: Color = if (p.chrome().host_page) .default else .{ .rgb = page.ground }; const Hit = struct { line: usize, said: *const Messages.Said, place: *const Messages.Place }; var hits: [Messages.max_live * Messages.Said.max_places]Hit = undefined; var n: usize = 0; @@ -615,7 +600,7 @@ fn messageGhosts(p: *Pardes, s: *Surface, pane: *Pane, tx: u16, tw: u16, body_y: if (at < tw) { var buf: [160]u8 = undefined; const words = std.fmt.bufPrint(&buf, "{s} {s}", .{ hit.said.kind.glyph(), hit.place.text.slice() }) catch &buf; - _ = s.print(tx + @as(u16, @intCast(at)), body_y + row, @intCast(tw - at), words, .{ .fg = .{ .rgb = Messages.ink(chrome, hit.said.kind) }, .bg = pane_bg }); + _ = s.print(tx + @as(u16, @intCast(at)), body_y + row, @intCast(tw - at), words, .{ .fg = .{ .rgb = Messages.inkOn(page, hit.said.kind) }, .bg = pane_bg }); } if (pane.ghost_rows > 0 and row == pane.ghost_at) detail = hit.said; } @@ -634,7 +619,7 @@ fn messageGhosts(p: *Pardes, s: *Surface, pane: *Pane, tx: u16, tw: u16, body_y: for (said.detail[0..k], 0..) |*text, i| { const y = body_y + under_row + 1 + @as(u16, @intCast(i)); s.fill(tx, y, tw, 1, .{ .bg = pane_bg }); - if (gutter + 2 < tw) _ = s.print(tx + gutter + 2, y, tw - gutter - 2, text.slice(), .{ .fg = .{ .rgb = Messages.ink(chrome, said.kind) }, .bg = pane_bg }); + if (gutter + 2 < tw) _ = s.print(tx + gutter + 2, y, tw - gutter - 2, text.slice(), .{ .fg = .{ .rgb = Messages.inkOn(page, said.kind) }, .bg = pane_bg }); } } @@ -682,7 +667,7 @@ fn drawnRow(p: *Pardes, arena: std.mem.Allocator, id: usize, row: usize) !?[]con /// number (the one a prompt's current place has, Prompt.paintGutter), on /// each row it wraps onto. fn paintLanding(p: *Pardes, s: *Surface, pane: *Pane, r: Rect, tx: u16, tw: u16, body_h: u16, line: usize) void { - const roles = &p.chromeTheme().roles; + const c = p.chrome(); const gutter = File.gutterWidth(pane); const number = gutter -| File.laneCells(pane) -| pane.layers.heat -| 1; const body_y = p.bodyTop(pane, r); @@ -693,18 +678,19 @@ fn paintLanding(p: *Pardes, s: *Surface, pane: *Pane, r: Rect, tx: u16, tw: u16, for (gutter..tw) |x| { const cell = s.at(tx + @as(u16, @intCast(x)), body_y + vr); cell.default = false; - cell.style.bg = .{ .rgb = roles.hit }; + cell.style.bg = .{ .rgb = c.hit }; } if (gutter > 0 and w.at == 0) { var style = s.at(tx + number, body_y + vr).style; - style.fg = .{ .rgb = roles.key }; + style.fg = .{ .rgb = c.page.key }; s.set(tx + number, body_y + vr, "▸", style); } } } -/// The landing line's matched span (a Grep's match at the row's column) on -/// the current hit's ground, over the places lit on it (UX D7). +/// The landing line's matched span (a Grep's match at the row's column) as +/// the current hit, solid in the hue with the page's ink, over the places +/// lit on it (UX D7, R8). fn paintLandingSpan(p: *Pardes, s: *Surface, pane: *Pane, r: Rect, f: *panes.File.State, line: usize) void { if (!pane.places.shows(pane)) return; const hits = pane.places.hits.items; @@ -713,7 +699,7 @@ fn paintLandingSpan(p: *Pardes, s: *Surface, pane: *Pane, r: Rect, f: *panes.Fil var i = panes.Places.firstFrom(hits, ls); while (i < hits.len and hits[i].start <= caret) : (i += 1) { if (hits[i].end <= caret) continue; - File.paintWordSelection(p, s, pane, r, @intCast(line), @intCast(hits[i].start - ls), @intCast(hits[i].end - ls), p.chromeTheme().roles.hit_current); + File.paintWordSelection(p, s, pane, r, @intCast(line), @intCast(hits[i].start - ls), @intCast(hits[i].end - ls), p.chrome().hit_current, p.chrome().hit_current_text); return; } } @@ -768,9 +754,7 @@ fn paintTargets(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, .hi = if (line == last) to - lineStart(f, line) else File.sourceLine(pane, @intCast(line)).len, .to_edge = line != last, }; - const th = p.theme(); - const page = th.bg orelse th.tag_bg; - paintSourceSelection(p, s, pane, r, rows, colors.mix(page, colors.mix(page, th.sel_bg)), null); + paintSourceSelection(p, s, pane, r, rows, p.chrome().selection_secondary, null); return; } if (cur.root != .goto and cur.root != .next and cur.root != .prev) return; @@ -796,7 +780,7 @@ fn paintTargets(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, // row's keys, as many as they hold, right-aligned to its last digit, // bold in the key ink on the gutter's ground. With no numbers, over // the line's first cells on the selection's ground. Never a shift. - const ink = p.chromeTheme().roles.key; + const ink = p.chrome().page.key; const number = File.gutterWidth(pane) -| File.laneCells(pane) -| pane.layers.heat -| 1; const cells = @min(if (number > 0) number else tw, tw); for (rows[0..n], 0..) |row, i| { @@ -811,7 +795,7 @@ fn paintTargets(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, for (rows[i..n], keys[i..n]) |other, key| { if (other != row) continue; if (x >= (if (number > 0) cells else shown)) break; - const bg = if (number > 0) s.at(tx + x, y).style.bg else pardes.Color{ .rgb = p.theme().sel_bg }; + const bg = if (number > 0) s.at(tx + x, y).style.bg else pardes.Color{ .rgb = p.chrome().page.selection.ground }; s.set(tx + x, y, bindings.keyName(key), .{ .fg = .{ .rgb = ink }, .bg = bg, .bold = true }); x += 1; } @@ -844,13 +828,14 @@ fn hoverGhosts(p: *Pardes, s: *Surface, pane: *Pane, tx: u16, tw: u16, body_y: u const from = @as(usize, body_y + dst - k) * s.cols + tx; @memcpy(s.cells[to..][0..tw], s.cells[from..][0..tw]); } - const th = p.theme(); - const style: CellStyle = .{ .fg = .{ .rgb = th.tag_fg }, .bg = .{ .rgb = th.tag_bg } }; + // On the tag's ground in its ink, as a header. + const tag = &p.chrome().tag[0]; + const style: CellStyle = .{ .fg = .{ .rgb = tag.text }, .bg = .{ .rgb = tag.ground } }; const gutter: u16 = File.gutterWidth(pane); var lines = std.mem.splitScalar(u8, text, '\n'); for (0..k) |i| { const y = body_y + at + 1 + @as(u16, @intCast(i)); - s.fill(tx, y, tw, 1, .{ .bg = .{ .rgb = th.tag_bg } }); + s.fill(tx, y, tw, 1, .{ .bg = .{ .rgb = tag.ground } }); if (gutter + 2 < tw) _ = s.print(tx + gutter + 2, y, tw - gutter - 2, lines.next() orelse "", style); } } @@ -865,9 +850,8 @@ fn renameGhosts(p: *Pardes, s: *Surface, pane: *Pane, tx: u16, tw: u16, body_y: const old = @import("lsp/Ask.zig").renamedWord(pane) orelse return; const new = p.view().tag_state.field.text(); const tab = p.settings.tab; - const chrome = p.chromeTheme(); - const th = p.theme(); - const added: CellStyle = .{ .fg = .{ .rgb = chrome.diagnostic_hint }, .bg = if (th.bg) |c| .{ .rgb = c } else .default, .bold = true }; + const chrome = p.chrome(); + const added: CellStyle = .{ .fg = .{ .rgb = chrome.page.severity[3] }, .bg = if (chrome.host_page) .default else .{ .rgb = chrome.page.ground }, .bold = true }; const wide: u16 = @intCast(@min(File.displayWidth(tab, new), tw)); const gutter: i32 = File.gutterWidth(pane); var row: u16 = pane.context_rows; @@ -894,7 +878,7 @@ fn renameGhosts(p: *Pardes, s: *Surface, pane: *Pane, tx: u16, tw: u16, body_y: while (c < c1) : (c += 1) { const cell = s.at(tx + c, y); cell.style.strikethrough = true; - cell.style.fg = .{ .rgb = chrome.diagnostic_error }; + cell.style.fg = .{ .rgb = chrome.page.severity[0] }; } const x: u16 = @intCast(c1); if (x + wide < tw) { @@ -1193,6 +1177,12 @@ test "a build error is said where its cause is: the mark on its file's tag, its // elsewhere. try std.testing.expect(std.mem.indexOf(u8, rowText(s, body.x, body.y + 2, &buf), "three \u{2717} expected 2 argument(s), found 3") != null); try std.testing.expect(std.mem.indexOf(u8, rowText(s, body.x, body.y + 3, &buf), "four") != null); + // In the error's ink on the page (R9). + const mark = for (0..body.w) |i| { + const cell = s.at(body.x + @as(u16, @intCast(i)), body.y + 2); + if (std.mem.eql(u8, cell.grapheme(), "\u{2717}")) break cell; + } else return error.TestUnexpectedResult; + try std.testing.expectEqual(pardes.Color{ .rgb = p.chrome().page.severity[0] }, mark.style.fg); // The caret on line 3 and its detail asked for (K, UX D13): under the // line, the rows below two rows down. pane.body.cur_row = 2; @@ -1312,7 +1302,7 @@ test "a motion root's level paints its targets in place of their lines' numbers, try std.testing.expectEqualStrings("p", Field.of(s, gutter, body.y + 4, number, &buf)); const key = s.at(gutter + number - 1, body.y + 4); try std.testing.expectEqualStrings("p", key.grapheme()); - try std.testing.expectEqual(pardes.Color{ .rgb = p.chromeTheme().roles.key }, key.style.fg); + try std.testing.expectEqual(pardes.Color{ .rgb = p.chrome().page.key }, key.style.fg); try std.testing.expect(key.style.bold); try std.testing.expect(std.mem.indexOfScalar(u8, Field.of(s, gutter, body.y + 5, number, &buf), 'g') != null); try std.testing.expect(std.mem.indexOfAny(u8, Field.of(s, gutter, body.y + 5, number, &buf), "0123456789") == null); @@ -1417,3 +1407,118 @@ test "a message's detail unrolls only on request (UX D13): the caret passing its p.update(.{ .key = .{ .cp = 'K' } }); try std.testing.expectEqual(pardes.TagState.Kind.prompt, p.view().tag_state.kind); } + +test "the body's selections are one family (R7): the primary on the selection in its ink, another range on its faint half in the text's own ink, its head the selection reversed, a B2 sweep on the chrome's exec sweep" { + const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 20 }); + defer p.deinit(); + colors.setThemeIndex(p, colors.themeIndex("orchard").?); + const pane = try p.setTestFile("alpha beta\ngamma delta\n"); + const id = p.view().active; + pane.focus = .body; + // `e` selects alpha, `C` copies it below: gamma the primary. + for ("eC") |c| p.update(.{ .key = .{ .cp = c, .text = &[_]u8{c} } }); + try std.testing.expectEqual(@as(i32, 1), pane.body.cur_row); + try std.testing.expect(pane.body.vsel.active and pane.body.nsel == 1); + var frame = std.heap.ArenaAllocator.init(std.testing.allocator); + defer frame.deinit(); + const c = p.chrome(); + const r = p.view().rects[id]; + const x = r.x + config.GUTTER + panes.File.gutterWidth(pane); + const y = p.bodyTop(pane, r); + var s = try p.render(frame.allocator()); + for (0..5) |i| { + const primary = s.at(x + @as(u16, @intCast(i)), y + 1).style; + try std.testing.expectEqual(pardes.Color{ .rgb = c.page.selection.ground }, primary.bg); + if (i < 4) try std.testing.expectEqual(pardes.Color{ .rgb = c.page.selection.text }, primary.fg); + const other = s.at(x + @as(u16, @intCast(i)), y).style; + if (i < 4) { + try std.testing.expectEqual(pardes.Color{ .rgb = c.selection_secondary }, other.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = c.page.text }, other.fg); + } else { + try std.testing.expectEqual(pardes.Color{ .rgb = c.page.selection.text }, other.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = c.page.selection.ground }, other.fg); + } + } + // B2 swept over beta, not let go: the exec sweep. + p.update(.{ .mouse = .{ .button = .middle, .kind = .press, .col = x + 6, .row = y } }); + p.update(.{ .mouse = .{ .button = .middle, .kind = .drag, .col = x + 9, .row = y } }); + _ = frame.reset(.retain_capacity); + s = try p.render(frame.allocator()); + for (6..10) |i| { + const swept = s.at(x + @as(u16, @intCast(i)), y).style; + try std.testing.expectEqual(pardes.Color{ .rgb = c.sweeps[1].ground }, swept.bg); + try std.testing.expectEqual(pardes.Color{ .rgb = c.sweeps[1].text }, swept.fg); + } +} + +test "the body's surfaces take every colour from the chrome: none reads a theme's own fields or the old views (DESIGN.md B6)" { + const sources = [_]struct { []const u8, []const u8 }{ + .{ "body_layer.zig", @embedFile("body_layer.zig") }, + .{ "Places.zig", @embedFile("Places.zig") }, + .{ "Query.zig", @embedFile("Query.zig") }, + .{ "Output.zig", @embedFile("Output.zig") }, + .{ "Tables.zig", @embedFile("Tables.zig") }, + .{ "File.zig", @embedFile("File.zig") }, + .{ "Prompt.zig", @embedFile("Prompt.zig") }, + .{ "Pick.zig", @embedFile("Pick.zig") }, + .{ "jj.zig", @embedFile("jj.zig") }, + .{ "ansi.zig", @embedFile("ansi.zig") }, + }; + var wrong: usize = 0; + for (sources) |source| { + const name, const text = source; + // The code, not its tests. + const code = text[0 .. std.mem.indexOf(u8, text, "\ntest \"") orelse text.len]; + // A theme is read for its name alone. + var at: usize = 0; + while (std.mem.indexOfPos(u8, code, at, "theme()")) |i| : (at = i + 1) { + if (std.mem.startsWith(u8, code[i + "theme()".len ..], ".name")) continue; + std.debug.print("{s}: a theme's own colours read at byte {d}\n", .{ name, i }); + wrong += 1; + } + for ([_][]const u8{ "chromeTheme()", "bodyChrome", ".roles", "Grounds", "LegacyTheme" }) |old| if (std.mem.indexOf(u8, code, old)) |i| { + std.debug.print("{s}: `{s}` at byte {d}\n", .{ name, old, i }); + wrong += 1; + }; + } + try std.testing.expectEqual(@as(usize, 0), wrong); +} + +test "a selection that is the current place is drawn as the current place, its solid chip, not the selection: one meaning, one look (the coordinator's ruling on L2b's open point); the caret still shows, and any other selection is the selection" { + const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 24 }); + defer p.deinit(); + colors.setThemeIndex(p, colors.themeIndex("orchard").?); + const pane = try p.setTestFile("alpha beta\ngamma alpha\nb\n"); + const c = p.chrome(); + var frame: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer frame.deinit(); + const r = p.view().rects[0]; + const x = r.x + config.GUTTER + panes.File.gutterWidth(pane); + const y = p.bodyTop(pane, r); + const keys = struct { + fn typed(q: *Pardes, text: []const u8) void { + for (text) |ch| q.update(.{ .key = .{ .cp = ch, .text = &[_]u8{ch} } }); + } + }.typed; + // A live `/`: the first place current, and selected. + keys(p, "/alpha"); + try std.testing.expectEqual(@as(?usize, 0), pane.places.current); + var s = try p.render(frame.allocator()); + for (0..5) |i| { + const cell = s.at(x + @as(u16, @intCast(i)), y).style; + try std.testing.expectEqual(Color{ .rgb = c.hit_current }, cell.bg); + try std.testing.expectEqual(Color{ .rgb = c.hit_current_text }, cell.fg); + } + // Landed, then `n`: the next one current and selected, the same chip, + // and the caret on it. + p.update(.{ .key = .{ .cp = pardes.Key.enter } }); + keys(p, "n"); + try std.testing.expectEqual(@as(?usize, 1), pane.places.current); + s = try p.render(frame.allocator()); + for (6..11) |i| try std.testing.expectEqual(Color{ .rgb = c.hit_current }, s.at(x + @as(u16, @intCast(i)), y + 1).style.bg); + try std.testing.expect(s.cursor != null and s.cursor.?.y == y + 1 and s.cursor.?.x >= x + 6 and s.cursor.?.x <= x + 10); + // The line selected, past the place: a selection again. + keys(p, "x"); + s = try p.render(frame.allocator()); + try std.testing.expectEqual(Color{ .rgb = c.page.selection.ground }, s.at(x + 6, y + 1).style.bg); +} diff --git a/core/builtins.zig b/core/builtins.zig index 829935c7..176cabe0 100644 --- a/core/builtins.zig +++ b/core/builtins.zig @@ -1993,7 +1993,8 @@ pub const Follow = struct { made.file.?.follow = true; c.pane.follow_scroll = f.scroll; made.follow_scroll = made.file.?.scroll; - made.appendTag(" Unfollow") catch |err| c.p.reportError(.at(c.id), "Follow", err); + // The new page's own text (UX K'1): a word after its computed ones. + made.appendTag(if (tagline.curTail(made).len == 0) "Unfollow" else " Unfollow") catch |err| c.p.reportError(.at(c.id), "Follow", err); } }; diff --git a/core/colors.zig b/core/colors.zig index eefb2b67..6c83f5c8 100644 --- a/core/colors.zig +++ b/core/colors.zig @@ -3,6 +3,7 @@ //! themes programme's), theme files, and switching themes at runtime. //! What a theme says is theme_schema.zig's. const pardes = @import("root.zig"); +const builtin = @import("builtin"); const schema = @import("theme_schema.zig"); pub const Theme = schema.Theme; pub const LegacyTheme = schema.LegacyTheme; @@ -85,7 +86,7 @@ pub const separator_floor: f32 = 1.5; /// the GUI's default ground, and a dark terminal's. pub const null_page: [3]u8 = .{ 18, 18, 18 }; /// The ink of a theme with none, on a dark page and on a light one. -const null_text: [3]u8 = .{ 0xcc, 0xcc, 0xcc }; +pub const null_text: [3]u8 = .{ 0xcc, 0xcc, 0xcc }; const null_text_light: [3]u8 = .{ 0x22, 0x22, 0x22 }; fn separatorOf(th: *const LegacyTheme) [3]u8 { const base = th.border orelse th.scroll_track; @@ -552,10 +553,13 @@ pub const Chrome = struct { selection_secondary: [3]u8, /// The pointer buttons' sweeps: select, exec, look (acme's meanings). sweeps: [3]Theme.Sweep, - /// Search: a hit's ground, and the current one's ground and ink. + /// Search: a hit's ground, and the current one's ground and ink; a + /// search's last places while its field is no regex, dimmed: the page + /// halfway toward the hit (as `selection_secondary` is the selection's). hit: [3]u8, hit_current: [3]u8, hit_current_text: [3]u8, + hit_faint: [3]u8, add: Diff, del: Diff, /// The Changes layer's lanes, a pin each (`lanes_len` of them), and @@ -584,8 +588,10 @@ pub const Chrome = struct { /// user's, a path, `Keep`), word (computed command words: the text /// toward the ground to 4.5:1, H), dim (hints, meta, forward steps), /// rule (spines), key (the accent: keys, `▶`, the walked word), match - /// (a query's letters), the four severities, and a selection rebuilt - /// on it with its own. + /// (a query's letters), kind (a symbol's kind mark in a list, `t`, + /// `f`: the keyword's hue, which spells a kind in the text, held on the + /// ground and on its selection, a list's cursor row), the four + /// severities, and a selection rebuilt on it with its own. pub const Inks = struct { ground: [3]u8, text: [3]u8, @@ -594,6 +600,7 @@ pub const Chrome = struct { rule: [3]u8, key: [3]u8, match: [3]u8, + kind: [3]u8, severity: [4][3]u8, selection: Selection, }; @@ -696,12 +703,17 @@ pub const Chrome = struct { }; const severity = severitiesOn(page, text, candidates, null); - // R8: the hits' hue and grounds. + // R8: the hits' hue and grounds; a theme's own where it is a ground + // you see and the text reads on: 1.5:1 off the page, or, where the + // text leaves no room for that (no ground 1.5:1 off keeps it its + // floor), 1.1:1 with 0.08 OKLab (R0). const ink_floor = @min(text_floor, contrast(text, page) * 0.9); - const own_hit: ?[3]u8 = if (th.hit) |own| - (if (contrast(own, page) >= hit_floor - 0.01 and contrast(text, own) >= ink_floor - 0.01) own else null) - else - null; + const own_hit: ?[3]u8 = if (th.hit) |own| own: { + const off = contrast(own, page); + const no_room = contrast(text, page) < hit_floor * ink_floor; + const seen = off >= hit_floor - 0.01 or (no_room and off >= 1.1 and oklabDistance(labOf(own), labOf(page)) >= 0.08); + break :own if (seen and contrast(text, own) >= ink_floor - 0.01) own else null; + } else null; var hue = severity[1]; if (own_hit) |own| { hue = own; @@ -725,6 +737,7 @@ pub const Chrome = struct { // ink (vim's IncSearch): room for it in every theme. c.hit_current = hold(hue, &.{page}, text_floor); c.hit_current_text = page; + c.hit_faint = mixOklab(page, c.hit, 0.5); // Every ground's inks; on the tags and the status row, the // tag's selection rebuilt on each where it stands too near it. @@ -791,6 +804,11 @@ pub const Chrome = struct { // R10: the lanes (the accents but green and red, hue-sorted) and // churn's steps from the line numbers' ink to the deleted hue. c.lanes_len = lanesOf(.{ ansi[3], ansi[4], ansi[5], ansi[6], th.number, th.keyword }, .{ th.deleted orelse ansi[1], th.added orelse ansi[2] }, &c.lanes); + // A theme with no accent (a grey one) draws its lanes in one grey. + if (c.lanes_len == 0) { + c.lanes[0] = c.line_number; + c.lanes_len = 1; + } for (&c.heat, 1..) |*h, k| h.* = mixOklab(c.line_number, th.deleted orelse ansi[1], @as(f32, @floatFromInt(k)) / 8); return c; } @@ -971,6 +989,7 @@ fn groundInks(th: *const Theme, ground: [3]u8, text: [3]u8, sel: [3]u8, sel_text .rule = line.toward(Chrome.rule_ink), .key = hold(th.accent, &.{ground}, Chrome.text_floor), .match = hold(hue, &.{ground}, Chrome.text_floor), + .kind = hold(th.keyword, &.{ ground, sel }, Chrome.text_floor), .severity = severity, .selection = .{ .ground = sel, @@ -1044,42 +1063,28 @@ fn hsvApart(a: [3]u8, b: [3]u8) f32 { } /// The ink a syntax class is drawn in; a byte of none keeps its text's own. -pub fn synInk(th: *const LegacyTheme, sy: @import("syntax.zig").Syn) ?[3]u8 { +pub fn synInk(th: *const Theme, sy: @import("syntax.zig").Syn) ?[3]u8 { return switch (sy) { .none => null, - .keyword => th.kw, - .string => th.str, - .number => th.num, + .keyword => th.keyword, + .string => th.string, + .number => th.number, .comment => th.comment, }; } /// The grounds a style byte's high bits name (syntax.ground_add and the -/// rest) in a theme: a row added or removed on a ground a little way from -/// the page toward the theme's green or red (its own ANSI ones where it has -/// a palette), a stronger one, a faint one, and the row's marker in that -/// hue, pushed toward the ink until it reads on the row's ground. Syntax -/// colours are drawn over a ground unchanged. +/// rest) in a theme, for the library: its chrome's added and deleted rows +/// (R10). Syntax colours are drawn over a ground unchanged. pub const Grounds = struct { add: Ground, del: Ground, - pub const Ground = struct { row: [3]u8, emph: [3]u8, line: [3]u8, ink: [3]u8 }; - - pub fn of(th: *const LegacyTheme) Grounds { - const page = th.bg orelse th.tag_bg; - const ink = th.fg orelse th.tag_fg; - const green: [3]u8 = if (th.palette) |pal| pal[2] else .{ 0x2e, 0xa0, 0x43 }; - const red: [3]u8 = if (th.palette) |pal| pal[1] else .{ 0xcf, 0x22, 0x2e }; - return .{ .add = ground(page, ink, green), .del = ground(page, ink, red) }; - } + pub const Ground = Chrome.Diff; - fn ground(page: [3]u8, ink: [3]u8, hue: [3]u8) Ground { - const row = mixOklab(page, hue, 0.18); - var marker = hue; - var step: usize = 0; - while (step < 4 and contrast(marker, row) < 3) : (step += 1) marker = mixOklab(marker, ink, 0.4); - return .{ .row = row, .emph = mixOklab(page, hue, 0.28), .line = mixOklab(page, hue, 0.07), .ink = marker }; + pub fn of(th: *const Theme) Grounds { + const c = Chrome.of(th); + return .{ .add = c.add, .del = c.del }; } /// The ground of a byte's hue, if it has one. @@ -1091,27 +1096,37 @@ 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 { + // DESIGN.md E's groups, the picker's sections (`theme_groups`): pardes's + // own, dark first (the host's page, the favourite), orchard the default + // (`default_theme`, by name). + pub const dark = @import("themes/dark.zig"); + pub const light = @import("themes/light.zig"); pub const orchard = @import("themes/orchard.zig"); - pub const dusk = @import("themes/dusk.zig"); + pub const orchard_black = @import("themes/orchard_black.zig"); pub const ink = @import("themes/ink.zig"); + pub const mono = @import("themes/mono.zig"); + pub const okabe = @import("themes/okabe.zig"); + pub const sepia = @import("themes/sepia.zig"); pub const paper = @import("themes/paper.zig"); pub const daybreak = @import("themes/daybreak.zig"); - pub const atelier = @import("themes/atelier.zig"); + pub const dusk = @import("themes/dusk.zig"); + pub const lapis = @import("themes/lapis.zig"); + // Pardes's, after a classic. pub const forge = @import("themes/forge.zig"); + pub const forge_black = @import("themes/forge_black.zig"); + pub const forge_soft = @import("themes/forge_soft.zig"); pub const lagoon = @import("themes/lagoon.zig"); pub const solarium = @import("themes/solarium.zig"); pub const spectrum = @import("themes/spectrum.zig"); pub const harvest = @import("themes/harvest.zig"); pub const clay = @import("themes/clay.zig"); - pub const forge_black = @import("themes/forge_black.zig"); - pub const forge_soft = @import("themes/forge_soft.zig"); - pub const orchard_black = @import("themes/orchard_black.zig"); + // acme's. pub const acme = @import("themes/acme.zig"); - pub const lapis = @import("themes/lapis.zig"); + pub const atelier = @import("themes/atelier.zig"); // Faithful ports of well-known themes, a family at a time (core/themes/ // <name>.zig says where each value came from): `theme_groups`. pub const dark_plus = @import("themes/dark_plus.zig"); @@ -1145,10 +1160,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); @@ -1177,24 +1188,25 @@ const curated = struct { pub const ayu_light = @import("themes/ayu_light.zig"); pub const doom_one = @import("themes/doom_one.zig"); pub const doom_one_light = @import("themes/doom_one_light.zig"); - // The legacy pair last. + // Captured: an old helix setup, kept (it works). pub const helix = @import("themes/helix.zig"); - pub const dark = @import("themes/dark.zig"); }; -/// A struct of theme files as themes in the old names: each file's -/// `theme`, a field it leaves out its default. -fn fold(comptime C: type) [@typeInfo(C).@"struct".decl_names.len]LegacyTheme { +/// A struct of theme files as themes: each file's `theme`, a field it +/// leaves out its default. +fn fold(comptime C: type) [@typeInfo(C).@"struct".decl_names.len]Theme { comptime { @setEvalBranchQuota(400000); - var out: [@typeInfo(C).@"struct".decl_names.len]LegacyTheme = undefined; - const theme_info = @typeInfo(LegacyTheme).@"struct"; + var out: [@typeInfo(C).@"struct".decl_names.len]Theme = undefined; + const theme_info = @typeInfo(Theme).@"struct"; for (@typeInfo(C).@"struct".decl_names, 0..) |d, i| { - var t: LegacyTheme = undefined; + var t: Theme = undefined; const source = @field(C, d).theme; + for (@typeInfo(@TypeOf(source)).@"struct".field_names) |name| if (!@hasField(Theme, name)) + @compileError("theme " ++ d ++ " has no field " ++ name ++ " (core/theme_schema.zig)"); for (theme_info.field_names, theme_info.field_types, theme_info.field_attrs) |name, T, attrs| { @field(t, name) = if (@hasField(@TypeOf(source), name)) - @field(source, name) + as(T, @field(source, name)) else if (attrs.defaultValue(T)) |value| value else @@ -1206,30 +1218,40 @@ fn fold(comptime C: type) [@typeInfo(C).@"struct".decl_names.len]LegacyTheme { } } -/// The ring in the old names: what `Pardes.theme()` hands the surfaces -/// that still read a theme's own fields, until they read `Chrome` (the -/// themes programme's L2 lines). -pub const legacy_themes = fold(curated) ++ fold(@import("generated_themes")); +/// A theme file's literal as the field's type: a struct field by field +/// (acme's sweeps), which a literal's own struct type does not coerce to. +fn as(comptime T: type, comptime value: anytype) T { + return switch (@typeInfo(T)) { + .optional => |o| if (@TypeOf(value) == @TypeOf(null)) null else as(o.child, value), + .array => |a| blk: { + var out: T = undefined; + for (&out, 0..) |*e, i| e.* = as(a.child, value[i]); + break :blk out; + }, + .@"struct" => blk: { + var out: T = undefined; + for (@typeInfo(T).@"struct".field_names) |name| @field(out, name) = as(@FieldType(T, name), @field(value, name)); + break :blk out; + }, + else => value, + }; +} + /// The ring: pardes's own (`native_count` of them), then the imported. -/// The files still speak the old names: renamed here, at comptime. -pub const themes: [legacy_themes.len]Theme = blk: { - @setEvalBranchQuota(400000); - var out: [legacy_themes.len]Theme = undefined; - for (&out, legacy_themes) |*t, old| t.* = .fromLegacy(old); - break :blk out; -}; +pub const themes = fold(curated) ++ fold(@import("generated_themes")); /// The first `native_count` of `themes` are pardes's own; the rest imported. pub const native_count = @typeInfo(curated).@"struct".decl_names.len; /// The picker's sections (`Themes`), in ring order, each running from /// the theme it names to the next section's; `NextColor` and `Theme` still -/// see one flat ring. The current pardes themes, then the faithful ports a -/// family at a time, then the legacy pair (`helix`, captured from an old -/// helix setup and the boot default before orchard; `dark`, the host -/// terminal's own ground), then everything imported. +/// see one flat ring (DESIGN.md E): pardes's own, those after a classic, +/// acme's, the faithful ports a family at a time, the captured helix setup; +/// then the imported, a family at a time (`import_heads`). pub const ThemeGroup = struct { title: []const u8, first: []const u8 }; const theme_groups = [_]ThemeGroup{ - .{ .title = "Pardes themes", .first = "orchard" }, + .{ .title = "Pardes", .first = "dark" }, + .{ .title = "Pardes, after a classic", .first = "forge" }, + .{ .title = "acme", .first = "acme" }, .{ .title = "Visual Studio Code", .first = "dark_plus" }, .{ .title = "Solarized", .first = "solarized_dark" }, .{ .title = "Dracula", .first = "dracula" }, @@ -1243,9 +1265,77 @@ const theme_groups = [_]ThemeGroup{ .{ .title = "Nord", .first = "nord" }, .{ .title = "Ayu", .first = "ayu_dark" }, .{ .title = "Doom One", .first = "doom_one" }, - .{ .title = "Legacy themes", .first = "helix" }, + .{ .title = "Captured", .first = "helix" }, +}; + +/// 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); @@ -1257,12 +1347,38 @@ fn indexOfTheme(comptime name: []const u8) usize { /// The heading of the picker section that starts at ring index `index`. pub fn groupAt(index: usize) ?[]const u8 { inline for (theme_groups) |g| if (index == comptime indexOfTheme(g.first)) return g.title; - if (index == native_count) return "Imported themes (helix, zed)"; - return null; + return if (index >= native_count) import_heads[index - native_count] else null; } -/// Original and classic-inspired Pardes palettes precede retained imports. -pub const native_theme_count = 15; +/// A theme's family: its name's first word (gruvbox_dark_hard's gruvbox). +fn familyOf(name: []const u8) []const u8 { + return name[0 .. std.mem.indexOfScalar(u8, name, '_') orelse name.len]; +} + +/// The imported themes' headings, a family's at its first (DESIGN.md E: a +/// heading per family, not one flat run), and one over the lone ones the +/// generator rings after every family (tools/gen_themes.zig `byFamily`). +const import_heads: [themes.len - native_count]?[]const u8 = blk: { + @setEvalBranchQuota(2_000_000); + const imported = themes[native_count..]; + var out: [imported.len]?[]const u8 = @splat(null); + var lone_seen = false; + for (imported, 0..) |t, i| { + const family = familyOf(t.name); + var members: usize = 0; + for (imported) |u| { + if (std.mem.eql(u8, familyOf(u.name), family)) members += 1; + } + if (members < 2) { + if (!lone_seen) out[i] = "Imported, one of a kind"; + lone_seen = true; + } else if (i == 0 or !std.mem.eql(u8, familyOf(imported[i - 1].name), family)) { + if (lone_seen) @compileError("imported family " ++ family ++ " rings after a lone theme (tools/gen_themes.zig byFamily)"); + out[i] = "Imported: " ++ family; + } + } + break :blk out; +}; comptime { if (themes.len > std.math.maxInt(u16) + 1) @@ -1288,17 +1404,13 @@ pub const ChromeTheme = struct { border: [3]u8, empty_col: [3]u8, search_bg: [3]u8, - search_fg: [3]u8, tag_reading_bg: [3]u8, diagnostic_error: [3]u8, diagnostic_warning: [3]u8, - diagnostic_info: [3]u8, - diagnostic_hint: [3]u8, box: [3]u8, box_dim: [3]u8, column_box: [3]u8, column_box_dim: [3]u8, - lineno: [3]u8, scroll_track: [3]u8, scroll_thumb: [3]u8, roles: Roles, @@ -1307,14 +1419,25 @@ pub const ChromeTheme = struct { /// the surfaces that still read them until they do (the themes /// programme's L2 lines), so no frame moves before its surface does. resolved: Chrome, + /// The theme in the old names (`Pardes.theme()`), for what still reads + /// a theme's own fields: a ThemeFile in them, itself; any other theme's + /// filled from its chrome where the new names derive (`viewOf`). + view: LegacyTheme, /// A theme in the old names' chrome. pub fn fromTheme(th: *const LegacyTheme) ChromeTheme { - return .of(&.fromLegacy(th.*), th); + return .of(&.fromLegacy(th.*), th, .of(&.fromLegacy(th.*))); + } + + /// A theme in the new names' chrome: the ring's, a ThemeFile's. + pub fn ofTheme(theme: *const Theme) ChromeTheme { + const resolved: Chrome = .of(theme); + return .of(theme, &viewOf(theme, &resolved), resolved); } - /// A theme's chrome, from the theme and its old names' view. - pub fn of(theme: *const Theme, th: *const LegacyTheme) ChromeTheme { + /// A theme's chrome, from the theme, its old names' view and what B4 + /// derives of it. + fn of(theme: *const Theme, th: *const LegacyTheme, resolved: Chrome) ChromeTheme { const active_bg = focusTint(th); const active_fg = th.tag_active_fg orelse th.tag_fg; // A name is always tinted: a theme that names no tint gets one of @@ -1336,26 +1459,45 @@ pub const ChromeTheme = struct { .border = separatorOf(th), .empty_col = th.empty_col orelse separatorOf(th), .search_bg = th.search_bg orelse th.sel_bg, - .search_fg = th.search_fg orelse th.sel_fg, .tag_reading_bg = reading, // A theme's error ink, else its palette's red (UX E3). .diagnostic_error = th.diagnostic_error orelse if (th.palette) |pal| pal[1] else (th.fg orelse th.tag_fg), .diagnostic_warning = th.diagnostic_warning orelse (th.fg orelse th.tag_fg), - .diagnostic_info = th.diagnostic_info orelse (th.fg orelse th.tag_fg), - .diagnostic_hint = th.diagnostic_hint orelse (th.fg orelse th.tag_fg), - .box = th.box, + // The focused grip the chrome's (the accent held 3:1, R6). + .box = resolved.grip.focus, .box_dim = th.box_dim, .column_box = th.column_box orelse th.num, .column_box_dim = th.column_box_dim orelse mix(th.column_box orelse th.num, th.tag_bg), - .lineno = th.lineno, .scroll_track = th.scroll_track, .scroll_thumb = th.scroll_thumb, .roles = .of(th, th.tag_bg, active_bg, reading), - .resolved = .of(theme), + .resolved = resolved, + .view = th.*, }; } }; +/// A theme in the new names as the old names say it: the fields they +/// require and the new ones derive, from its chrome. `box_dim`, a resting +/// grip's fill: the tag's own ground where the theme rings its grips itself +/// (acme's clean button, R6), else the resting ring. The focused name the +/// chrome's, unless it lands on the theme's own focused ink, which the old +/// surfaces draw unheld (ferra's #fecdb2): then the plain tag's. +fn viewOf(theme: *const Theme, r: *const Chrome) LegacyTheme { + const fill = if (theme.grip_ring != null) r.tag[0].ground else r.grip.ring; + const own_focus_ink = theme.tag_focus_text orelse theme.tag_text; + const focused_name = if (std.mem.eql(u8, &r.name[1], &own_focus_ink)) r.name[0] else r.name[1]; + return theme.toLegacy(.{ + .sel_fg = r.page.selection.text, + .lineno = r.line_number, + .scroll_track = r.rail, + .scroll_thumb = r.rail_thumb, + .box_dim = fill, + .tag_active_name_fg = focused_name, + .column_box_dim = r.grip.column_rest, + }); +} + /// A tag's ground in the walk UI (UX DESIGN.md D4): the plain tag's, the /// focused one's tint, a reading pane's tint, focused or not (its ink is /// the focused tag's while it has the keyboard). @@ -1381,10 +1523,6 @@ pub const Roles = struct { /// The letters a query matched: an ink, never a ground, 4.5:1 on every /// tag ground and on the selection. match: [3]u8, - /// The body's places and a preview's landing line, and the current - /// one (its matched span): grounds off the page, its ink on them 4.5:1. - hit: [3]u8, - hit_current: [3]u8, /// A message's ink by its kind (Messages.ink): 4.5:1 on the tags and /// the page. err: [3]u8, @@ -1397,8 +1535,6 @@ pub const Roles = struct { pub const rule_floor: f32 = 1.8; pub const rule_ceiling: f32 = 2.5; pub const ink_floor: f32 = 4.5; - pub const hit_floor: f32 = 1.5; - pub const hit_current_floor: f32 = 1.9; pub const reading_distance: f32 = 0.04; pub fn on(r: *const Roles, ground: TagGround) *const RoleInks { @@ -1430,20 +1566,6 @@ pub const Roles = struct { r.key = pushAway(th.box, &tag_grounds, ink_floor); r.match = pushAway(matchHue(th), &tag_grounds, ink_floor); const page = th.bg orelse null_page; - const body_ink = th.fg orelse th.tag_fg; - const dark = relativeLuminance(page) < 0.18; - // The theme's search ground where it stands off the page and the - // body reads on it; else the page a little way toward its hue (the - // warm accent's without one). The current one as far past the hit - // as 32 % is past 18 % (38 past 22 on a light page). - const hue = th.search_bg orelse th.num; - const own = th.search_bg != null and contrast(hue, page) >= hit_floor and contrast(body_ink, hue) >= ink_floor; - const at: f32 = if (own) 1 else if (dark) 0.18 else 0.22; - r.hit = if (own) hue else hitOf(page, hue, body_ink, at, hit_floor); - const past: f32 = if (dark) 0.32 / 0.18 else 0.38 / 0.22; - r.hit_current = hitOf(page, hue, body_ink, at * past, hit_current_floor); - // Never fainter than the hit, where the ink holds both short. - if (contrast(r.hit_current, page) < contrast(r.hit, page)) r.hit_current = r.hit; const message_grounds = [_][3]u8{ plain, focused, reading, page }; const ink = th.fg orelse th.tag_fg; r.err = pushAway(th.diagnostic_error orelse if (th.palette) |pal| pal[1] else ink, &message_grounds, ink_floor); @@ -1546,48 +1668,6 @@ fn selectionOf(own: [3]u8, ground: [3]u8, text: [3]u8) [3]u8 { return best; } -/// A ground off `page` toward `hue` at `t` (past 1, beyond the hue, as far -/// as the gamut goes), held where the body's `ink` reads on it at 4.5:1 -/// (or its own on the page, where that is less); on toward the hue, the -/// least way that stands off the page at `floor`, where the ink still -/// reads on it; else moved on toward the ink until it stands off the page -/// at `floor`, as far as the ink allows. -fn hitOf(page: [3]u8, hue: [3]u8, ink: [3]u8, t: f32, floor: f32) [3]u8 { - const a = toOklab(page); - const b = toOklab(hue); - const ink_floor = @min(Roles.ink_floor, contrast(ink, page)); - var k = t; - var c = fromOklab(.{ a[0] + (b[0] - a[0]) * k, a[1] + (b[1] - a[1]) * k, a[2] + (b[2] - a[2]) * k }); - while (contrast(ink, c) < ink_floor and k > 0) { - k -= t / 50; - c = fromOklab(.{ a[0] + (b[0] - a[0]) * k, a[1] + (b[1] - a[1]) * k, a[2] + (b[2] - a[2]) * k }); - } - // Found by halves, seven mixes: the nearer the hue, the further off - // the page (UX E7 7b: a landing line 1.5:1, its span 1.9:1). - if (contrast(c, page) < floor and k < 1 and contrast(hue, page) >= floor) { - var lo = k; - var hi: f32 = 1; - var far = hue; - for (0..7) |_| { - const mid = (lo + hi) / 2; - const m = fromOklab(.{ a[0] + (b[0] - a[0]) * mid, a[1] + (b[1] - a[1]) * mid, a[2] + (b[2] - a[2]) * mid }); - if (contrast(m, page) < floor) lo = mid else { - hi = mid; - far = m; - } - } - if (contrast(ink, far) >= ink_floor) c = far; - } - const start = c; - var step: f32 = 1; - while (contrast(c, page) < floor and step <= 50) : (step += 1) { - const next = mixOklab(start, ink, step / 100); - if (contrast(ink, next) < ink_floor) break; - c = next; - } - return c; -} - /// A reading pane's tag (UX DESIGN.md D4): the theme's own where it stands /// off the tag, else the tag shifted toward paper yellow by 0.04 in OKLab /// and lighter by half that on a dark tag (darker on a light), so it reads @@ -1765,27 +1845,27 @@ pub fn loadThemeFile(p: *Pardes, generation: u32, bytes: []const u8) bool { // user's own, an older DumpThemes') is read in them and renamed; its // old names' view is the file itself. var theme: Theme = undefined; - var view: LegacyTheme = undefined; + var chrome: ChromeTheme = undefined; if (inOldNames(source)) { - view = std.zon.parse.fromSlice(LegacyTheme, options) catch |err| return zonFailed(p, request, err, &diagnostics); + const view = std.zon.parse.fromSlice(LegacyTheme, options) catch |err| return zonFailed(p, request, err, &diagnostics); + chrome = .fromTheme(&view); theme = .fromLegacy(view); } else { theme = std.zon.parse.fromSlice(Theme, options) catch |err| return zonFailed(p, request, err, &diagnostics); - const r = Chrome.of(&theme); - view = theme.toLegacy(.{ .sel_fg = r.page.selection.text, .lineno = r.line_number, .scroll_track = r.rail, .scroll_thumb = r.rail_thumb, .box_dim = r.grip.ring }); + chrome = .ofTheme(&theme); } if (theme.name.len == 0 or theme.name.len > 255) { themeFileError(p, request, error.InvalidThemeName); return false; } + var view = chrome.view; view.name = p.gpa.dupe(u8, theme.name) catch |err| { themeFileError(p, request, err); return false; }; - theme.name = view.name; + chrome.view.name = view.name; - p.theme_chrome = .of(&theme, &view); - p.body_chrome = .{ .theme = view, .chrome = p.theme_chrome }; + p.theme_chrome = chrome; const old = p.custom_theme; p.custom_theme = view; if (old) |theme_value| p.gpa.free(theme_value.name); @@ -1822,13 +1902,9 @@ fn inOldNames(source: [:0]const u8) bool { } /// The session's theme's chrome, at its start (Pardes.init, a Restore): -/// never one the window previews (`previewTheme`); the body's copy of it -/// (Core.bodyChrome's, keyed by the theme) made with it, not again at the -/// first frame. +/// never one the window previews (`previewTheme`). pub fn finishThemeInitialization(p: *Pardes) void { - const theme = if (p.custom_theme) |*custom| custom else &legacy_themes[p.settings.theme]; - p.theme_chrome = if (p.custom_theme != null) .fromTheme(theme) else .of(&themes[p.settings.theme], theme); - p.body_chrome = .{ .theme = theme.*, .chrome = p.theme_chrome }; + p.theme_chrome = if (p.custom_theme) |*custom| .fromTheme(custom) else .ofTheme(&themes[p.settings.theme]); } /// Themes near `name`, a line of them, for a Theme given a name there is @@ -1908,16 +1984,14 @@ pub fn previewTheme(p: *Pardes, index: ?usize) void { if (i >= themes.len) return; if (p.theme_preview) |had| if (had == i) return; p.theme_preview = @intCast(i); - p.preview_chrome = .of(&themes[i], &legacy_themes[i]); - p.body_chrome = .{ .theme = legacy_themes[i], .chrome = p.preview_chrome }; + p.preview_chrome = .ofTheme(&themes[i]); } pub fn setThemeIndex(p: *Pardes, index: usize) void { if (index >= themes.len or (p.custom_theme == null and p.theme_file_path.get().len == 0 and index == @as(usize, p.settings.theme))) return; - p.theme_chrome = .of(&themes[index], &legacy_themes[index]); - p.body_chrome = .{ .theme = legacy_themes[index], .chrome = p.theme_chrome }; + p.theme_chrome = .ofTheme(&themes[index]); if (p.custom_theme) |theme_value| { p.custom_theme = null; p.gpa.free(theme_value.name); @@ -1932,13 +2006,14 @@ pub fn setThemeIndex(p: *Pardes, index: usize) void { } test "every native theme's separators stand off its page, and its focus tint off its tag" { - for (legacy_themes[0..native_count]) |*theme| { + for (themes[0..native_count]) |*ring_theme| { + const view = ChromeTheme.ofTheme(ring_theme).view; + const theme = &view; const chrome = ChromeTheme.fromTheme(theme); const page = theme.bg orelse null_page; try std.testing.expect(contrast(chrome.border, page) >= separator_floor); - // A dark page's focused tag is told by its band too, not the grip - // alone; acme's (light, and acme's own) is told by its button. - if (relativeLuminance(page) < 0.18) try std.testing.expect(theme.tag_active_bg != null); + // A focused tag of its own stands off the plain one (R4 derives the + // rest: the ring test's `focus`). if (theme.tag_active_bg) |own| { try std.testing.expect(contrast(chrome.tag_active_bg, theme.tag_bg) >= focusTintFloor(theme)); // And its text still reads. @@ -1949,9 +2024,11 @@ test "every native theme's separators stand off its page, and its focus tint off } test "every faithful port meets pardes's chrome floors in its own colours, with nothing left to derive" { - const first = comptime indexOfTheme("lapis") + 1; + const first = comptime indexOfTheme("dark_plus"); const last = comptime indexOfTheme("helix"); - for (legacy_themes[first..last]) |*th| { + for (themes[first..last]) |*ring_theme| { + const view = ChromeTheme.ofTheme(ring_theme).view; + const th = &view; const chrome = ChromeTheme.fromTheme(th); const page = th.bg.?; // Written out already adjusted: the run-time lift and push leave @@ -1972,11 +2049,8 @@ test "every faithful port meets pardes's chrome floors in its own colours, with } test "a derived separator or tint keeps the theme's own when it already stands off" { - const forge = &legacy_themes[ - for (legacy_themes[0..native_count], 0..) |t, i| { - if (std.mem.eql(u8, t.name, "forge")) break i; - } else unreachable - ]; + const view = ChromeTheme.ofTheme(&themes[comptime indexOfTheme("forge")]).view; + const forge = &view; const chrome = ChromeTheme.fromTheme(forge); try std.testing.expectEqual(forge.border.?, chrome.border); // forge's own tint is 1.23:1 off its tag: pushed on the way it leans. @@ -2006,22 +2080,34 @@ test "the picker's sections run in ring order and cover it" { if (n == 0) try std.testing.expectEqual(@as(usize, 0), at) else try std.testing.expect(at > last); last = at; } - try std.testing.expectEqualStrings("Pardes themes", groupAt(0).?); + try std.testing.expectEqualStrings("Pardes", groupAt(0).?); + try std.testing.expectEqualStrings("dark", themes[0].name); + try std.testing.expectEqualStrings("orchard", themes[default_theme].name); // acme is a current theme, not a legacy one. try std.testing.expect(indexOfTheme("acme") < indexOfTheme("helix")); - try std.testing.expect(groupAt(native_count) != null); + // The imported a family at a time, each under its heading, the lone + // ones last under one. + try std.testing.expect(std.mem.startsWith(u8, groupAt(native_count).?, "Imported: ")); + const gruvbox = for (themes, 0..) |t, i| { + if (std.mem.eql(u8, t.name, "gruvbox")) break i; + } else unreachable; + try std.testing.expectEqualStrings("Imported: gruvbox", groupAt(gruvbox).?); + try std.testing.expectEqual(null, groupAt(gruvbox + 1)); + const lone = for (themes[native_count..], native_count..) |_, i| { + if (groupAt(i)) |title| if (std.mem.eql(u8, title, "Imported, one of a kind")) break i; + } else unreachable; + 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, legacy_themes[first..][0..names.len]) |name, t| try std.testing.expectEqualStrings(name, t.name); - try std.testing.expectEqualStrings("catppuccin_mocha", legacy_themes[first - 1].name); - try std.testing.expectEqualStrings("zenbones_light", legacy_themes[first + names.len].name); + for (names, themes[first..][0..names.len]) |name, t| try std.testing.expectEqualStrings(name, t.name); + try std.testing.expectEqualStrings("catppuccin_mocha", themes[first - 1].name); + try std.testing.expectEqualStrings("zenbones_light", themes[first + names.len].name); } test "a theme hint drops whole names to fit, never cutting one" { @@ -2087,7 +2173,7 @@ test "ThemeFile parses ZON atomically and Theme returns to the compiled ring" { return error.MissingThemeFileRequest; try std.testing.expectEqualStrings("/tmp/pardes-config/themes/mine.zon", request.path); - var custom = themes[0]; + var custom = themes[default_theme]; custom.name = "mine"; custom.page = .{ 1, 2, 3 }; custom.tag = .{ 4, 5, 6 }; @@ -2107,8 +2193,8 @@ test "ThemeFile parses ZON atomically and Theme returns to the compiled ring" { try std.testing.expectEqualStrings("mine", p.theme().name); try std.testing.expectEqual(@as(?[3]u8, .{ 1, 2, 3 }), p.theme().bg); - setThemeIndex(p, 0); - try std.testing.expectEqualStrings(legacy_themes[0].name, p.theme().name); + setThemeIndex(p, default_theme); + try std.testing.expectEqualStrings(themes[default_theme].name, p.theme().name); try std.testing.expect(themeFileRequest(p, request_effect.generation) == null); const stop = while (p.nextEffect()) |effect| switch (effect) { .theme_file => |theme_file| break theme_file, @@ -2118,16 +2204,13 @@ test "ThemeFile parses ZON atomically and Theme returns to the compiled ring" { } test "native themes keep text and UI roles readable on their own surfaces" { - const names = [_][]const u8{ "orchard", "dusk", "ink", "paper", "daybreak", "atelier", "forge", "lagoon", "solarium", "spectrum", "harvest", "clay", "forge_black", "forge_soft", "orchard_black" }; - try std.testing.expectEqual(names.len, native_theme_count); - for (legacy_themes[0..names.len], names) |th, name| { - try std.testing.expectEqualStrings(name, th.name); + for (designed) |name| { + const th = ChromeTheme.ofTheme(&themes[themeIndex(name).?]).view; const chrome = ChromeTheme.fromTheme(&th); const minimum: f32 = if (std.mem.eql(u8, name, "ink") or std.mem.eql(u8, name, "daybreak")) 7 else 4.5; const text_colors = [_][3]u8{ - th.fg.?, th.kw, th.str, th.num, th.comment, - chrome.diagnostic_error, chrome.diagnostic_warning, chrome.diagnostic_info, chrome.diagnostic_hint, - }; + th.fg.?, th.kw, th.str, th.num, th.comment, + } ++ chrome.resolved.page.severity; for (text_colors) |fg| try std.testing.expect(contrast(fg, th.bg.?) >= minimum); // Gutters are orientation aids, not source text: stay visible without // competing with comments or pulling attention away from the body. @@ -2147,20 +2230,25 @@ test "native themes keep text and UI roles readable on their own surfaces" { try std.testing.expect(contrast(chrome.tag_active_bg, th.tag_bg) <= 1.6); try std.testing.expect(contrast(chrome.tag_active_fg, th.tag_fg) <= 1.6); try std.testing.expect(contrast(th.sel_fg, th.sel_bg) >= minimum); - try std.testing.expect(contrast(chrome.search_fg, chrome.search_bg) >= minimum); + try std.testing.expect(contrast(chrome.resolved.hit_current_text, chrome.resolved.hit_current) >= Chrome.text_floor); // ANSI black can intentionally match the page (for backgrounds). All // other ANSI foregrounds, including bright black, remain legible. for (th.palette.?[1..]) |fg| try std.testing.expect(contrast(fg, th.bg.?) >= minimum); } } +/// The natives written before the colour system (DESIGN.md B), each with a +/// name tint and a column grip of its own: what the tests of their own +/// values below hold (the ring test holds every theme to B4's floors). +const designed = [_][]const u8{ "orchard", "dusk", "ink", "paper", "daybreak", "atelier", "forge", "lagoon", "solarium", "spectrum", "harvest", "clay", "forge_black", "forge_soft", "orchard_black" }; + test "native filename tints change hue without changing perceived lightness" { - for (legacy_themes[0..native_theme_count]) |th| { - try std.testing.expect(th.tag_name_fg != null and th.tag_active_name_fg != null); - const chrome = ChromeTheme.fromTheme(&th); - const pairs = [2][2][3]u8{ - .{ chrome.tag_fg, chrome.tag_name_fg }, - .{ chrome.tag_active_fg, chrome.tag_active_name_fg }, + for (designed) |native| { + const th = &themes[themeIndex(native).?]; + // The theme's own tint at its tag ink's lightness (the focused one + // Chrome.of's, R13). + const pairs = [1][2][3]u8{ + .{ th.tag_text, th.tag_name.? }, }; for (pairs) |pair| { const base = toOklab(pair[0]); @@ -2180,7 +2268,8 @@ test "native filename tints change hue without changing perceived lightness" { } test "native dark palettes choose near-black or deliberately soft contrast" { - for (legacy_themes[0..native_theme_count]) |th| { + for (designed) |name| { + const th = ChromeTheme.ofTheme(&themes[themeIndex(name).?]).view; if (contrast(th.bg.?, .{ 0, 0, 0 }) > 10) continue; // light paper const soft = std.mem.eql(u8, th.name, "dusk") or std.mem.eql(u8, th.name, "lagoon") or std.mem.eql(u8, th.name, "solarium") or std.mem.eql(u8, th.name, "forge_soft"); @@ -2193,12 +2282,12 @@ test "native dark palettes choose near-black or deliberately soft contrast" { } } const forge = curated.forge.theme; - try std.testing.expectEqual(forge.bg[0], forge.bg[1]); + try std.testing.expectEqual(forge.page[0], forge.page[1]); // Forge chrome is cool-neutral, never the old green-over-blue mint cast. - for ([_][3]u8{ forge.tag_bg, forge.tag_active_bg, forge.box, forge.border }) |rgb| + for ([_][3]u8{ forge.tag, forge.tag_focus, forge.accent, forge.rule }) |rgb| try std.testing.expect(rgb[2] >= rgb[1]); - try std.testing.expectEqual([3]u8{ 0, 0, 0 }, @as([3]u8, curated.forge_black.theme.bg)); - try std.testing.expectEqual([3]u8{ 0, 0, 0 }, @as([3]u8, curated.orchard_black.theme.bg)); + try std.testing.expectEqual([3]u8{ 0, 0, 0 }, @as([3]u8, curated.forge_black.theme.page)); + try std.testing.expectEqual([3]u8{ 0, 0, 0 }, @as([3]u8, curated.orchard_black.theme.page)); } test "line numbers stay quiet without a current-line tag background" { @@ -2208,11 +2297,12 @@ test "line numbers stay quiet without a current-line tag background" { const pane = try p.setTestFile("first\nsecond\n"); pane.body.cur_pinned = true; pane.body.cur_row = 0; - var custom = legacy_themes[0]; + var custom = ChromeTheme.ofTheme(&themes[default_theme]).view; custom.name = try gpa.dupe(u8, "quiet-gutter"); custom.lineno = .{ 70, 70, 70 }; custom.lineno_active = .{ 95, 95, 95 }; p.custom_theme = custom; + finishThemeInitialization(p); p.sync(); const x = p.view().rects[0].x + config.GUTTER; const y = p.view().rects[0].y + BOX_H; @@ -2222,10 +2312,13 @@ test "line numbers stay quiet without a current-line tag background" { try std.testing.expectEqual(Color{ .rgb = custom.bg.? }, surface.at(x, y).style.bg); try std.testing.expect(surface.at(x, y).style.bold); try std.testing.expect(!surface.at(x, y + 1).style.bold); - // Old ThemeFile palettes need no new field, and do not regain the block. + // Old ThemeFile palettes need no new field: the current number is the + // text toward the page to 4.5:1 (R12), and the block not regained. p.custom_theme.?.lineno_active = null; + finishThemeInitialization(p); const fallback = try p.render(p.scratch.allocator()); - try std.testing.expectEqual(Color{ .rgb = .{ 70, 70, 70 } }, fallback.at(x, y).style.fg); + try std.testing.expectEqual(Color{ .rgb = p.chrome().line_number_current }, fallback.at(x, y).style.fg); + try std.testing.expect(contrast(p.chrome().line_number_current, custom.bg.?) >= Chrome.text_floor - 0.05); try std.testing.expectEqual(Color{ .rgb = custom.bg.? }, fallback.at(x, y).style.bg); try std.testing.expect(fallback.at(x, y).style.bold); // Moving the caret clears the previous cue; editing the tag parks it. @@ -2242,14 +2335,16 @@ test "legacy ThemeFile documents inherit Pardes UI roles without new fields" { @setEvalBranchQuota(10000); var encoded: std.Io.Writer.Allocating = .init(std.testing.allocator); defer encoded.deinit(); - try std.zon.stringify.serialize(curated.helix.theme, .{ .whitespace = false }, &encoded.writer); - // helix without the focused tag's pair it has since gained: a document - // written before those fields existed. + try std.zon.stringify.serialize(ChromeTheme.ofTheme(&themes[comptime indexOfTheme("helix")]).view, .{ .whitespace = false }, &encoded.writer); + // helix without the focused tag's pair it has since gained, and the + // names' and column grip's dim fills: a document written before those + // fields existed. var legacy: std.ArrayList(u8) = .empty; defer legacy.deinit(std.testing.allocator); var rest: []const u8 = encoded.written(); while (true) { - const at = @min(std.mem.indexOf(u8, rest, ".tag_active_bg") orelse rest.len, std.mem.indexOf(u8, rest, ".tag_active_fg") orelse rest.len); + var at = rest.len; + for ([_][]const u8{ ".tag_active_bg", ".tag_active_fg", ".tag_active_name_fg", ".column_box_dim" }) |field| at = @min(at, std.mem.indexOf(u8, rest, field) orelse rest.len); try legacy.appendSlice(std.testing.allocator, rest[0..at]); if (at == rest.len) break; rest = rest[at + std.mem.indexOfScalar(u8, rest[at..], '}').? + 1 ..]; @@ -2279,12 +2374,11 @@ test "legacy ThemeFile documents inherit Pardes UI roles without new fields" { } test "column grip colors remain distinct from pane grips across native themes" { - for (legacy_themes[0..native_theme_count]) |th| { - try std.testing.expect(th.column_box != null and th.column_box_dim != null); - const chrome = ChromeTheme.fromTheme(&th); + for (designed) |name| { + const th = &themes[themeIndex(name).?]; + // The theme's own (their rest and grabbed inks Chrome.of's, R6, H). for ([_][2][3]u8{ - .{ chrome.box, chrome.column_box }, - .{ chrome.box_dim, chrome.column_box_dim }, + .{ th.accent, th.column_grip.? }, }) |pair| { var distance: u32 = 0; for (pair[0], pair[1]) |a, b| { @@ -2294,7 +2388,7 @@ test "column grip colors remain distinct from pane grips across native themes" { try std.testing.expect(distance >= 30 * 30); } } - var custom = legacy_themes[0]; + var custom = ChromeTheme.ofTheme(&themes[default_theme]).view; custom.column_box = .{ 90, 130, 170 }; custom.column_box_dim = null; var chrome = ChromeTheme.fromTheme(&custom); @@ -2306,7 +2400,7 @@ test "column grip colors remain distinct from pane grips across native themes" { } test "custom filename tints preserve optional active fallback precedence" { - var theme = legacy_themes[0]; + var theme = ChromeTheme.ofTheme(&themes[default_theme]).view; theme.tag_name_fg = null; theme.tag_active_name_fg = null; var chrome = ChromeTheme.fromTheme(&theme); @@ -2328,14 +2422,18 @@ test "custom filename tints preserve optional active fallback precedence" { } test "every theme tints its names off the tag's ink, and they read on both grounds" { - for (&legacy_themes) |*th| { - const chrome = ChromeTheme.fromTheme(th); + for (&themes) |*th| { + const c = Chrome.of(th); const pairs = [2][3][3]u8{ - .{ chrome.tag_fg, chrome.tag_name_fg, chrome.tag_bg }, - .{ chrome.tag_active_fg, chrome.tag_active_name_fg, chrome.tag_active_bg }, + .{ c.tag[0].text, c.name[0], c.tag[0].ground }, + .{ c.tag[1].text, c.name[1], c.tag[1].ground }, }; for (pairs) |pair| { const ink, const name, const ground = pair; + // An ink held to the end of the gamut (white or black, H's 7:1 + // on a mid-grey tag: ao's, modus_vivendi's) has no hue at its + // lightness: the name is the ink. + if (std.mem.eql(u8, &name, &ink) and (std.mem.eql(u8, &ink, &@as([3]u8, @splat(255))) or std.mem.eql(u8, &ink, &@as([3]u8, @splat(0))))) continue; const apart = oklabDistance(toOklab(ink), toOklab(name)); const floor = nameTintFloor(ink, ground); if (apart < name_tint_distance or contrast(name, ground) < floor - 0.01) @@ -2363,12 +2461,13 @@ test "every theme's walk UI roles meet their floors on every ground they are dra var checks: std.ArrayList(Check) = .empty; defer checks.deinit(a); var failed: usize = 0; - for (&legacy_themes) |*th| { + for (&themes) |*ring_theme| { + const view = ChromeTheme.ofTheme(ring_theme).view; + const th = &view; checks.clearRetainingCapacity(); const chrome = ChromeTheme.fromTheme(th); const r = &chrome.roles; const page = th.bg orelse null_page; - const body_ink = th.fg orelse th.tag_fg; const tags = [_][3]u8{ r.tag[0].ground, r.tag[1].ground, r.tag[2].ground, r.selected[0].ground, r.selected[1].ground, r.selected[2].ground, r.selected[3].ground }; const messages = [_][3]u8{ r.tag[0].ground, r.tag[1].ground, r.tag[2].ground, page }; for (r.tag ++ r.selected ++ [1]RoleInks{r.notice}) |inks| { @@ -2395,15 +2494,6 @@ test "every theme's walk UI roles meet their floors on every ground they are dra try checks.append(a, .{ .what = "reading", .got = oklabDistance(toOklab(chrome.tag_reading_bg), toOklab(th.tag_bg)), .floor = Roles.reading_distance }); for ([_][3]u8{ th.tag_fg, th.tag_active_fg orelse th.tag_fg }) |ink| try checks.append(a, .{ .what = "text on reading", .got = contrast(ink, chrome.tag_reading_bg), .floor = @min(7, contrast(ink, th.tag_bg)) - 0.02 }); - const ink_floor = @min(Roles.ink_floor, contrast(body_ink, page)); - // A preview's landing line 1.5:1 off the page, its matched span (the - // current hit) a step stronger, 1.9:1 (UX E7 7b: 1.29 read as faint). - for ([_][3]u8{ r.hit, r.hit_current }, [_]f32{ 1.5, 1.9 }) |ground, floor| { - const on = contrast(body_ink, ground); - try checks.append(a, .{ .what = "hit", .got = contrast(ground, page), .floor = if (on < ink_floor + 0.3) 0 else floor }); - try checks.append(a, .{ .what = "ink on hit", .got = on, .floor = ink_floor - 0.01 }); - } - try checks.append(a, .{ .what = "current over hit", .got = contrast(r.hit_current, page) - contrast(r.hit, page), .floor = 0 }); for (checks.items) |c| if (c.got < c.floor - 0.005) { failed += 1; std.debug.print("{s}: {s} {d:.2} under {d:.2}\n", .{ th.name, c.what, c.got, c.floor }); @@ -2417,12 +2507,14 @@ test "neonotte84's and acme's inks on the plain tag, their reading mark and thei const wants = [_]Want{ // Text, dim, rule and key as D4 derived them; the match the hits' // amber held on this ground alone (D4's pushed neonotte84's number - // over all seven grounds at once: #f1a271); the reading mark sky + // over all seven grounds at once: #f1a271; L1's #e29e47 the warning + // pardes derived, its own palette's since B7, #e59d3c, the current + // hit's too); the reading mark sky // on the grip, 3:1 on both tags (D4 tinted the whole tag #29271e); // the hit an amber ground 1.5:1 off the page (D4's mixed the // number in: #47322e) and the current one that amber itself, solid // (D4's a 1.9:1 ground, #5f3f33). - .{ .name = "neonotte84", .text = .{ 0xb5, 0xbf, 0xe3 }, .dim = .{ 0x70, 0x76, 0x8f }, .rule = .{ 0x4c, 0x50, 0x63 }, .key = .{ 0xf8, 0xde, 0xd9 }, .match = .{ 0xe2, 0x9e, 0x47 }, .mode = .{ 0x2b, 0x92, 0xbc }, .hit = .{ 0x4c, 0x30, 0x1a }, .hit_current = .{ 0xe2, 0x9e, 0x47 } }, + .{ .name = "neonotte84", .text = .{ 0xb5, 0xbf, 0xe3 }, .dim = .{ 0x70, 0x76, 0x8f }, .rule = .{ 0x4c, 0x50, 0x63 }, .key = .{ 0xf8, 0xde, 0xd9 }, .match = .{ 0xe5, 0x9d, 0x3c }, .mode = .{ 0x2b, 0x92, 0xbc }, .hit = .{ 0x4c, 0x30, 0x1a }, .hit_current = .{ 0xe5, 0x9d, 0x3c } }, // acme's key and match on its plain tag alone, never held to its // #9eeeee selection and its reading ground at once (D4's #555583, // #8f4800): its #8888cc darkened to 4.5:1, its number as it is; the @@ -2515,7 +2607,7 @@ const RingCheck = enum { }; /// The checks `th`'s chrome fails. -fn ringFailures(th: *const Theme, c: *const Chrome) std.EnumSet(RingCheck) { +fn ringFailures(th: *const Theme, c: *const Chrome, designed_here: bool) std.EnumSet(RingCheck) { var f: std.EnumSet(RingCheck) = .empty; const de = struct { fn of(a: [3]u8, b: [3]u8) f32 { @@ -2602,7 +2694,15 @@ fn ringFailures(th: *const Theme, c: *const Chrome) std.EnumSet(RingCheck) { f.setPresent(.severities4, apart4 < Chrome.severity_apart); const err = lch(c.page.severity[0]); f.setPresent(.error_red, !(err[1] >= 0.08 and (err[2] <= 50 or err[2] >= 330))); - f.setPresent(.diff, @min(contrast(c.add.row, page), contrast(c.del.row, page)) < 1.1 or de(c.add.row, c.del.row) < 0.05); + // R10: each diff row 1.15:1 off the page, and the two 0.05 apart; a + // port's or an import's nearer where its own text holds it (never + // under its floor there: tokyonight_day's text, 4.9:1, leaves 1.11:1); + // pardes's own themes always (the coordinator's ruling). + const diff_floor = @min(4.5, text * 0.9); + for ([2][3]u8{ c.add.row, c.del.row }) |row| { + if (contrast(row, page) < Chrome.row_step - 0.005 and (designed_here or contrast(ink, row) > diff_floor + 0.05)) f.insert(.diff); + } + if (de(c.add.row, c.del.row) < 0.05) f.insert(.diff); var ansi_least: f32 = 21; for (c.ansi[1..], 1..) |a, i| { ansi_least = @min(ansi_least, contrast(a, page)); @@ -2620,54 +2720,30 @@ fn ringFailures(th: *const Theme, c: *const Chrome) std.EnumSet(RingCheck) { const t = contrast(g.text, g.ground); var low = (n > 0 and t < @min(4.5, reach(g.ground))) or contrast(g.dim, g.ground) < @min(3, t) - 0.01; for ([2][3]u8{ g.key, g.match } ++ g.severity) |i| low = low or contrast(i, g.ground) < @min(4.5, reach(g.ground)); + // The kind mark on the ground and on its selection, a list's + // cursor row: one ink for both, 4.5:1 where the keyword's hue + // reaches it there (held to the end of light, a hue keeps a trace + // of itself: #000100 on solarized_dark's grey tag reads 4.49). + const both = [2][3]u8{ g.ground, g.selection.ground }; + const most = leastContrast(hold(th.keyword, &both, 21), &both); + low = low or leastContrast(g.kind, &both) < @min(4.5, most) - 0.01; low = low or contrast(g.selection.text, g.selection.ground) < @min(4.5, reach(g.selection.ground)); if (low) f.insert(.inks); } 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 }{ - // L3 (core/themes): the overrides DESIGN.md E1 names. - .{ "acme", "L3: its own sixteen where pardes's picks read under 3:1 (ANSI 10, 14)" }, - .{ "solarized_dark", "L3: `hit` and `added`/`deleted` of its own" }, - .{ "solarized_light", "L3: `hit` of its own" }, - .{ "seoul256_light_254", "L3: `hit` of its own" }, - .{ "seoul256_light_255", "L3: `hit` of its own" }, - // L4 (tools/gen_themes.zig): B7's mapping, or an import's override. - .{ "everforest_light", "L4: `hit` of its own" }, - .{ "github_dark_dimmed", "L4: its text from helix's `variable`" }, - .{ "gruvbox_material_light_hard", "L4: `info`/`hint` from its own scopes" }, - .{ "gruvbox_material_light_medium", "L4: `info`/`hint` from its own scopes" }, - .{ "gruvbox_material_light_soft", "L4: `info`/`hint` from its own scopes" }, - .{ "hex_toxic", "L4: `hit` and `added`/`deleted` of its own" }, - // L5: dark's own sixteen (its derived ANSI 8 is 3:1, under the pro 4.5). - .{ "dark", "L5: its designed ANSI (DESIGN.md C)" }, - // 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" }, - // No line: the soft natives' text is 4.5-7:1 by design (the native - // test below), under the professional 7:1. C1's ruling. - .{ "dusk", "soft by design: text under the pro 7:1" }, - .{ "lagoon", "soft by design: text under the pro 7:1" }, - .{ "solarium", "soft by design: text under the pro 7:1" }, - .{ "forge_soft", "soft by design: text under the pro 7:1" }, -}; +/// 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). +const soft_themes = [_][]const u8{ "dusk", "lagoon", "solarium", "forge_soft" }; test "every theme in the ring meets every floor pardes owns (DESIGN.md B4), natives and dark the professional ones too; the original's own colours never moved" { - const lapis = comptime indexOfTheme("lapis"); - const dark = comptime indexOfTheme("dark"); + // pardes's own: every theme before the first faithful port (dark and + // the new ones among them), and the captured helix's originals. + 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. @@ -2676,58 +2752,110 @@ test "every theme in the ring meets every floor pardes owns (DESIGN.md B4), nati if (th.page) |own| try std.testing.expectEqual(own, c.page.ground); if (th.ansi) |own| try std.testing.expectEqual(own, c.ansi); if (th.line_number) |own| try std.testing.expectEqual(own, c.line_number); - const ours = i <= lapis or i == dark or i == helix; - const failures = ringFailures(th, &c); + const ours = i < ports or i == helix; + const soft = for (soft_themes) |name| { + if (std.mem.eql(u8, name, th.name)) break true; + } else false; + const failures = ringFailures(th, &c, i < ports); var held: std.EnumSet(RingCheck) = .empty; var it = failures.iterator(); while (it.next()) |check| { - if (check.pro() and !(i <= lapis or i == dark)) continue; + if (check.pro() and i >= ports) continue; + // A soft theme's text is held at AA, 4.5:1, never the pro 7:1. + if (soft and (check == .text7 or check == .tag_text7)) continue; 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\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 +/// indicators and grounds (B1.6, G4: only that colour, and its file says +/// so); its text, syntax, comments and sixteen never move (the ring test). +/// Each with the ground it is held on, for the words its file says. +fn portMoves(th: *const Theme, c: *const Chrome) [12]struct { role: []const u8, own: ?[3]u8, got: [3]u8, on: [3]u8 } { + const page = c.page.ground; + return .{ + .{ .role = "tag ground", .own = th.tag, .got = c.tag[0].ground, .on = page }, + .{ .role = "focused tag ground", .own = th.tag_focus, .got = c.tag[1].ground, .on = c.tag[0].ground }, + .{ .role = "focused grip", .own = th.accent, .got = c.grip.focus, .on = c.tag[1].ground }, + .{ .role = "grip ring", .own = th.grip_ring, .got = c.grip.ring, .on = c.tag[0].ground }, + .{ .role = "unsaved grip", .own = th.dirty, .got = c.grip.dirty, .on = c.tag[0].ground }, + .{ .role = "selection", .own = th.selection, .got = c.page.selection.ground, .on = page }, + .{ .role = "selection text", .own = th.selection_text, .got = c.page.selection.text, .on = c.page.selection.ground }, + .{ .role = "search hit", .own = th.hit, .got = c.hit, .on = page }, + .{ .role = "error", .own = th.@"error", .got = c.page.severity[0], .on = page }, + .{ .role = "warning", .own = th.warning, .got = c.page.severity[1], .on = page }, + .{ .role = "info", .own = th.info, .got = c.page.severity[2], .on = page }, + .{ .role = "hint", .own = th.hint, .got = c.page.severity[3], .on = page }, + }; +} + +test "every faithful port's file says each of its own colours pardes moves to meet a floor (DESIGN.md G4)" { + const first = comptime indexOfTheme("dark_plus"); + const last = comptime indexOfTheme("doom_one_light"); + var unsaid: usize = 0; + inline for (@typeInfo(curated).@"struct".decl_names[first .. last + 1], first..) |d, i| { + const file = comptime if (std.mem.startsWith(u8, d, "seoul256_")) "seoul256" else d; + const source = @embedFile("themes/" ++ file ++ ".zig"); + const c = Chrome.of(&themes[i]); + for (portMoves(&themes[i], &c)) |m| if (m.own) |own| if (!std.mem.eql(u8, &own, &m.got)) { + var buf: [64]u8 = undefined; + const said = try std.fmt.bufPrint(&buf, "{s} #{x:0>2}{x:0>2}{x:0>2} -> #{x:0>2}{x:0>2}{x:0>2}", .{ m.role, own[0], own[1], own[2], m.got[0], m.got[1], m.got[2] }); + if (std.mem.indexOf(u8, source, said) == null) { + unsaid += 1; + std.debug.print("unsaid\t{s}\t{s}\t{s}\t{d:.2}\t{d:.2}\n", .{ themes[i].name, file, said, contrast(own, m.on), contrast(m.got, m.on) }); + } + }; } - 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); + try std.testing.expectEqual(0, unsaid); } -test "the whole ring resolves in 150 ms of CPU, no theme in over 0.5 ms (Debug)" { - const io = std.testing.io; - var total: i96 = 0; - var worst: i96 = 0; +/// B9's budget, about 0.5 ms a theme and the ring in 150 ms on an idle +/// machine (Debug), in user-space instructions, which a loaded machine does +/// not move: Chrome.of retires about 7 a nanosecond here (the ring's 304 M +/// in 42 ms of an idle CPU, 2026-11-26). +const theme_instructions: u64 = 3_500_000; +const ring_instructions: u64 = 1_050_000_000; + +test "the whole ring resolves within B9's budget, about 0.5 ms a theme and 150 ms in all on an idle machine, counted in instructions (Debug)" { + if (builtin.os.tag != .linux) return error.SkipZigTest; + const linux = std.os.linux; + var attr: linux.perf_event_attr = .{ .type = .HARDWARE, .config = @intFromEnum(linux.PERF.COUNT.HW.INSTRUCTIONS), .flags = .{ .exclude_kernel = true, .exclude_hv = true } }; + const rc = linux.perf_event_open(&attr, 0, -1, -1, 0); + // No counter here (a container, perf_event_paranoid 3): nothing to count. + if (linux.errno(rc) != .SUCCESS) return error.SkipZigTest; + const fd: i32 = @intCast(rc); + defer _ = linux.close(fd); + var total: u64 = 0; + var worst: u64 = 0; var worst_at: usize = 0; for (&themes, 0..) |*th, i| { - // The least of five: a theme's own cost, not a page fault's. - var least: i96 = std.math.maxInt(i96); - for (0..5) |_| { - const start = std.Io.Clock.cpu_thread.now(io); - var c = Chrome.of(th); - std.mem.doNotOptimizeAway(&c); - least = @min(least, start.durationTo(std.Io.Clock.cpu_thread.now(io)).toNanoseconds()); - } - total += least; - if (least > worst) { - worst = least; + var before: u64 = 0; + var after: u64 = 0; + _ = linux.read(fd, std.mem.asBytes(&before), 8); + var c = Chrome.of(th); + std.mem.doNotOptimizeAway(&c); + _ = linux.read(fd, std.mem.asBytes(&after), 8); + total += after - before; + if (after - before > worst) { + worst = after - before; worst_at = i; } } - std.debug.print("ring resolved in {d} us, the slowest {s} in {d} us\n", .{ @divTrunc(total, 1000), themes[worst_at].name, @divTrunc(worst, 1000) }); - try std.testing.expect(total < 150 * std.time.ns_per_ms); - try std.testing.expect(worst <= std.time.ns_per_ms / 2); + std.debug.print("ring resolved in {d} instructions, the most {s}'s {d}\n", .{ total, themes[worst_at].name, worst }); + try std.testing.expect(total < ring_instructions); + try std.testing.expect(worst <= theme_instructions); } test "a theme file in the old names, a user's own or an older DumpThemes', and DumpThemes' now in the new names, load to the same Chrome" { @@ -2797,3 +2925,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/config.zig b/core/config.zig index 03cb6044..d500cdcb 100644 --- a/core/config.zig +++ b/core/config.zig @@ -239,8 +239,20 @@ pub const child_term = "xterm-256color"; pub const child_colorterm = "truecolor"; pub const child_term_program = "pardes"; -// Fonts is the window's word alone (the font picker), so a terminal build's -// row has no such builtin to name: the window's row and the terminal's. +/// The window row's words (UX K'2): at its right end, `Restore <dump>` +/// after them once a dump exists (tagline.headerWords). The rest of the +/// words that left it run from `:`, their keys and typed (K'4). +pub const window_words_str = "Find Grep Newcol Help Exit"; +/// A column's words: at the window row's left while there is one column, +/// in its column tag with several, where Joincol and Delcol have a +/// column to act on. +pub const column_words_str = "New Term"; +pub const columns_words_str = "New Term Joincol Delcol"; + +// The window's tag before UX K', its own text then: a dump's own text equal +// to one is dropped (dump.dropOldTags), and /tagexec still takes their words +// (ninep/cols.zig paneWord). Fonts is the window's word alone (the font +// picker), so a terminal build's row has no such builtin to name. pub const topbar_window_str = "Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Fonts Config History Debug Exit"; pub const topbar_terminal_str = "Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config History Debug Exit"; pub const topbar_str = if (@import("builtins.zig").capabilities.font_picker) topbar_window_str else topbar_terminal_str; @@ -614,7 +626,7 @@ pub const kill_to_line_start: []const Chord = &.{.{ .cp = 'u', .ctrl = true }}; pub const kill_to_line_end: []const Chord = &.{.{ .cp = 'k', .ctrl = true }}; pub const Settings = struct { - theme: usize = 0, + theme: usize = pardes.colors.default_theme, wrap: bool = true, debug: bool = false, /// The workspace tag row. Native shells with their own chrome (the macOS @@ -1564,13 +1576,16 @@ const doc_typ = struct { if (w.end > 0) w.writeByte(' ') catch return false; w.writeAll(x[0 .. std.mem.indexOfScalar(u8, x, '+') orelse x.len]) catch return false; } - // Both rows: the docs and the tutor show the window's and the terminal's. - const tags = [_][]const u8{ topbar_window_str, topbar_terminal_str, @import("tagline.zig").column_tag_default, pane_builtins_str, file_pane_builtins_str, diff_pane_builtins_str, pager_pane_builtins_str, pager_diff_pane_builtins_str, diff_view_builtins_str, terminal_pane_builtins_str, command_pane_builtins_str, dir_pane_builtins_str }; + // The window row's and the column tags' words (UX K'2), and K'3's + // computed words of a pane at rest: a file reading, held, edited, + // a +New typed into, a running command, a directory, a pager, a + // terminal with its shell's word. + const tags = [_][]const u8{ window_words_str, column_words_str, columns_words_str, "Keep Del", "Del", "Save Undo Del", "Undo Del", "Kill Del", "Get Del", "Filter Del", "Del Term" }; for (tags) |d| if (std.mem.eql(u8, d, w.buffered())) return true; - // A kind's pane's: Term, its addon's words, Collapse Del (Kind.zig). + // A kind's pane's: its addon's words, then Del (Kind.zig). const shown = w.buffered(); - if (!std.mem.startsWith(u8, shown, "Term ") or !std.mem.endsWith(u8, shown, " Collapse Del")) return false; - var mid = std.mem.tokenizeScalar(u8, shown["Term ".len .. shown.len - " Collapse Del".len], ' '); + if (!std.mem.endsWith(u8, shown, " Del")) return false; + var mid = std.mem.tokenizeScalar(u8, shown[0 .. shown.len - " Del".len], ' '); while (mid.next()) |x| { if (!addonWord(x)) return false; } diff --git a/core/draw.zig b/core/draw.zig index 4d47f895..42396aa1 100644 --- a/core/draw.zig +++ b/core/draw.zig @@ -152,6 +152,12 @@ pub fn place(p: *Pardes, s: *Surface) void { } } const column_rows = layout.columnBarHeight(p); + // A lone column's tag at the window row's left (UX K'2): no grip, a + // column's edge has nothing to be dragged against. + if (layout.columnInWindowRow(p)) { + const inset = @min(TAG_TEXT_INSET, v.screen_w); + s.addRegion(.{ .kind = .column_tag, .owner = 0, .serial = v.cols[0].serial, .active = layout.findPane(p, v.active) != null, .rect = .{ .x = inset, .y = 0, .w = tagline.windowRow(p).column, .h = p.topBarHeight() } }); + } if (column_rows > 0) for (0..p.view().ncol) |c| { if (v.col_w[c] == 0) continue; const active = if (layout.findPane(p, v.active)) |found| found.col == c else false; @@ -330,11 +336,14 @@ pub fn render(p: *Pardes, arena: std.mem.Allocator) !*Surface { s.placements.clearRetainingCapacity(); @memset(&s.gpu_frames, null); const chrome = p.chromeTheme(); + // The window's rules and grips from the chrome (the themes programme's + // L2e; DESIGN.md R6, R11, G1'). + const resolved = p.chrome(); s.chrome = .{ .page = p.theme().bg, .fg = p.theme().fg, - .border = chrome.border, - .topbar_rule = config.gui_topbar_pane_border_rgb orelse chrome.border, + .border = resolved.rule, + .topbar_rule = config.gui_topbar_pane_border_rgb orelse resolved.rule, .tag_bg = chrome.tag_bg, .tagline_bg = chrome.tagline_bg, .tag_focus_bg = chrome.tag_active_bg, @@ -344,12 +353,14 @@ pub fn render(p: *Pardes, arena: std.mem.Allocator) !*Surface { .scroll_thumb = chrome.scroll_thumb, .match_tick = chrome.search_bg, .match_current = p.theme().fg orelse chrome.tag_fg, - .rule_px = p.theme().rule_px orelse 2, - .grip_border = boxBorder(p), - .grip_focus_ring = chrome.box, - .grip_dirty = boxDirty(p), - .tag_rule = p.theme().tag_rule, - .rail_px = @intCast(@min(255, @as(u32, p.theme().rail_px orelse 12) * p.settings.grip_width / 100)), + .rule_px = resolved.rule_px, + .grip_border = resolved.grip.ring, + .grip_focus_ring = resolved.grip.focus, + .grip_dirty = resolved.grip.dirty, + .grip_mode = resolved.grip.mode, + .grip_ink = resolved.grip.ink, + .tag_rule = resolved.tag_rule, + .rail_px = @intCast(@min(255, @as(u32, resolved.rail_px) * p.settings.grip_width / 100)), }; place(p, s); // Separators have their own role; a scrollbar need not frame the page. @@ -590,25 +601,31 @@ fn paintHeaders(p: *Pardes, s: *Surface) !void { if (s.region(.workspace_tag, Region.none)) |region| { const top = if (v.header != null and p.headerColumn() == null) v.header_top else 0; const layer = &s.tag_layers[MAX_PANES + MAX_COLS]; - var viewport = region.rect; - s.chrome.tagline_rows = @intCast(viewport.y + viewport.h); - const inset = @min(TAG_TEXT_INSET, viewport.w); - s.fill(viewport.x, viewport.y, inset, viewport.h, .{ .bg = .{ .rgb = chrome.tagline_bg }, .fg = .{ .rgb = chrome.tagline_fg }, .font_role = .tagline }); - viewport.x += inset; - viewport.w -= inset; - try renderHeaderLayer(p, layer, .workspace, 0, viewport, tagline.topbar(p), top, chrome.tagline_bg, chrome.tagline_fg); + s.chrome.tagline_rows = @intCast(region.rect.y + region.rect.h); + // The window row (UX K'2), on the tagline's ground end to end: a + // lone column's tag at its left (its region), in the row's inks; + // the window's at its right end (tagline.windowRow). + s.fill(region.rect.x, region.rect.y, region.rect.w, region.rect.h, .{ .bg = .{ .rgb = chrome.tagline_bg }, .fg = .{ .rgb = chrome.tagline_fg }, .font_role = .tagline }); + if (s.region(.column_tag, 0)) |column| if (column.rect.y < region.rect.y + region.rect.h) { + const column_top = if (v.header != null and p.headerColumn() == 0) v.header_top else 0; + const column_layer = &s.tag_layers[MAX_PANES]; + try renderHeaderLayer(p, column_layer, .column, 0, column.rect, tagline.columnTag(p, 0), column_top, chrome.tagline_bg, chrome.tagline_fg); + joinHeaderRows(s, column_layer, chrome.tagline_fg); + }; + const words = tagline.windowRow(p).words; + const viewport: Rect = .{ .x = words, .y = region.rect.y, .w = region.rect.w -| words, .h = region.rect.h }; + const text = tagline.topbar(p); + try renderHeaderLayer(p, layer, .workspace, 0, viewport, text, top, chrome.tagline_bg, chrome.tagline_fg); // A server's progress (a message of no pane) at its first row's // right end, where the row has room for it. - if (layer.rows > 0 and top == 0) for (p.messages.live[0..p.messages.live_len]) |*said| { - if (said.kind != .progress or said.pane != 0) continue; + if (layer.rows > 0 and top == 0) if (tagline.sessionProgress(p)) |said| { var buf: [Messages.LoggedMessage.cap + 8]u8 = undefined; - const text = std.fmt.bufPrint(&buf, "{s} {s}", .{ Messages.Kind.progress.glyph(), said.words() }) catch break; - const width = panes.File.displayWidth(p.settings.tab, text); - const used = panes.File.displayWidth(p.settings.tab, modal.lineSlice(tagline.topbar(p), 0)); + const shown = std.fmt.bufPrint(&buf, "{s} {s}", .{ Messages.Kind.progress.glyph(), said.words() }) catch ""; + const width = panes.File.displayWidth(p.settings.tab, shown); + const used = panes.File.displayWidth(p.settings.tab, modal.lineSlice(text, 0)); const room = layout.tagCapacity(p, viewport.w); var row: Surface = .{ .cols = layer.cols, .rows = 1, .cells = layer.cells[0..layer.cols], .tab = p.settings.tab }; - if (used + 2 + width < room) _ = row.print(@intCast(room - 1 - width), 0, @intCast(width), text, .{ .fg = .{ .rgb = Messages.ink(chrome, .progress) }, .bg = .{ .rgb = chrome.tagline_bg }, .font_role = .tagline }); - break; + if (used + 2 + width < room) _ = row.print(@intCast(room - 1 - width), 0, @intCast(width), shown, .{ .fg = .{ .rgb = Messages.ink(chrome, .progress) }, .bg = .{ .rgb = chrome.tagline_bg }, .font_role = .tagline }); }; joinHeaderRows(s, layer, chrome.tagline_fg); } @@ -844,8 +861,8 @@ fn renderHeaderLayer(p: *Pardes, layer: *pardes.Layer, kind: TagKind, id: u16, v var col = panes.File.rawDisplayCol(p.settings.tab, shown, @max(swept.lo, start) - start) -| scroll; const stop = panes.File.rawDisplayCol(p.settings.tab, shown, @min(swept.hi, end) - start) -| scroll; while (col < stop and col < columns) : (col += 1) { - surface.at(@intCast(col), 0).style.bg = .{ .rgb = body_layer.buttonTints(p.theme())[button] }; - surface.at(@intCast(col), 0).style.fg = .{ .rgb = body_layer.buttonInks(p.theme())[button] }; + surface.at(@intCast(col), 0).style.bg = .{ .rgb = p.chrome().sweeps[button].ground }; + surface.at(@intCast(col), 0).style.fg = .{ .rgb = p.chrome().sweeps[button].text }; } } } else |_| {}; @@ -928,6 +945,9 @@ fn joinBand(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: R const ground = groundOf(p, pane, active); const inks = chrome.roles.on(ground); const selected = chrome.roles.selectedOn(ground); + // A symbol's kind mark (colors.Chrome.Inks.kind): held on this tag's + // ground and on its cursor row's selection. + const kind = p.chrome().on(if (active) .focus else .plain).kind; const bg = inks.ground; const fg = inks.text; const storage = try arena.alloc(Cell, @as(usize, columns) * rows); @@ -972,6 +992,7 @@ fn joinBand(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: R if (b < part.row.chord) style.fg = .{ .rgb = chrome.roles.key }; if (b < part.row.pre) style.fg = .{ .rgb = if (active) chrome.tag_active_name_fg else chrome.tag_name_fg }; if (part.row.dim or (b >= part.row.pre and b < part.row.pre + part.row.faint) or (b >= part.row.quiet[0] and b < part.row.quiet[1])) style.fg = .{ .rgb = on.dim }; + if (b < part.row.kind) style.fg = .{ .rgb = kind }; for (part.row.keys) |k| if (k == b) { style.fg = .{ .rgb = chrome.roles.key }; style.bold = true; @@ -1223,12 +1244,11 @@ fn paintPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, body_layer.paintPointerSelection(p, s, pane, r, sel, 0, preview_bg, null); }; } - const sel_btn = body_layer.buttonTints(th); - const sel_ink = body_layer.buttonInks(th); + const sweeps = &p.chrome().sweeps; for (pane.sel, 0..) |selection, button| { if (selection.state == .none or (selection.state == .done and button != 0)) continue; if (button == pardes.sel_slot or @min(selection.r0, selection.r1) >= rows) continue; - body_layer.paintPointerSelection(p, s, pane, r, selection, 0, sel_btn[button], sel_ink[button]); + body_layer.paintPointerSelection(p, s, pane, r, selection, 0, sweeps[button].ground, sweeps[button].text); } } diff --git a/core/dump.zig b/core/dump.zig index d7c44b71..0cefa157 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; @@ -639,6 +635,7 @@ fn loadAndRevive(gpa: std.mem.Allocator, opts: Options, bytes: []const u8, previ var on_disk: OnDisk = @splat(false); const p = try loadKnowing(gpa, opts, bytes, ¬es, &on_disk); errdefer p.deinit(); + dropOldTags(p); // The 9P state its requests made was its connections', which do not // come with it (a client's join loads alone, and keeps it). p.fs.forget(gpa); @@ -661,6 +658,36 @@ fn loadAndRevive(gpa: std.mem.Allocator, opts: Options, bytes: []const u8, previ return p; } +/// A build before UX K' kept a tag's command words as its own text: one a +/// dump restores equal to what its kind's tag said then (tagline.kindTail) +/// is dropped, its words computed now (K'1); any other is the user's text, +/// kept as it is. Here, where a Restore, a start from a dump and an +/// Upgrade load (a replica's join loads its authority's, dropped there). +/// The window's and the columns' tags the same (UX K'2): the window row of +/// either build, with its `Restore <path>` or without, and the column tag +/// it had. +fn dropOldTags(p: *Pardes) void { + for (p.panes) |slot| if (slot) |pane| if (pane.tag.own) |own| { + if (std.mem.eql(u8, own, pardes.tagline.kindTail(pane))) dropOwn(p, &pane.tag); + }; + const window: []const u8 = p.global_tag.own orelse ""; + for ([_][]const u8{ pardes.config.topbar_window_str, pardes.config.topbar_terminal_str }) |old| { + if (!std.mem.startsWith(u8, window, old)) continue; + if (window.len != old.len and !std.mem.startsWith(u8, window[old.len..], " Restore ")) continue; + dropOwn(p, &p.global_tag); + break; + } + for (&p.views) |*slot| if (slot.*) |*v| for (v.col_tags[0..v.ncol]) |*t| { + if (t.own) |own| if (std.mem.eql(u8, own, pardes.tagline.column_tag_default)) dropOwn(p, t); + }; +} + +fn dropOwn(p: *Pardes, t: *pardes.panes.Text) void { + p.gpa.free(t.own.?); + t.own = null; + t.cur_pinned = false; +} + /// A loaded core given to this host (with `revivePane` for each of its /// panes): the store and Recent read (a Restore's carried from the session /// it replaces, with its state file) and its ThemeFile asked for again. An @@ -1381,7 +1408,7 @@ test "restored syntax context caches are rebuilt from the text rather than loade const f = &pane.file.?; const declarations = try p.tree_sitter_gpa.alloc(pardes.syntax.ContextDeclaration, 1); @memset(std.mem.sliceAsBytes(declarations), 0); - f.context.replace(p.tree_sitter_gpa, declarations, f.revision); + f.context.replace(p.tree_sitter_gpa, .{ .declarations = declarations }, f.revision); // Older builds persisted these two fields; the schema reader must skip them too. const OldFile = struct { path: []const u8, @@ -1407,13 +1434,14 @@ test "restored syntax context caches are rebuilt from the text rather than loade defer gpa.free(bytes); const q = try load(gpa, opts, bytes, null); defer q.deinit(); - // This build's: the revision kept, the declarations parsed again from - // the text, with the syntax allocator. - const want = try pardes.syntax.contextDeclarations(syntax_gpa.allocator(), f.path, f.content); - defer syntax_gpa.allocator().free(want); + // This build's: the revision kept, the declarations and the symbols + // parsed again from the text, with the syntax allocator. + var want = try pardes.syntax.context(syntax_gpa.allocator(), f.path, f.content); + defer want.deinit(syntax_gpa.allocator()); for (q.panes) |slot| if (slot) |restored| if (restored.file) |file| { try std.testing.expectEqual(f.context.revision, file.context.revision); - try std.testing.expectEqualSlices(pardes.syntax.ContextDeclaration, want, file.context.declarations); + try std.testing.expectEqualSlices(pardes.syntax.ContextDeclaration, want.declarations, file.context.declarations); + try std.testing.expectEqualSlices(pardes.syntax.Symbol, want.symbols, file.context.symbols); }; } diff --git a/core/edit.zig b/core/edit.zig index e68f8d38..12cd7706 100644 --- a/core/edit.zig +++ b/core/edit.zig @@ -540,7 +540,8 @@ pub fn flatSurface(e: Editor, t: *Text) Error![]const u8 { // the tag as it is shown: the keyboard reaches its prefix too .tag => return if (t.pane()) |pane| try tagline.tagText(e.p, e.scratch, pane) else "", .input => return t.own orelse "", - .column, .workspace => return t.own orelse if (comptime Editor.lib) "" else tagline.headerDefault(e.p, t.what), + // a header as it is shown: its computed words, then its own text + .column, .workspace => return if (comptime Editor.lib) t.own orelse "" else try tagline.headerText(e.p, t), } const pane = t.pane() orelse return ""; if (pane.file) |f| return f.content; @@ -576,14 +577,13 @@ pub fn paneWrapWidth(e: Editor, t: *Text) usize { /// Route shared edit operations to the characters `t` edits: its own, or /// for a body its file's content or its terminal's overlay. fn editText(e: Editor, t: *Text, lo: i32, hi: i32, col: i32) Error!?panes.EditText { - // A tag or header nobody has changed shows its default; the first edit - // makes that default its own text. + // A tag or a header is edited as it is shown, its computed words and + // all; what an edit leaves after them is its own text (setEditTextSpan). if (t.what == .tag) { const pane = t.pane() orelse return null; return .{ .text = try tagline.tagText(e.p, e.scratch, pane), .row0 = 0 }; } - if (t.what != .body and t.what != .input and t.own == null) - t.own = try e.gpa.dupe(u8, try flatSurface(e, t)); + if (comptime !Editor.lib) if (t.what == .column or t.what == .workspace) return .{ .text = try tagline.headerText(e.p, t), .row0 = 0 }; if (t.what != .body or comptime Editor.lib) return .{ .text = t.own orelse &.{}, .row0 = 0 }; const pane = t.pane() orelse return null; if (pane.file) |f| return .{ .text = f.content, .row0 = 0 }; @@ -682,9 +682,10 @@ pub fn setEditTextEnd(e: Editor, t: *Text, new: []u8, known_end: ?modal.Cursor) fn setEditTextSpan(e: Editor, t: *Text, new: []u8, known_end: ?modal.Cursor, span: ?panes.File.Span) Error!void { if (t.what == .tag) { // A tag is edited as it is shown, but only what follows its - // prefix is its own: an edit that changed the prefix is refused. - // The shown text stays alive until the next such edit, since every - // caller reads the new text back, as a body's is kept. + // prefix (its path and computed words, UX K'1) is its own: an edit + // that changed the prefix is refused. The shown text stays alive + // until the next such edit, since every caller reads the new text + // back, as a body's is kept. defer retireEditText(e, new); const pane = t.pane() orelse return; // Out of rest the tag shows its head, which is no one's to edit. @@ -692,7 +693,7 @@ fn setEditTextSpan(e: Editor, t: *Text, new: []u8, known_end: ?modal.Cursor, spa t.refused = true; return; } - const prefix = try tagline.pathPrefix(e.p, e.scratch, pane); + const prefix = try tagline.restPrefix(e.p, e.scratch, pane); if (!std.mem.startsWith(u8, new, prefix)) { t.refused = true; return; @@ -702,6 +703,20 @@ fn setEditTextSpan(e: Editor, t: *Text, new: []u8, known_end: ?modal.Cursor, spa t.own = tail; return; } + if (comptime !Editor.lib) if (t.what == .column or t.what == .workspace) { + // A header's computed words (UX K'2) are no one's to edit, as a + // tag's prefix is not. + defer retireEditText(e, new); + const words = tagline.headerWords(e.p, t.what); + if (!std.mem.startsWith(u8, new, words) or new.len == words.len or new[words.len] != ' ') { + t.refused = true; + return; + } + const tail = try e.gpa.dupe(u8, new[words.len + 1 ..]); + if (t.own) |old| e.gpa.free(old); + t.own = tail; + return; + }; if (t.what != .body) { if (t.own) |old| e.gpa.free(old); t.own = new; 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/jj.zig b/core/jj.zig index bc2cea32..618f363e 100644 --- a/core/jj.zig +++ b/core/jj.zig @@ -1942,9 +1942,9 @@ fn ghostLanes(ch: *const Changes, ghosts: []const Ghost, gi: usize, first_row: b /// a changed line's old text grey, the words that went red; a /// description's id and title in its lane's colour `lane`, or with one /// change pinned (no one colour a lane) its id in the theme's keyword ink, -/// its author and age grey. +/// its author and age grey. All of them the chrome's (Chrome.add, .del). fn inkGhost(p: *Pardes, s: *pardes.Surface, pane: *const Pane, g: Ghost, row: i32, from: usize, to: usize, pad: i32, marks: []const [2]u32, lane: ?[3]u8, x: u16, y: u16, w: u16) void { - const th = p.theme(); + const chrome = p.chrome(); const tab = p.settings.tab; const said = File.sourceLine(pane, row); const Ink = struct { @@ -1975,13 +1975,13 @@ fn inkGhost(p: *Pardes, s: *pardes.Surface, pane: *const Pane, g: Ghost, row: i3 const ink: Ink = .{ .q = p, .s = s, .pane = pane, .row = row, .from = from, .to = to, .pad = pad, .x = x, .y = y, .w = w }; _ = tab; switch (g.kind) { - .deleted => s.tint(x, y, w, pardes.colors.Grounds.of(th).del.row, th.lineno), - .added => s.tint(x, y, w, pardes.colors.Grounds.of(th).add.row, null), + .deleted => s.tint(x, y, w, chrome.del.row, chrome.line_number), + .added => s.tint(x, y, w, chrome.add.row, null), .changed => { - ink.fg(0, said.len, th.lineno); + ink.fg(0, said.len, chrome.line_number); for (marks[g.marks..][0..g.nmarks]) |m| { const c = ink.cells(m[0], m[1]); - if (c[0] < c[1]) s.tint(x + c[0], y, c[1] - c[0], pardes.colors.Grounds.of(th).del.emph, null); + if (c[0] < c[1]) s.tint(x + c[0], y, c[1] - c[0], chrome.del.emph, null); } }, .description => { @@ -1989,8 +1989,8 @@ fn inkGhost(p: *Pardes, s: *pardes.Surface, pane: *const Pane, g: Ghost, row: i3 // title) in the lane's colour, the author and the age grey. const id_end = std.mem.indexOfScalar(u8, said, ' ') orelse said.len; const author = @min(g.author, said.len); - ink.fg(0, if (lane != null) author else id_end, lane orelse th.kw); - ink.fg(author, said.len, th.lineno); + ink.fg(0, if (lane != null) author else id_end, lane orelse chrome.syntax[@intFromEnum(syntax.Syn.keyword)]); + ink.fg(author, said.len, chrome.line_number); }, } } @@ -2010,7 +2010,7 @@ fn inkCame(p: *Pardes, s: *pardes.Surface, pane: *Pane, marks: []const [2]u32, r if (lo >= hi) continue; const from = here.pad + File.displayOffset(tab, pane, row, @intCast(first), @intCast(lo)); const to = @min(@as(i32, w), here.pad + File.displayOffset(tab, pane, row, @intCast(first), @intCast(hi))); - if (from >= 0 and from < to) s.tint(x + @as(u16, @intCast(from)), y, @intCast(to - from), pardes.colors.Grounds.of(p.theme()).add.emph, null); + if (from >= 0 and from < to) s.tint(x + @as(u16, @intCast(from)), y, @intCast(to - from), p.chrome().add.emph, null); } } @@ -2245,82 +2245,6 @@ fn nest(lines: []Line, npins: usize) void { } } -/// A diff's two inks (one change pinned, `paintLanes`): its lane's colour -/// says the kind of the row it stands beside (the user's rulings of -/// 2026-11-23), `added` beside a row it wrote (a line added whole, a changed -/// line's new text), `taken` beside a row it took away (a line taken away, a -/// changed line's old text). -pub const Inks = struct { added: [3]u8, taken: [3]u8 }; - -/// The diff's own two colours: the theme's green and its red (the grounds' -/// and the changed words' hues), each pushed toward the ink until it reads -/// 3:1 on the page (or nearly as the ink does, where the ink reads less). -pub fn laneInks(th: *const pardes.LegacyTheme) Inks { - var inks: [2][3]u8 = .{ if (th.palette) |c| c[2] else .{ 0x2e, 0xa0, 0x43 }, themeRed(th) }; - const page = th.bg orelse th.tag_bg; - for (&inks) |*ink| { - var step: usize = 0; - while (step < 8 and pardes.colors.contrast(ink.*, page) < 3) : (step += 1) ink.* = pardes.colors.mixOklab(ink.*, th.fg orelse th.tag_fg, 0.4); - } - return .{ .added = inks[0], .taken = inks[1] }; -} - -/// The lanes' colours, a pin's the `pin % len`th, oldest first: the -/// theme's accents but the two that mean written and taken away (its green -/// and red), in hue order from the top, each a hue `hue_apart` or more from -/// the one kept before it (doom one: magenta, blue, yellow; cyan and -/// orange go). Distinct colours, never one between two. -pub fn laneColours(th: *const pardes.LegacyTheme, buf: *[8][3]u8) []const [3]u8 { - const pal = th.palette; - const grounds = [2][3]u8{ themeRed(th), if (pal) |c| c[2] else .{ 0x2e, 0xa0, 0x43 } }; - const accents: [6][3]u8 = if (pal) |c| .{ c[3], c[4], c[5], c[6], th.num, th.kw } else .{ th.kw, th.num, th.str, th.box, th.column_box orelse th.box, th.comment }; - var sorted: [6][3]u8 = undefined; - var n: usize = 0; - for (accents) |c| { - // A grey is no accent; one near written or taken away means that. - if (chroma(c) < 48 or hueApart(c, grounds[0]) < hue_apart or hueApart(c, grounds[1]) < hue_apart) continue; - sorted[n] = c; - n += 1; - } - std.sort.insertion([3]u8, sorted[0..n], {}, struct { - fn above(_: void, a: [3]u8, b: [3]u8) bool { - return hue(a) > hue(b); - } - }.above); - var kept: usize = 0; - for (sorted[0..n]) |c| { - if (kept > 0 and hueApart(c, buf[kept - 1]) < hue_apart) continue; - buf[kept] = c; - kept += 1; - } - return buf[0..kept]; -} - -/// Two hues closer than this are one colour to a lane (doom one's cyan is -/// 12 degrees from its blue, its orange 11 from its yellow). -const hue_apart = 15; - -fn chroma(c: [3]u8) u8 { - return @max(c[0], c[1], c[2]) - @min(c[0], c[1], c[2]); -} - -/// HSV's hue, in degrees. -fn hue(c: [3]u8) f32 { - const r: f32 = @floatFromInt(c[0]); - const g: f32 = @floatFromInt(c[1]); - const b: f32 = @floatFromInt(c[2]); - const hi = @max(r, g, b); - const d = hi - @min(r, g, b); - if (d == 0) return 0; - const h = if (hi == r) @mod((g - b) / d, 6) else if (hi == g) (b - r) / d + 2 else (r - g) / d + 4; - return 60 * h; -} - -fn hueApart(a: [3]u8, b: [3]u8) f32 { - const d = @abs(hue(a) - hue(b)); - return @min(d, 360 - d); -} - /// The pane's pinned changes as a view shows them, on its body's rows (body_layer.zig, while /// File.Layers.lanes is set): in the gutter's lane cells after the number a /// lane each pin whose block runs down the row, at its level, a glyph in a @@ -2333,18 +2257,13 @@ pub fn paint(p: *Pardes, s: *pardes.Surface, pane: *Pane, r: pardes.Rect, tx: u1 if (pane.layers.lanes > 0) paintLanes(p, s, pane, r, tx, tw, body_h); } -/// The theme's red: what a change took away; churn's top. -pub fn themeRed(th: *const pardes.LegacyTheme) [3]u8 { - return if (th.palette) |c| c[1] else .{ 0xcf, 0x22, 0x2e }; -} - -/// A count's colour on churn's gradient: smooth from the line numbers' -/// grey to the theme's red, on a log scale of the count against the -/// hottest; null for none. -fn heatColour(th: *const pardes.LegacyTheme, count: u16, hottest: u16) ?[3]u8 { +/// A count's colour on churn's eight steps from the line numbers' grey to +/// the deleted hue (Chrome.heat, worked out with the theme), on a log scale +/// of the count against the hottest; null for none. +fn heatColour(c: *const pardes.colors.Chrome, count: u16, hottest: u16) ?[3]u8 { if (count == 0 or hottest == 0) return null; const t = @log(@as(f32, @floatFromInt(count)) + 1) / @log(@as(f32, @floatFromInt(hottest)) + 1); - return pardes.colors.mixOklab(th.lineno, themeRed(th), t); + return c.heat[@min(c.heat.len, @as(usize, @intFromFloat(@ceil(t * c.heat.len)))) -| 1]; } /// The heat lane: a cell after the line number (before the changes' @@ -2362,7 +2281,7 @@ fn paintHeat(p: *Pardes, s: *pardes.Surface, pane: *Pane, r: pardes.Rect, tx: u1 if (row < 0 or File.readOnlyRow(f, @intCast(row)) != null) continue; const line = File.fileRow(f, @intCast(row)); if (line >= heat.lines.len) continue; - const rgb = heatColour(p.theme(), heat.lines[line], heat.hottest) orelse continue; + const rgb = heatColour(p.chrome(), heat.lines[line], heat.hottest) orelse continue; var style = s.at(x, body_y + vr).style; style.fg = .{ .rgb = rgb }; s.set(x, body_y + vr, "\u{258c}", style); @@ -2380,7 +2299,7 @@ pub fn railHeat(p: *Pardes, s: *pardes.Surface, pane: *Pane, id: usize, rail: pa for (0..rail.h) |row| { const lo = row * total / rail.h; const hi = @max(lo + 1, (row + 1) * total / rail.h); - const rgb = heatColour(p.theme(), std.mem.max(u16, heat.lines[lo..@min(hi, total)]), heat.hottest) orelse continue; + const rgb = heatColour(p.chrome(), std.mem.max(u16, heat.lines[lo..@min(hi, total)]), heat.hottest) orelse continue; if (p.view().frontend.windowed) s.heat.append(p.gpa, .{ .owner = @intCast(id), .row = @intCast(row), .rgb = rgb }) catch {} else @@ -2393,18 +2312,18 @@ fn paintLanes(p: *Pardes, s: *pardes.Surface, pane: *Pane, r: pardes.Rect, tx: u const ch = answered(p, f.layer.owner) orelse return; if (ch.lines.len == 0) return; const tab = p.settings.tab; - var buf: [8][3]u8 = undefined; - const colours = laneColours(p.theme(), &buf); - if (colours.len == 0) return; - // One change pinned is a diff: its lane in the diff's own two colours, - // by the row's kind; several, a colour a change, to tell them apart. - const one: ?Inks = if (ch.pins.len == 1) laneInks(p.theme()) else null; + const chrome = p.chrome(); + const colours = chrome.lanes[0..chrome.lanes_len]; + // One change pinned is a diff: its lane in the diff's own two markers + // (the user's rulings of 2026-11-23: added beside a row it wrote, deleted + // beside one it took away); several, a colour a change, to tell them + // apart. + const one = ch.pins.len == 1; const gutter = File.gutterWidth(pane); const cells = File.laneCells(pane); if (gutter >= tw or cells == 0) return; const first = tx + gutter - cells; const windowed = p.view().frontend.windowed; - const ground = pardes.colors.Grounds.of(p.theme()).add.row; const body_y = p.bodyTop(pane, r); const nrows = File.lineCount(f.content); var vr: u16 = pane.context_rows; @@ -2424,7 +2343,7 @@ fn paintLanes(p: *Pardes, s: *pardes.Surface, pane: *Pane, r: pardes.Rect, tx: u const next = pane.wrapAt(tab, @as(i32, vr) + 1); const to: usize = if (next.line == w.line) @intCast(next.at) else File.sourceLine(pane, w.line).len; const first_row = w.at <= 0; - inkGhost(p, s, pane, g, w.line, @intCast(@max(0, w.at)), to, w.pad, ch.marks, if (one == null) colours[g.pin % colours.len] else null, tx + gutter, y, tw - gutter); + inkGhost(p, s, pane, g, w.line, @intCast(@max(0, w.at)), to, w.pad, ch.marks, if (one) null else colours[g.pin % colours.len], tx + gutter, y, tw - gutter); if (g.kind == .description and first_row) points = @enumFromInt(g.pin); taken = g.kind == .deleted or g.kind == .changed or (g.kind == .description and takenAbove(ch.ghosts, gi)); break :ghost ghostLanes(ch, ch.ghosts, gi, first_row); @@ -2432,9 +2351,9 @@ fn paintLanes(p: *Pardes, s: *pardes.Surface, pane: *Pane, r: pardes.Rect, tx: u const at = File.fileRow(f, row); if (at >= ch.lines.len) continue; const line = ch.lines[at]; - if (line.whole and line.pin != .none) s.tint(tx + gutter, y, tw - gutter, ground, null); + if (line.whole and line.pin != .none) s.tint(tx + gutter, y, tw - gutter, chrome.add.row, null); // Going: a pin ahead takes it away. - if (line.going != .none) s.tint(tx + gutter, y, tw - gutter, pardes.colors.Grounds.of(p.theme()).del.row, null); + if (line.going != .none) s.tint(tx + gutter, y, tw - gutter, chrome.del.row, null); taken = line.going != .none; if (!line.whole and line.nmarks > 0) inkCame(p, s, pane, ch.marks[line.marks..][0..line.nmarks], w.line, vr, tx + gutter, y, tw - gutter); break :line line.lanes; @@ -2442,7 +2361,7 @@ fn paintLanes(p: *Pardes, s: *pardes.Surface, pane: *Pane, r: pardes.Rect, tx: u for (lanes, 0..) |lane, level| { if (lane == .none) break; const arrow = lane == points; - const rgb = if (one) |d| (if (taken) d.taken else d.added) else colours[@intFromEnum(lane) % colours.len]; + const rgb = if (one) (if (taken) chrome.del.ink else chrome.add.ink) else colours[@intFromEnum(lane) % colours.len]; if (windowed) { // A body a pixel shell draws as a layer is painted on a // temporary surface first: its lanes are not drawn yet. @@ -2567,7 +2486,7 @@ test "At shows a file at a revision beside it, read-only, coloured as its file; try testing.expectEqualStrings(Repo.two, pane.file.?.content); const name = try std.fmt.allocPrint(gpa, "{s}@@-", .{repo.file}); defer gpa.free(name); - try testing.expectEqualStrings(name, try pardes.tagline.tagPrefix(p, pane)); + try testing.expectEqualStrings(name, try pardes.tagline.pathPrefix(p, p.scratch.allocator(), pane)); try testing.expectEqualStrings(repo.file, File.langPath(&pane.file.?)); try testing.expect(pane.colorAlgo() == .source); // Read-only: a key's edit and a whole-text edit (dd) change nothing, and a bare Save says so. @@ -2877,10 +2796,10 @@ test "Changes draws a lane a pinned change after the line number, nested ones a const s = try p.render(arena.allocator()); const body = s.region(.body, id).?.rect; const first = body.x + before; - var buf: [8][3]u8 = undefined; - const colours = laneColours(p.theme(), &buf); + const c = p.chrome(); + const colours = c.lanes[0..c.lanes_len]; try testing.expect(colours.len >= 3); - const ground = pardes.colors.Grounds.of(p.theme()).add.row; + const ground = c.add.row; // Lines 1-10, each on the row the view draws it at (ghost rows // stand between): `fn`'s spine on all; `mid` on 3-6; `shift` on 4. const want = [_][]const u8{ "0", "0", "01", "012", "01", "01", "0", "0", "0", "0" }; @@ -2917,16 +2836,15 @@ test "Changes draws a lane a pinned change after the line number, nested ones a } } -test "a diff's two lane inks in every theme: its green and its red, never one colour, each read on the page" { - for (&pardes.colors.legacy_themes) |*th| { - const inks = laneInks(th); - errdefer std.debug.print("{s}: added {any} taken {any}\n", .{ th.name, inks.added, inks.taken }); - try testing.expect(!std.meta.eql(inks.added, inks.taken)); - const page = th.bg orelse th.tag_bg; - // 3:1, or as near the theme's own ink's as it reads (hex_poison's). - const floor = @min(3, pardes.colors.contrast(th.fg orelse th.tag_fg, page)) - 0.1; - try testing.expect(pardes.colors.contrast(inks.added, page) >= floor); - try testing.expect(pardes.colors.contrast(inks.taken, page) >= floor); +test "a diff's two lane inks in every theme are its added and deleted markers (DESIGN.md R10): never one colour, each 4.5:1 on its rows, as near as the theme reaches" { + for (&pardes.colors.themes) |*th| { + const c: pardes.colors.Chrome = .of(th); + errdefer std.debug.print("{s}: added {any} deleted {any}\n", .{ th.name, c.add, c.del }); + try testing.expect(!std.meta.eql(c.add.ink, c.del.ink)); + for ([2]pardes.colors.Chrome.Diff{ c.add, c.del }) |d| for ([2][3]u8{ d.row, d.emph }) |ground| { + const reach = @max(pardes.colors.contrast(@splat(255), ground), pardes.colors.contrast(@splat(0), ground)); + try testing.expect(pardes.colors.contrast(d.ink, ground) >= @min(4.5, reach) - 0.01); + }; } } @@ -3003,9 +2921,8 @@ test "Changes draws what the text has not where it stood, as ghost rows: a line const s = try p.render(arena.allocator()); const body = s.region(.body, id).?.rect; const first = body.x + File.gutterWidth(pane) - File.laneCells(pane); - var cbuf: [8][3]u8 = undefined; - const colours = laneColours(p.theme(), &cbuf); - const grounds = pardes.colors.Grounds.of(p.theme()); + const grounds = p.chrome(); + const colours = grounds.lanes[0..grounds.lanes_len]; const lanes = [_][]const u8{ "0", "0", "02", "02", "02", "02", "01", "01", "01", "0", "0", "0" }; const Ground = enum { none, add, del }; const ground = [_]Ground{ .add, .add, .none, .none, .add, .none, .del, .del, .none, .add, .add, .none }; @@ -3048,7 +2965,7 @@ test "Changes draws what the text has not where it stood, as ghost rows: a line try testing.expectEqual(pardes.Color{ .rgb = colours[pin] }, s.at(body.x + File.gutterWidth(pane), body.y + row).style.fg); try testing.expectEqual(pardes.Color{ .rgb = colours[pin] }, s.at(body.x + File.gutterWidth(pane) + 5, body.y + row).style.fg); } - try testing.expectEqual(pardes.Color{ .rgb = p.theme().lineno }, s.at(body.x + File.gutterWidth(pane) + 4, body.y + 6).style.fg); + try testing.expectEqual(pardes.Color{ .rgb = grounds.line_number }, s.at(body.x + File.gutterWidth(pane) + 4, body.y + 6).style.fg); // The changed line: on its old text the word that went (`b`) red, // on it the word that came (`b2`) green; the rest of each neither. const text_x = body.x + File.gutterWidth(pane); @@ -3071,10 +2988,9 @@ test "Changes draws what the text has not where it stood, as ghost rows: a line const s1 = try p.render(arena.allocator()); const top = s1.region(.body, id).?.rect.y; const at = body.x + File.gutterWidth(pane) - File.laneCells(pane); - const inks = laneInks(p.theme()); - try testing.expect(!std.meta.eql(inks.added, inks.taken)); + try testing.expect(!std.meta.eql(grounds.add.ink, grounds.del.ink)); for ([_]u16{ 2, 3, 4, 5 }, [_]bool{ true, false, false, false }) |row, red| { - const ink = if (red) inks.taken else inks.added; + const ink = if (red) grounds.del.ink else grounds.add.ink; if (windowed) { var n: usize = 0; for (s1.lanes.items) |lane| if (lane.y == top + row) { @@ -3084,8 +3000,9 @@ test "Changes draws what the text has not where it stood, as ghost rows: a line try testing.expectEqual(@as(usize, 1), n); } else try testing.expectEqual(pardes.Color{ .rgb = ink }, s1.at(at, top + row).style.fg); } - try testing.expectEqual(pardes.Color{ .rgb = p.theme().kw }, s1.at(text_x, top + 5).style.fg); - try testing.expect(!std.meta.eql(pardes.Color{ .rgb = p.theme().kw }, s1.at(text_x + 5, top + 5).style.fg)); + const keyword = grounds.syntax[@intFromEnum(syntax.Syn.keyword)]; + try testing.expectEqual(pardes.Color{ .rgb = keyword }, s1.at(text_x, top + 5).style.fg); + try testing.expect(!std.meta.eql(pardes.Color{ .rgb = keyword }, s1.at(text_x + 5, top + 5).style.fg)); } } @@ -3299,12 +3216,12 @@ test "a description is whole, its title and its author never cut: in a pane narr const s = try p.render(arena.allocator()); const body = s.region(.body, id).?.rect; const x = body.x + File.gutterWidth(pane); - try testing.expectEqual(pardes.Color{ .rgb = p.theme().kw }, s.at(x, body.y + 3).style.fg); + try testing.expectEqual(pardes.Color{ .rgb = p.chrome().syntax[@intFromEnum(syntax.Syn.keyword)] }, s.at(x, body.y + 3).style.fg); const last: u16 = body.y + 3 + @as(u16, @intCast(n - 1)); const end = x + @as(u16, @intCast(File.displayWidth(p.settings.tab, Ghosts.text(pane, got[3 + n - 1])))) - 1; try testing.expectEqualStrings("w", s.at(end, last).grapheme()); - try testing.expectEqual(pardes.Color{ .rgb = p.theme().lineno }, s.at(end, last).style.fg); - try testing.expectEqual(pardes.Color{ .rgb = p.theme().lineno }, s.at(end - 4, last).style.fg); + try testing.expectEqual(pardes.Color{ .rgb = p.chrome().line_number }, s.at(end, last).style.fg); + try testing.expectEqual(pardes.Color{ .rgb = p.chrome().line_number }, s.at(end - 4, last).style.fg); const first = x - File.laneCells(pane); for (0..n) |k| { const y = body.y + 3 + @as(u16, @intCast(k)); @@ -4068,7 +3985,7 @@ test "from the middle: in a revision's pane a pin behind it shows the lines it t const s = try p.render(arena.allocator()); const body = s.region(.body, id).?.rect; const x = body.x + File.gutterWidth(pane) + 1; - const grounds = pardes.colors.Grounds.of(p.theme()); + const grounds = p.chrome(); for ([_]u16{ 1, 8 }) |row| try testing.expectEqual(pardes.Color{ .rgb = grounds.add.row }, s.at(x, body.y + row).style.bg); for ([_]u16{ 7, 11 }) |row| try testing.expectEqual(pardes.Color{ .rgb = grounds.del.row }, s.at(x, body.y + row).style.bg); } @@ -4255,8 +4172,10 @@ test "Churn counts the changes that touched each declaration and draws them afte const s = try p.render(arena.allocator()); const body = s.region(.body, id).?.rect; const x = body.x + File.gutterWidth(pane) - 1; - const red = themeRed(p.theme()); - const warm = pardes.colors.mixOklab(p.theme().lineno, red, @log(3.0) / @log(4.0)); + // Churn's steps (Chrome.heat): the hottest the last, f's 3 of 4's + // log, the seventh. + const red = p.chrome().heat[7]; + const warm = p.chrome().heat[6]; for (0..7) |row| { const cell = s.at(x, body.y + @as(u16, @intCast(row))); if (row == 3) { @@ -4465,8 +4384,7 @@ test "Compare pins the whole difference between each two points as one change: t const s = try p.render(arena.allocator()); const body = s.region(.body, id).?.rect; const first = body.x + File.gutterWidth(pane) - File.laneCells(pane); - var cbuf: [8][3]u8 = undefined; - const colours = laneColours(p.theme(), &cbuf); + const colours = p.chrome().lanes[0..p.chrome().lanes_len]; for ([_]u16{ 3, 7, 8 }, [_]usize{ 0, 1, 1 }) |row, pin| { if (windowed) { var n: usize = 0; diff --git a/core/keys.zig b/core/keys.zig index 803b2b3c..05349d59 100644 --- a/core/keys.zig +++ b/core/keys.zig @@ -1066,12 +1066,12 @@ test "s in a header selects in the header's own text" { p.update(.{ .key = .{ .cp = 's' } }); try std.testing.expect(pane.prompt == .search and pane.prompt_for == .workspace); // the prompt takes the keys while the header keeps the keyboard - p.update(.{ .key = .{ .cp = 'c', .text = "col" } }); + p.update(.{ .key = .{ .cp = 'i', .text = "i" } }); p.update(.{ .key = .{ .cp = Key.enter } }); try std.testing.expect(p.view().header != null and pane.prompt == .none); var ranges: [Text.max_selections]modal.Selection = undefined; const text = try edit.flatSurface(p.editor(), &p.global_tag); const got = p.global_tag.ranges(text, 0, &ranges); - try std.testing.expectEqual(@as(usize, 2), got.n); // Newcol, Joincol + try std.testing.expectEqual(@as(usize, 2), got.n); // Find, Exit try std.testing.expectEqual(@as(u16, 0), pane.body.nsel); } diff --git a/core/layout.zig b/core/layout.zig index a6e6419b..c8fb91f9 100644 --- a/core/layout.zig +++ b/core/layout.zig @@ -592,12 +592,18 @@ pub const min_body_rows = 2; /// wants a row more. pub fn wantedTagRows(p: *Pardes, id: usize) u16 { const pane = p.panes[id] orelse return BOX_H; + return tagRows(p, id, tagline.computedWords(pane)); +} + +/// The rows pane `id`'s tag at rest takes with computed words `words`. +fn tagRows(p: *Pardes, id: usize, words: []const u8) u16 { + const pane = p.panes[id] orelse return BOX_H; if (pane.collapsed or !pane.tag_expanded) return BOX_H; if (p.view().rects[id].w == 0) return pane.tag_rows; // never laid out var wrap_room: [32 * 1024]u8 = undefined; var wrap_fba = std.heap.FixedBufferAllocator.init(&wrap_room); const wa = wrap_fba.allocator(); - const prefix = tagline.restPrefix(p, wa, pane) catch return pane.tag_rows; + const prefix = tagline.prefixWith(p, wa, pane, words) catch return pane.tag_rows; const whole = std.mem.concat(wa, u8, &.{ prefix, tagline.curTail(pane) }) catch return pane.tag_rows; const shown = tagline.wrapTag(p.settings.tab, wa, whole, tagline.tagWidth(p, id)) catch return pane.tag_rows; return @intCast(@max(BOX_H, @min(shown.rows(), MAX_TAG_ROWS))); @@ -622,7 +628,11 @@ pub fn headRows(p: *Pardes, id: usize) u16 { /// The rows a placement, and a `size`, leave a pane: its tag at its width /// and `min_body_rows`. The one minimum both ask. pub fn minRows(p: *Pardes, id: usize) u16 { - return wantedTagRows(p, id) + min_body_rows; + const pane = p.panes[id] orelse return BOX_H + min_body_rows; + // Its tag with the widest computed words it can come to show (UX + // K'3): an edit that brings Save and Undo never takes a row its + // column did not give. + return tagRows(p, id, tagline.widestWords(p, pane)) + min_body_rows; } /// Whether every column has the rows for each of its unfolded panes' @@ -1668,12 +1678,24 @@ pub fn noticeRowHeight(p: *const Pardes) u16 { return 1; } -/// The column tags' height: one row, as acme's (cols.c:244, colresize, -/// gives a column tag one font height); a newline in one is a space -/// (tagline.flattenHeaders). +/// The column tags' row: one, as acme's (cols.c:244, colresize, gives a +/// column tag one font height), a newline in one a space +/// (tagline.flattenHeaders); only while there are columns (UX K'2): two +/// or more, a column tag holding the user's text, or no window row for a +/// lone column's words (a native shell's). None on a screen too short. pub fn columnBarHeight(p: *const Pardes) u16 { - if (p.view().screen_h < 3) return 0; - return COLBAR_H; + const v = p.view(); + if (v.screen_h < 3) return 0; + if (v.ncol > 1 or p.topBarHeight() == 0) return COLBAR_H; + for (v.col_tags[0..v.ncol]) |t| if (t.own) |own| if (own.len > 0) return COLBAR_H; + return 0; +} + +/// A lone column's tag is at the window row's left (UX K'2): no column +/// row, and a window row for it. +pub fn columnInWindowRow(p: *const Pardes) bool { + const v = p.view(); + return v.ncol == 1 and v.screen_h >= 3 and p.topBarHeight() > 0 and columnBarHeight(p) == 0; } /// Whether new column `c` (Newcol's) may stay. A narrower @@ -1682,9 +1704,13 @@ pub fn columnBarHeight(p: *const Pardes) u16 { /// minimum `before`, `before_min`, not one dragged short) takes rows back /// from the panes with rows to spare, its column shared out again only /// where that is not enough. False, `c` dropped unannounced, where nothing -/// holds every minimum, as a size too small is refused. +/// holds every minimum, as a size too small is refused, and every pane's +/// rows as they were: the trial's shares are taken back with it (the +/// column row a second column brings, UX K'2, takes a row from every pane). pub fn keepColumn(p: *Pardes, c: usize, before: *const [MAX_PANES]Rect, before_min: *const [MAX_PANES]u16) bool { const v = p.view(); + var weights: [MAX_PANES]f32 = undefined; + for (p.panes, &weights) |slot, *w| w.* = if (slot) |pane| pane.vweight else 0; restoreMinimaFrom(p, before, before_min); for (0..p.view().ncol) |k| { compute(p); @@ -1694,6 +1720,9 @@ pub fn keepColumn(p: *Pardes, c: usize, before: *const [MAX_PANES]Rect, before_m if (!pane.collapsed and v.rects[id].h < minRows(p, id) and before[id].h >= before_min[id]) break true; } else false; if (squeezed and !shareColumn(p, k)) { + for (p.panes, weights) |slot, w| if (slot) |pane| { + pane.vweight = w; + }; dropColumnUnannounced(p, c); return false; } @@ -2580,3 +2609,47 @@ test "free space first (UX J1): a command's output and a Term take an untouched try std.testing.expectEqual(before + 3, f.count()); try std.testing.expect(p.panes[scratch] != null); } + +test "the column row comes with a second column and goes with it, the panes giving it and taking it back; a column tag with the user's text keeps it (UX K'2)" { + const p = try Pardes.init(std.testing.allocator, .{ .cols = 100, .rows = 20, .tty_only = true }); + defer p.deinit(); + _ = try p.setTestFile("one\n"); + // One column: no column row, its words in the window row, its pane + // under the window row. + try std.testing.expectEqual(@as(u16, 0), columnBarHeight(p)); + try std.testing.expect(columnInWindowRow(p)); + const alone = p.view().rects[0]; + try std.testing.expectEqual(TOPBAR_H, alone.y); + // A second column: the row, under the window row, every column's panes + // starting under it. + try std.testing.expect(p.executeBuiltinLine(0, "Newcol")); + p.sync(); + try std.testing.expectEqual(@as(usize, 2), p.view().ncol); + try std.testing.expectEqual(COLBAR_H, columnBarHeight(p)); + try std.testing.expect(!columnInWindowRow(p)); + try std.testing.expectEqual(TOPBAR_H + COLBAR_H, p.view().rects[0].y); + newScratchIn(p, 0, 1); + p.sync(); + const second = p.view().cols[1].panes[0]; + try std.testing.expectEqual(TOPBAR_H + COLBAR_H, p.view().rects[second].y); + // Delcol back to one: the row goes, the pane has it again. + p.exec_column = 1; + try std.testing.expect(p.executeBuiltinLine(second, "Delcol")); + p.exec_column = null; + p.sync(); + try std.testing.expectEqual(@as(usize, 1), p.view().ncol); + try std.testing.expectEqual(@as(u16, 0), columnBarHeight(p)); + try std.testing.expectEqualDeep(alone, p.view().rects[0]); + // The user's text in the column's tag: the row stays for it, alone. + p.view().col_tags[0].own = try p.gpa.dupe(u8, "Mine"); + p.sync(); + try std.testing.expectEqual(COLBAR_H, columnBarHeight(p)); + try std.testing.expect(!columnInWindowRow(p)); + try std.testing.expectEqual(TOPBAR_H + COLBAR_H, p.view().rects[0].y); + // Emptied, it goes again. + p.gpa.free(p.view().col_tags[0].own.?); + p.view().col_tags[0].own = try p.gpa.dupe(u8, ""); + p.sync(); + try std.testing.expectEqual(@as(u16, 0), columnBarHeight(p)); + try std.testing.expectEqualDeep(alone, p.view().rects[0]); +} diff --git a/core/lib_syntax.zig b/core/lib_syntax.zig index fa6812ee..448ac7f3 100644 --- a/core/lib_syntax.zig +++ b/core/lib_syntax.zig @@ -102,21 +102,22 @@ pub const NodeWalk = syntax.NodeWalk; pub const Span = syntax.Span; pub const walkNodes = syntax.walkNodes; -pub const Theme = colors.LegacyTheme; -/// Every theme: pardes's own, then those imported from helix and zed. The -/// first is the default. -pub const themes: []const Theme = &colors.legacy_themes; +pub const Theme = colors.Theme; +/// Every theme: pardes's own, then those imported from helix and zed. +pub const themes: []const Theme = &colors.themes; +/// The one a session starts in (`orchard`), its place in `themes`. +pub const default_theme = colors.default_theme; /// The theme named `name`, whatever its case. pub fn theme(name: []const u8) ?*const Theme { - return &colors.legacy_themes[colors.themeIndex(name) orelse return null]; + return &colors.themes[colors.themeIndex(name) orelse return null]; } /// A theme's page and its text's ink as a file pane has them: its own, or /// its tag's for the one theme with none (`dark`, a terminal's own). pub fn page(th: *const Theme) [3]u8 { - return th.bg orelse th.tag_bg; + return th.page orelse th.tag; } pub fn ink(th: *const Theme) [3]u8 { - return th.fg orelse th.tag_fg; + return th.text orelse th.tag_text; } pub const synInk = colors.synInk; diff --git a/core/look.zig b/core/look.zig index c7e0feb9..3ce1e48c 100644 --- a/core/look.zig +++ b/core/look.zig @@ -2152,8 +2152,9 @@ test "Look hover waits without mutating the pane and input cancels it" { _ = frame.reset(.retain_capacity); const surface = try p.render(frame.allocator()); + // On the selection's faint half (R7); a tag's (below) is the tags' own. + try std.testing.expectEqual(Color{ .rgb = p.chrome().selection_secondary }, surface.at(word_x, body_y).style.bg); const expected_bg = colors.mix(p.theme().bg orelse p.theme().tag_bg, colors.mix(p.theme().bg orelse p.theme().tag_bg, p.theme().sel_bg)); - try std.testing.expectEqual(Color{ .rgb = expected_bg }, surface.at(word_x, body_y).style.bg); // Background traffic in another pane does not change the text or geometry // under this pointer and must not strand a stationary hover unarmed. diff --git a/core/lsp/Ask.zig b/core/lsp/Ask.zig index 0f4f39dc..c60eb72b 100644 --- a/core/lsp/Ask.zig +++ b/core/lsp/Ask.zig @@ -558,17 +558,21 @@ test "Lspwhy after a Hover asks to explain that hover, in its file at its place, try std.testing.expect(seen); } -test "Def and Refs are a speaking file's tag words; gd, gr and a 2-1 chord all run them" { +test "Def and Refs are a speaking file's words, out of its tag (UX K'4); gd, gr and a 2-1 chord on them typed in its tag all run them" { if (!lsp.supports.contains(.definition)) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .cols = 100, .rows = 24, .tty_only = true }); defer p.deinit(); const pane = try p.setTestFile("const alpha = 1;\nconst beta = alpha;\n"); // A .txt has no server: no Def, no Refs. - try std.testing.expect(std.mem.indexOf(u8, tagline.curTail(pane), "Def") == null); + try std.testing.expect(std.mem.indexOf(u8, tagline.kindTail(pane), "Def") == null); const f = &pane.file.?; p.gpa.free(f.path); f.path = try p.gpa.dupe(u8, "/tmp/x.zig"); - try std.testing.expect(std.mem.endsWith(u8, tagline.curTail(pane), " Def Refs Del")); + try std.testing.expect(std.mem.endsWith(u8, tagline.kindTail(pane), " Def Refs Del")); + // Its tag's computed words have neither: typed into its own text, they + // run as any word there does. + try std.testing.expect(std.mem.indexOf(u8, tagline.computedWords(pane), "Def") == null); + pane.tag.own = try p.gpa.dupe(u8, "Def Refs"); p.sync(); while (p.nextEffect()) |_| {} const Asked = struct { diff --git a/core/mouse.zig b/core/mouse.zig index 37c3a97f..04bbaeb4 100644 --- a/core/mouse.zig +++ b/core/mouse.zig @@ -366,11 +366,14 @@ fn emulateButton(p: *Pardes, m: *Mouse) void { fn headerPoint(p: *Pardes, column: ?usize, mcol: u16, mrow: u16, clamp: bool) ?struct { t: *panes.Text, text: []const u8, line: u16, at: usize } { const v = p.view(); const t = if (column) |c| &v.col_tags[c] else &p.global_tag; - const x = if (column) |c| v.col_x[c] + TAG_TEXT_INSET else TAG_TEXT_INSET; + // A lone column's tag is at the window row's left, the window's at + // its right end (UX K'2). + const in_row = column == null or layout.columnInWindowRow(p); + const x = if (column) |c| (if (in_row) TAG_TEXT_INSET else v.col_x[c] + TAG_TEXT_INSET) else tagline.windowRow(p).words; const focused = v.header != null and p.headerColumn() == column; const text = edit.flatSurface(p.editor(), t) catch return null; - const base = if (column != null) p.topBarHeight() else 0; - const rows = if (column != null) layout.columnBarHeight(p) else p.topBarHeight(); + const base = if (in_row) 0 else p.topBarHeight(); + const rows = if (in_row) p.topBarHeight() else layout.columnBarHeight(p); const row: u16 = if (clamp) @min(mrow -| base, rows -| 1) else mrow -| base; const top: usize = if (focused) v.header_top else 0; const lines = modal.lineCount(text); @@ -681,7 +684,12 @@ pub fn handleMouse(p: *Pardes, event: Mouse) void { var column: ?usize = null; var x: u16 = TAG_TEXT_INSET; if (mcol < x) return; - if (mrow >= p.topBarHeight()) { + if (mrow < p.topBarHeight()) { + // The window row: a lone column's tag at its left, the + // window's at its right; the blank between them is no one's. + const sides = tagline.windowRow(p); + if (mcol < TAG_TEXT_INSET + sides.column) column = 0 else if (mcol < sides.words) return; + } else { for (0..p.view().ncol) |c| if (mcol >= v.col_x[c] and mcol < v.col_x[c] + v.col_w[c]) { column = c; x = v.col_x[c] + TAG_TEXT_INSET; @@ -1992,3 +2000,39 @@ test "a body press, drag and release are the same state whichever frame this pro } try expectSame(a, b, "after the press"); } + +fn clickAt(p: *Pardes, button: pardes.Mouse.Button, col: u16, row: u16) void { + p.update(.{ .mouse = .{ .button = button, .kind = .press, .col = col, .row = row } }); + p.update(.{ .mouse = .{ .button = button, .kind = .release, .col = col, .row = row } }); +} + +test "one column's words at the window row's left and the window's at its right each run their own; the blank between is no one's (UX K'2)" { + const p = try Pardes.init(std.testing.allocator, .{ .cols = 100, .rows = 20, .tty_only = true }); + defer p.deinit(); + _ = try p.setTestFile("one\n"); + const row = tagline.windowRow(p); + // `New Term ` and its caret's cell from the inset; the window's words + // end on the blank before the last cell. + try std.testing.expectEqual(@as(u16, "New Term ".len + 1), row.column); + try std.testing.expectEqual(@as(u16, 100 - "Find Grep Newcol Help Exit ".len - 1), row.words); + // B2 on `New`: a pane in the column. + clickAt(p, .middle, TAG_TEXT_INSET + 1, 0); + try std.testing.expectEqual(@as(usize, 2), p.view().cols[0].n); + // B2 and B1 on the blank between: nothing, and no tag takes the keyboard. + const between = row.words - 2; + try std.testing.expect(between > TAG_TEXT_INSET + row.column); + clickAt(p, .middle, between, 0); + clickAt(p, .left, between, 0); + try std.testing.expectEqual(@as(usize, 2), p.view().cols[0].n); + try std.testing.expectEqual(@as(usize, 1), p.view().ncol); + try std.testing.expect(p.view().header == null); + // B1 on `Term`: the column's tag has the keyboard, there in the window + // row, its caret on the clicked cell. + clickAt(p, .left, TAG_TEXT_INSET + "New ".len + 1, 0); + p.sync(); + try std.testing.expectEqual(@as(?usize, 0), p.headerColumn()); + try std.testing.expectEqual(@as(i32, "New ".len + 1), p.view().col_tags[0].cur_col); + // B2 on `Newcol`, at the right: a second column. + clickAt(p, .middle, row.words + @as(u16, "Find Grep ".len) + 2, 0); + try std.testing.expectEqual(@as(usize, 2), p.view().ncol); +} diff --git a/core/ninep/cols.zig b/core/ninep/cols.zig index 88d8ef88..c84017a7 100644 --- a/core/ninep/cols.zig +++ b/core/ninep/cols.zig @@ -79,7 +79,7 @@ pub fn write(p: *Pardes, req: Req, serial: ?u32) Reply { if (pending) p.fs.header_trunc_pending = null; return tree.failText(req.tag, E.INVAL, why); } - const had = if (pending) 0 else headerText(p, serial).?.len; + const had = if (pending) 0 else if (t.own) |own| own.len else 0; // A rewrite drops its one trailing newline: `echo <4096 bytes> > tag` // is 4096 bytes of tag, and fits. const rewrite = pending or p.fs.header_rewrite == rewriteKey(serial); @@ -89,7 +89,8 @@ pub fn write(p: *Pardes, req: Req, serial: ?u32) Reply { return tree.failText(req.tag, E.NOSPC, pardes.ctlfs.pane.e_tag_over); } applyTruncation(p, serial); - const was = headerText(p, serial).?; + // Its own text grows, after the computed words (UX K'1). + const was: []const u8 = t.own orelse ""; var data = req.data; const rewriting = p.fs.header_rewrite == rewriteKey(serial); // A newline held from the write before goes in once more text follows. @@ -106,8 +107,8 @@ pub fn write(p: *Pardes, req: Req, serial: ?u32) Reply { return .{ .tag = req.tag, .written = @intCast(req.data.len) }; } -/// Truncating clears it, as a pane tag's `cleartag`: its default words go -/// too, and `u` in it brings them back. +/// Truncating clears it, as a pane tag's `cleartag`: its own text goes, +/// its computed words stay, and `u` in it brings the text back. pub fn truncate(p: *Pardes, serial: ?u32) tree.Status { if (header(p, serial) == null) return .err; // Done with the write after it, which may yet be refused. @@ -128,8 +129,9 @@ fn clear(p: *Pardes, serial: ?u32) tree.Status { const empty = p.gpa.alloc(u8, 0) catch unreachable; // no byte: the allocator is not asked if (t.own) |own| p.gpa.free(own); t.own = empty; + // what is left is the computed words; the cursor goes after them t.cur_row = 0; - t.cur_col = 0; + t.cur_col = @intCast(tagline.headerWords(p, t.what).len + 1); p.fs.header_rewrite = rewriteKey(serial); p.fs.header_held = false; return .ok; @@ -548,19 +550,21 @@ test "a column's tag and the workspace's read, replace and append as a pane tag try testing.expectEqual(E.NOENT, th.look_up(p, col_dir, "777").errno()); const tag = Node.ofCol(serial, .tag); try testing.expectEqual(tree.Status.ok, th.look_up(p, Node.ofCol(serial, .dir), "tag").reply.status); - try testing.expectEqualStrings("New Term Find Grep Joincol Delcol", th.rd(p, tag, 0, 4096).bytes); - // `echo Make > tag`: cleared, then the newline ending the write dropped. + // Its computed words (UX K'2), a blank, and its own text: none yet. + try testing.expectEqualStrings("New Term ", th.rd(p, tag, 0, 4096).bytes); + // `echo Make > tag`: its own text cleared, then the newline ending the + // write dropped; the computed words stay. _ = th.call(p, .{ .tag = 1, .op = .setattr, .node = tag, .truncate = true }); _ = th.wr(p, tag, "Make\n"); - try testing.expectEqualStrings("Make", th.rd(p, tag, 0, 4096).bytes); + try testing.expectEqualStrings("New Term Make", th.rd(p, tag, 0, 4096).bytes); _ = th.call(p, .{ .tag = 2, .op = .release, .node = tag }); // `>>` appends; a newline in a one-line tag is a space. _ = th.wr(p, tag, " Lint\nNow"); - try testing.expectEqualStrings("Make Lint Now", th.rd(p, tag, 0, 4096).bytes); + try testing.expectEqualStrings("New Term Make Lint Now", th.rd(p, tag, 0, 4096).bytes); const top = @backingInt(tree.TopFile.tag); _ = th.call(p, .{ .tag = 3, .op = .setattr, .node = top, .truncate = true }); _ = th.wr(p, top, "Newcol Exit\n"); - try testing.expectEqualStrings("Newcol Exit", tagline.topbar(p)); + try testing.expectEqualStrings("Find Grep Newcol Help Exit Newcol Exit", tagline.topbar(p)); } test "a focus write makes its pane's column the active one: layout says so and pane/new goes there" { diff --git a/core/ninep/ctl.zig b/core/ninep/ctl.zig index 17f58e7f..6d78bc44 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/ninep/pane.zig b/core/ninep/pane.zig index 093a9223..3627fdfb 100644 --- a/core/ninep/pane.zig +++ b/core/ninep/pane.zig @@ -777,7 +777,7 @@ pub fn applyTagTruncation(p: *Pardes, pane: *Pane) void { pane.tag.own = empty; // what is left is the prefix; the cursor goes after it pane.tag.cur_row = 0; - pane.tag.cur_col = if (tagline.pathPrefix(p, p.scratch.allocator(), pane)) |prefix| @intCast(prefix.len) else |_| 0; + pane.tag.cur_col = if (tagline.restPrefix(p, p.scratch.allocator(), pane)) |prefix| @intCast(prefix.len) else |_| 0; pane.tag.vsel.active = false; pane.tag.nsel = 0; pf.tag_rewrite = true; diff --git a/core/replica.zig b/core/replica.zig index d07ce9d3..6c037cd2 100644 --- a/core/replica.zig +++ b/core/replica.zig @@ -8003,7 +8003,9 @@ test "a far client's drag in a kind's pane it grabbed, the pane since too short } for ([_]pardes.Event{ .{ .mouse = .{ .button = .left, .kind = .press, .col = col, .row = row } }, - .{ .resize = .{ .cols = 80, .rows = 5 } }, + // Two rows for the two panes under the window row (a lone column has + // no column row, UX K'2): one each. + .{ .resize = .{ .cols = 80, .rows = 4 } }, .{ .mouse = .{ .button = .left, .kind = .drag, .col = col, .row = 30 } }, .{ .mouse = .{ .button = .left, .kind = .release, .col = col, .row = 30 } }, }) |ev| { diff --git a/core/root.zig b/core/root.zig index 8d5f8c40..1b107d59 100644 --- a/core/root.zig +++ b/core/root.zig @@ -166,7 +166,13 @@ pub const TAG_TEXT_INSET: u16 = config.GUTTER; pub fn taglineOriginCol(p: *const Pardes, col: u16, row: u16) f32 { const v = p.view(); - if (row < p.topBarHeight()) return 0; + // The window row's two tags (UX K'2): a lone column's from the inset, + // the window's from its words. + if (row < p.topBarHeight()) { + const sides = tagline.windowRow(p); + if (col >= sides.words) return @floatFromInt(sides.words); + return if (sides.column > 0 and col >= TAG_TEXT_INSET) @floatFromInt(TAG_TEXT_INSET) else 0; + } if (row < p.topBarHeight() + layout.columnBarHeight(p)) { for (v.col_x[0..p.view().ncol], v.col_w[0..p.view().ncol]) |x, w| if (col >= x and col - x < w) return @floatFromInt(x); @@ -183,7 +189,17 @@ pub fn taglineOriginCol(p: *const Pardes, col: u16, row: u16) f32 { pub fn gridColAt(p: ?*const Pardes, x: f32, row: u16, body_w: f32, tagline_w: f32) u16 { const body = @max(body_w, 1); const tag = @max(tagline_w, 1); - if (row < (if (p) |core| core.topBarHeight() else TOPBAR_H)) return colFromSpan(x, tag); + if (row < (if (p) |core| core.topBarHeight() else TOPBAR_H)) { + // Its inset and the blank between its two tags on the body's grid, + // each tag's glyphs from its origin (taglineOriginCol). + const core = p orelse return colFromSpan(x, tag); + const cell = colFromSpan(x, body); + const origin: u16 = @intFromFloat(taglineOriginCol(core, cell, row)); + if (origin == 0) return cell; + const sides = tagline.windowRow(core); + const end = if (origin < sides.words) TAG_TEXT_INSET + sides.column else core.view().screen_w; + return @min(origin + colFromSpan(x - @as(f32, @floatFromInt(origin)) * body, tag), end -| 1); + } if (p) |core| if (row < core.topBarHeight() + layout.columnBarHeight(core)) { for (core.view().col_x[0..core.view().ncol], core.view().col_w[0..core.view().ncol]) |origin, width| { if (width == 0) continue; @@ -279,7 +295,7 @@ fn shortcuts(comptime b: Builtin) []const u8 { for (config.exec_key) |k| s = s ++ ", " ++ chordName(k); s = s ++ ", " ++ @tagName(config.exec_button) ++ "-click"; } - var it = std.mem.tokenizeScalar(u8, config.topbar_str, ' '); + var it = std.mem.tokenizeScalar(u8, config.window_words_str, ' '); while (it.next()) |w| if (std.mem.eql(u8, w, @tagName(b))) { s = s ++ ", topbar"; }; @@ -333,7 +349,7 @@ pub const builtin_rows: [std.enums.values(Builtin).len]Row = blk: { comptime { @setEvalBranchQuota(20000); // one branch per string byte, behind the decl walk that folds Builtin - var it = std.mem.tokenizeScalar(u8, config.topbar_str, ' '); + var it = std.mem.tokenizeScalar(u8, config.topbar_str ++ " " ++ config.window_words_str ++ " " ++ config.columns_words_str, ' '); words: while (it.next()) |w| { for (@typeInfo(Builtin).@"enum".field_names) |name| if (std.mem.eql(u8, name, w)) continue :words; @@ -368,9 +384,11 @@ test "a compact tagline anchors at its own pane, and both shells step from the s try std.testing.expectEqual(@as(f32, @floatFromInt(left.x)), taglineOriginCol(p, left.x + 3, left.y)); try std.testing.expectEqual(@as(f32, @floatFromInt(right.x)), taglineOriginCol(p, right.x + 3, right.y)); - // The topbar's origin is column zero always — it is not a pane rect, which - // is why row zero is right even in a window with no core to ask. + // The window row (UX K'2): its blank's origin is column zero, as a window + // with no core to ask has it; the window's words start at their own. + const words = tagline.windowRow(p).words; try std.testing.expectEqual(@as(f32, 0), taglineOriginCol(p, 40, 0)); + try std.testing.expectEqual(@as(f32, @floatFromInt(words)), taglineOriginCol(p, words + 3, 0)); const body_row = left.y + 2; try std.testing.expectEqual(@as(f32, 7), taglineOriginCol(p, 7, body_row)); @@ -399,9 +417,10 @@ test "a compact tagline anchors at its own pane, and both shells step from the s try std.testing.expectEqual(col, gridColAt(p, glyph_x + tag_w / 2, left.y, body_w, tag_w)); } - // The topbar's pointer grid is compact from column zero, with no pane to - // anchor to — the one tag row that is right with or without a core. - try std.testing.expectEqual(@as(u16, 3), gridColAt(p, 3.5 * tag_w, 0, body_w, tag_w)); + // The window row's blank is on the body's grid, its words compact from + // where they start; with no core to ask, compact from column zero. + try std.testing.expectEqual(@as(u16, 3), gridColAt(p, 3.5 * body_w, 0, body_w, tag_w)); + try std.testing.expectEqual(words + 3, gridColAt(p, @as(f32, @floatFromInt(words)) * body_w + 3.5 * tag_w, 0, body_w, tag_w)); try std.testing.expectEqual(@as(u16, 3), gridColAt(null, 3.5 * tag_w, 0, body_w, tag_w)); // A body row is untouched: still the body grid, still divided by the body @@ -461,6 +480,7 @@ test { _ = @import("FrameStats.zig"); _ = @import("Query.zig"); _ = @import("Names.zig"); + _ = @import("syntax.zig"); // without it a -Dtest-filter run compiles none of its tests (a whole run has them) _ = @import("Stream.zig"); _ = @import("Tables.zig"); _ = @import("Handover.zig"); @@ -764,11 +784,11 @@ test "what core/ asks of the machine is where the list says, with why: a new lin /// state did not make it diverged a client: Pane.notices, then Tables' /// reading, 2026-11-19). A file, its names, the reason. const kept_out = [_]struct { []const u8, []const u8, []const u8 }{ - .{ "Core.zig", "surface facts frames own_frames theme_chrome frame_arena scratch echo undrawn", "the frame's own and the views drawn here: written by frames (and chrome by a theme's step), read by frames and the runner; no step reads them" }, + .{ "Core.zig", "surface facts frames own_frames theme_chrome frame_arena scratch echo undrawn", "the frame's own and the views drawn here: written by frames (and chrome by a theme's step), read by frames and the runner, and the chrome by a query's rows for colours only (out of their digest, locations.Row.digest); no step's outcome reads them" }, .{ "Core.zig", "needs_frame", "whether to draw: steps set it, the loop reads it; no step's outcome reads it" }, .{ "Core.zig", "effects effects_head effects_len in_q in_head in_len opts dump_out dump_export tape", "this process's queues, options and tape, drained or set by its host" }, .{ "Core.zig", "shell_rows", "a terminal's rows as read here, swept at every update; the terminal's own digest covers its active area, not its history (Term.zig `calls`)" }, - .{ "Core.zig", "diff_output locations_cache tty_filter_palette body_chrome", "caches of pure functions of their key (a text, a theme): a step finds what it would make; a query row's colours from them are out of its digest (locations.Row.digest), and what a step asks a worker to paint is never decided by them (Stream.paintRows)" }, + .{ "Core.zig", "diff_output locations_cache tty_filter_palette", "caches of pure functions of their key (a text, a theme): a step finds what it would make; a query row's colours from them are out of its digest (locations.Row.digest), and what a step asks a worker to paint is never decided by them (Stream.paintRows)" }, .{ "Core.zig", "retired_panes", "panes torn down this step, freed at its end" }, .{ "Core.zig", "theme_preview preview_chrome", "a themes picker's preview (colors.previewTheme): made from the live picker's cursor, in the digest with it, after every step (Pick.produceAll) and gone at its roll-up; a step reading a theme meanwhile reads the one its own state previews" }, .{ "Core.zig", "multi_first multi_stop multi_index multi_count exec_depth exec_column", "a step's own: set by a key's replay across the ranges (normal.replaySels) and a word's run (exec.zig), each put back before the step ends; between steps what `init` makes, so a load takes them as it makes them (a dump's said 2^30 ranges once: a yank sized its register by it)" }, diff --git a/core/surface.zig b/core/surface.zig index b78b58de..ce8898ad 100644 --- a/core/surface.zig +++ b/core/surface.zig @@ -206,9 +206,12 @@ pub const Chrome = struct { grip_focus_ring: [3]u8 = .{ 0, 0, 0 }, /// A dirty pane's button fill. grip_dirty: [3]u8 = .{ 0, 0, 0 }, - /// The rule between a pane's tag and its body; null is halfway between - /// the tag's ground and the page the shell actually draws. - tag_rule: ?[3]u8 = null, + /// A reading pane's ring (DESIGN.md G1'), and the ink on a filled + /// button. + grip_mode: [3]u8 = .{ 0, 0, 0 }, + grip_ink: [3]u8 = .{ 0, 0, 0 }, + /// The rule between a pane's tag and its body. + tag_rule: [3]u8 = .{ 0, 0, 0 }, /// The scroll column's width, button and scrollbar alike, in pixels at /// a 17px tagline (acme's 12 at its font); a pixel shell scales it. rail_px: u8 = 12, diff --git a/core/syntax.zig b/core/syntax.zig index 5c05300e..9fbad3cf 100644 --- a/core/syntax.zig +++ b/core/syntax.zig @@ -621,7 +621,7 @@ pub fn analyzeSource(gpa: std.mem.Allocator, path: []const u8, content: []const defer tree.destroy(); var result: SourceAnalysis = .{}; errdefer result.deinit(gpa); - if (want_declarations) result.declarations = try declarationsFromTree(gpa, content, tree, null); + if (want_declarations) result.declarations = (try contextFromTree(gpa, content, tree, null, &.{})).declarations; if (want_colors) { result.colors = try gpa.alloc(u8, content.len); @memset(result.colors, 0); @@ -635,23 +635,52 @@ pub fn contextDeclarations(gpa: std.mem.Allocator, path: []const u8, content: [] return analysis.declarations; } -/// The declarations of `content` (its path's language), on a worker -/// (`parseApart`). `halt` ends the parse and the walk early -/// (error.Canceled): a 1.2 MB file is seconds in a Debug build. -pub fn declarationsApart(gpa: std.mem.Allocator, path: []const u8, content: []const u8, halt: *const std.atomic.Value(bool)) ![]ContextDeclaration { - if (content.len == 0) return &.{}; +/// A text's context, from one parse: its declarations (the sticky +/// headers', Locations') and its symbols (the Symbols picker's, UX DESIGN +/// N), both of the same allocator. +pub const Context = struct { + declarations: []ContextDeclaration = &.{}, + symbols: []Symbol = &.{}, + + pub fn deinit(c: *Context, gpa: std.mem.Allocator) void { + gpa.free(c.declarations); + gpa.free(c.symbols); + c.* = .{}; + } +}; + +/// `content`'s context (its path's language), parsed here: a sticky +/// header's (File.refreshContext), a loaded text's. +pub fn context(gpa: std.mem.Allocator, path: []const u8, content: []const u8) !Context { + if (content.len == 0) return .{}; + const spec = byExt(std.Io.Dir.path.extension(path)) orelse return .{}; + const selected = try ensure(spec); + const tree = selected.parser.parseString(content, null) orelse return .{}; + defer tree.destroy(); + return contextFromTree(gpa, content, tree, null, rulesOf(spec.name)); +} + +/// `content`'s context, on a worker (`parseApart`). `halt` ends the parse +/// and the walk early (error.Canceled): a 1.2 MB file is seconds in a +/// Debug build. +pub fn contextApart(gpa: std.mem.Allocator, path: []const u8, content: []const u8, halt: *const std.atomic.Value(bool)) !Context { + if (content.len == 0) return .{}; const ext = std.Io.Dir.path.extension(path); const spec = specs: for (&specs) |*spec| { for (spec.exts) |choice| if (std.ascii.eqlIgnoreCase(ext, choice)) break :specs spec; - } else return &.{}; + } else return .{}; const tree = try parseApart(langOf(spec), content, halt); defer tree.destroy(); - return declarationsFromTree(gpa, content, tree, halt); + return contextFromTree(gpa, content, tree, halt, rulesOf(spec.name)); } -fn declarationsFromTree(gpa: std.mem.Allocator, content: []const u8, tree: *ts.Tree, halt: ?*const std.atomic.Value(bool)) ![]ContextDeclaration { +/// The declarations and, by `rules` (none: no symbols), the symbols of a +/// parse, in one walk of its nodes. +fn contextFromTree(gpa: std.mem.Allocator, content: []const u8, tree: *ts.Tree, halt: ?*const std.atomic.Value(bool), rules: []const Rule) !Context { var result: std.ArrayList(ContextDeclaration) = .empty; errdefer result.deinit(gpa); + var symbols: SymbolWalk = .{ .gpa = gpa, .rules = rules, .source = content }; + errdefer symbols.out.deinit(gpa); // The cursor retains its ancestor stack: sibling visits do not repeatedly // reconstruct parents in broad syntax trees. Preorder preserves source order. var cursor = tree.rootNode().walk(); @@ -661,14 +690,21 @@ fn declarationsFromTree(gpa: std.mem.Allocator, content: []const u8, tree: *ts.T visited += 1; if (halt) |flag| if (visited % 4096 == 0 and flag.load(.monotonic)) return error.Canceled; const node = cursor.node(); - if (node.isNamed()) if (contextSpan(node, content)) |span| { - if (result.items.len == 0 or result.items[result.items.len - 1].start_line != span.start_line or - result.items[result.items.len - 1].end_line != span.end_line) - try result.append(gpa, span); - }; + if (node.isNamed()) { + if (contextSpan(node, content)) |span| { + if (result.items.len == 0 or result.items[result.items.len - 1].start_line != span.start_line or + result.items[result.items.len - 1].end_line != span.end_line) + try result.append(gpa, span); + } + if (rules.len > 0) try symbols.visit(node); + } if (cursor.gotoFirstChild()) continue; while (!cursor.gotoNextSibling()) { - if (!cursor.gotoParent()) return result.toOwnedSlice(gpa); + if (!cursor.gotoParent()) { + const declarations = try result.toOwnedSlice(gpa); + errdefer gpa.free(declarations); + return .{ .declarations = declarations, .symbols = try symbols.out.toOwnedSlice(gpa) }; + } } } } @@ -761,6 +797,543 @@ fn contextSpan(node: ts.Node, source: []const u8) ?ContextDeclaration { }; } +// ---- symbols: the Symbols picker's (UX DESIGN N) ---- + +/// What a symbol is, in the Symbols picker's order (UX DESIGN N2): types, +/// functions, fields, then the rest (consts, vars, modules, other) as one +/// group. A `scope` is listed nowhere: it names its members (Rust's +/// `impl S`: `S.new`). +pub const SymbolKind = enum(u8) { + type, + function, + field, + constant, + variable, + module, + other, + scope, + + /// Its mark in a row (UX DESIGN N4): one letter, `·` for the other. + pub fn mark(k: SymbolKind) []const u8 { + return switch (k) { + .type => "t", + .function => "f", + .field => "m", + .constant => "c", + .variable => "v", + .module => "n", + .other, .scope => "·", + }; + } + + /// Its group in the picker: 0 types, 1 functions, 2 fields, 3 the rest. + pub fn group(k: SymbolKind) u8 { + return @min(@intFromEnum(k), 3); + } +}; + +/// A declaration the Symbols picker lists: its kind, the line and bytes of +/// its name, and the symbol it is declared in. +pub const Symbol = struct { + kind: SymbolKind, + /// The line its name is on, from 0. + line: u32, + name_start: u32, + name_end: u32, + /// Where what its row says after its name ends (a function's + /// signature): its body's start, else its own end. Its row cuts it at + /// its name's line's end. + end: u32, + /// The symbol it is declared in, by its index + 1 (0: none): its name + /// qualifies this one's (`Counts.lines`). + parent: u32 = 0, +}; + +/// How a node of a grammar is a symbol (UX DESIGN N2: one table a language). +const Rule = struct { + node: []const u8, + kind: SymbolKind, + how: How = .plain, + /// The field naming it; without it, its declarator's name (C's) or the + /// first name under it (`nameOf`). "": none (an anonymous scope). + name: []const u8 = "name", + /// A form's first words and the kinds they declare (`.head`). + heads: []const struct { []const u8, SymbolKind } = &.{}, + /// Not one under a node of this kind (Pascal's declProc heading the + /// defProc that is the symbol). + unless_in: []const u8 = "", +}; + +const How = enum { + /// Its kind as given. + plain, + /// Only with a body (C's `struct s { ... }`; `struct s x;` names the + /// type, declares none); unnamed, a scope (an anonymous struct's fields + /// are its owner's). + body, + /// C's declaration: a function where a declarator on the way to its + /// name is one's; else a const where `const` says so (its kind a var). + declarator, + /// A binding whose value tells: a type, a function, a module (Zig's + /// `const S = struct`, `@import`, JavaScript's arrow function); else a + /// const or a var by its keyword. + value, + /// A binding that is a field in a type (a Python class's attribute, + /// Kotlin's property); else a const or a var by its keyword. Named + /// by a name, never a pattern (`self.x = ...`). + binding, + /// A form whose first word says what it declares (Elixir's `def f`, + /// Clojure's `(defn f ...)`), named by its second. + head, + /// No row: a scope its members are named in, by its own name (Rust's + /// `impl S`) or its owner's (an anonymous struct). + scope, +}; + +const c_rules = [_]Rule{ + .{ .node = "function_definition", .kind = .function }, + .{ .node = "declaration", .kind = .variable, .how = .declarator }, + .{ .node = "field_declaration", .kind = .field, .how = .declarator }, + .{ .node = "struct_specifier", .kind = .type, .how = .body }, + .{ .node = "union_specifier", .kind = .type, .how = .body }, + .{ .node = "enum_specifier", .kind = .type, .how = .body }, + .{ .node = "enumerator", .kind = .field }, + .{ .node = "type_definition", .kind = .type }, + .{ .node = "preproc_def", .kind = .other }, + .{ .node = "preproc_function_def", .kind = .other }, +}; + +/// The kind tables, by grammar (grammar_manifest.zig): a grammar with none +/// (JSON, CSS, HTML, Markdown, Typst) lists no symbols. +const symbol_rules = [_]struct { []const u8, []const Rule }{ + .{ "zig", &.{ + // Named by its FnProto's `function` (symbolOf). + .{ .node = "Decl", .kind = .function, .name = "" }, + .{ .node = "VarDecl", .kind = .variable, .how = .value, .name = "variable_type_function" }, + .{ .node = "ContainerField", .kind = .field }, + .{ .node = "TestDecl", .kind = .other, .name = "" }, + .{ .node = "ContainerDecl", .kind = .type, .how = .scope, .name = "" }, + } }, + .{ "c", &c_rules }, + .{ "cpp", &(c_rules ++ [_]Rule{ + .{ .node = "class_specifier", .kind = .type, .how = .body }, + .{ .node = "namespace_definition", .kind = .module }, + .{ .node = "alias_declaration", .kind = .type }, + }) }, + .{ "rust", &.{ + .{ .node = "function_item", .kind = .function }, + .{ .node = "function_signature_item", .kind = .function }, + .{ .node = "struct_item", .kind = .type }, + .{ .node = "enum_item", .kind = .type }, + .{ .node = "union_item", .kind = .type }, + .{ .node = "trait_item", .kind = .type }, + .{ .node = "type_item", .kind = .type }, + .{ .node = "impl_item", .kind = .type, .how = .scope, .name = "type" }, + .{ .node = "field_declaration", .kind = .field }, + .{ .node = "enum_variant", .kind = .field }, + .{ .node = "const_item", .kind = .constant }, + .{ .node = "static_item", .kind = .variable }, + .{ .node = "mod_item", .kind = .module }, + .{ .node = "macro_definition", .kind = .other }, + } }, + .{ "go", &.{ + .{ .node = "function_declaration", .kind = .function }, + .{ .node = "method_declaration", .kind = .function }, + .{ .node = "method_elem", .kind = .function }, + .{ .node = "type_spec", .kind = .type }, + .{ .node = "type_alias", .kind = .type }, + .{ .node = "field_declaration", .kind = .field }, + .{ .node = "const_spec", .kind = .constant }, + .{ .node = "var_spec", .kind = .variable }, + } }, + .{ "python", &.{ + .{ .node = "class_definition", .kind = .type }, + .{ .node = "function_definition", .kind = .function }, + .{ .node = "assignment", .kind = .variable, .how = .binding, .name = "left" }, + } }, + .{ "javascript", &.{ + .{ .node = "function_declaration", .kind = .function }, + .{ .node = "generator_function_declaration", .kind = .function }, + .{ .node = "class_declaration", .kind = .type }, + .{ .node = "method_definition", .kind = .function }, + .{ .node = "field_definition", .kind = .field, .name = "property" }, + .{ .node = "variable_declarator", .kind = .variable, .how = .value }, + } }, + .{ "java", &.{ + .{ .node = "class_declaration", .kind = .type }, + .{ .node = "interface_declaration", .kind = .type }, + .{ .node = "enum_declaration", .kind = .type }, + .{ .node = "record_declaration", .kind = .type }, + .{ .node = "annotation_type_declaration", .kind = .type }, + .{ .node = "method_declaration", .kind = .function }, + .{ .node = "constructor_declaration", .kind = .function }, + .{ .node = "field_declaration", .kind = .field }, + .{ .node = "enum_constant", .kind = .field }, + .{ .node = "constant_declaration", .kind = .constant }, + } }, + .{ "c_sharp", &.{ + .{ .node = "class_declaration", .kind = .type }, + .{ .node = "struct_declaration", .kind = .type }, + .{ .node = "interface_declaration", .kind = .type }, + .{ .node = "enum_declaration", .kind = .type }, + .{ .node = "record_declaration", .kind = .type }, + .{ .node = "delegate_declaration", .kind = .type }, + .{ .node = "namespace_declaration", .kind = .module }, + .{ .node = "file_scoped_namespace_declaration", .kind = .module }, + .{ .node = "method_declaration", .kind = .function }, + .{ .node = "constructor_declaration", .kind = .function }, + .{ .node = "destructor_declaration", .kind = .function }, + .{ .node = "field_declaration", .kind = .field }, + .{ .node = "property_declaration", .kind = .field }, + .{ .node = "event_field_declaration", .kind = .field }, + .{ .node = "enum_member_declaration", .kind = .field }, + } }, + .{ "kotlin", &.{ + .{ .node = "class_declaration", .kind = .type }, + .{ .node = "object_declaration", .kind = .type }, + .{ .node = "companion_object", .kind = .type, .how = .scope, .name = "" }, + .{ .node = "function_declaration", .kind = .function }, + .{ .node = "property_declaration", .kind = .variable, .how = .binding }, + .{ .node = "type_alias", .kind = .type }, + .{ .node = "enum_entry", .kind = .field }, + } }, + .{ "scala", &.{ + .{ .node = "class_definition", .kind = .type }, + .{ .node = "object_definition", .kind = .type }, + .{ .node = "trait_definition", .kind = .type }, + .{ .node = "enum_definition", .kind = .type }, + .{ .node = "type_definition", .kind = .type }, + .{ .node = "function_definition", .kind = .function }, + .{ .node = "function_declaration", .kind = .function }, + .{ .node = "val_definition", .kind = .constant, .how = .binding, .name = "pattern" }, + .{ .node = "var_definition", .kind = .variable, .how = .binding, .name = "pattern" }, + .{ .node = "simple_enum_case", .kind = .field }, + .{ .node = "full_enum_case", .kind = .field }, + } }, + .{ "ruby", &.{ + .{ .node = "class", .kind = .type }, + .{ .node = "singleton_class", .kind = .type, .how = .scope, .name = "" }, + .{ .node = "module", .kind = .module }, + .{ .node = "method", .kind = .function }, + .{ .node = "singleton_method", .kind = .function }, + } }, + .{ "php", &.{ + .{ .node = "class_declaration", .kind = .type }, + .{ .node = "interface_declaration", .kind = .type }, + .{ .node = "trait_declaration", .kind = .type }, + .{ .node = "enum_declaration", .kind = .type }, + .{ .node = "function_definition", .kind = .function }, + .{ .node = "method_declaration", .kind = .function }, + .{ .node = "property_declaration", .kind = .field }, + .{ .node = "enum_case", .kind = .field }, + .{ .node = "const_declaration", .kind = .constant }, + .{ .node = "namespace_definition", .kind = .module }, + } }, + .{ "bash", &.{ + .{ .node = "function_definition", .kind = .function }, + .{ .node = "variable_assignment", .kind = .variable, .how = .binding }, + } }, + .{ "haskell", &.{ + .{ .node = "data_type", .kind = .type }, + .{ .node = "newtype", .kind = .type }, + .{ .node = "type_synomym", .kind = .type }, + .{ .node = "class", .kind = .type }, + .{ .node = "instance", .kind = .type, .how = .scope }, + .{ .node = "function", .kind = .function }, + .{ .node = "bind", .kind = .constant }, + .{ .node = "data_constructor", .kind = .field }, + } }, + .{ "ocaml", &.{ + .{ .node = "type_binding", .kind = .type }, + .{ .node = "module_binding", .kind = .module }, + .{ .node = "module_type_definition", .kind = .type }, + .{ .node = "class_binding", .kind = .type }, + .{ .node = "method_definition", .kind = .function }, + .{ .node = "let_binding", .kind = .constant, .how = .value, .name = "pattern" }, + .{ .node = "field_declaration", .kind = .field }, + .{ .node = "constructor_declaration", .kind = .field }, + } }, + .{ "erlang", &.{ + .{ .node = "fun_decl", .kind = .function }, + .{ .node = "record_decl", .kind = .type }, + .{ .node = "record_field", .kind = .field }, + .{ .node = "type_alias", .kind = .type }, + .{ .node = "pp_define", .kind = .other }, + .{ .node = "module_attribute", .kind = .module }, + } }, + .{ "elixir", &.{ + .{ .node = "call", .kind = .other, .how = .head, .heads = &.{ + .{ "defmodule", .module }, .{ "defprotocol", .type }, .{ "def", .function }, + .{ "defp", .function }, .{ "defdelegate", .function }, .{ "defguard", .function }, + .{ "defguardp", .function }, .{ "defmacro", .other }, .{ "defmacrop", .other }, + } }, + } }, + .{ "clojure", &.{ + .{ .node = "list_lit", .kind = .other, .how = .head, .heads = &.{ + .{ "ns", .module }, .{ "def", .constant }, .{ "defonce", .constant }, .{ "defn", .function }, + .{ "defn-", .function }, .{ "defmulti", .function }, .{ "defmethod", .function }, .{ "defmacro", .other }, + .{ "defrecord", .type }, .{ "deftype", .type }, .{ "defprotocol", .type }, .{ "definterface", .type }, + .{ "defstruct", .type }, + } }, + } }, + .{ "fortran", &.{ + .{ .node = "module", .kind = .module }, + .{ .node = "program", .kind = .module }, + .{ .node = "subroutine", .kind = .function }, + .{ .node = "function", .kind = .function }, + .{ .node = "derived_type_definition", .kind = .type }, + .{ .node = "variable_declaration", .kind = .variable, .how = .binding }, + } }, + .{ "ada", &.{ + .{ .node = "package_declaration", .kind = .module }, + .{ .node = "package_body", .kind = .module }, + .{ .node = "full_type_declaration", .kind = .type }, + .{ .node = "subprogram_declaration", .kind = .function }, + .{ .node = "subprogram_body", .kind = .function }, + .{ .node = "object_declaration", .kind = .variable, .how = .binding }, + .{ .node = "component_declaration", .kind = .field }, + } }, + .{ "pascal", &.{ + .{ .node = "declType", .kind = .type }, + .{ .node = "declProc", .kind = .function, .unless_in = "defProc" }, + .{ .node = "defProc", .kind = .function }, + .{ .node = "declConst", .kind = .constant }, + .{ .node = "declVar", .kind = .variable, .how = .binding }, + .{ .node = "declField", .kind = .field }, + } }, + .{ "powershell", &.{ + .{ .node = "function_statement", .kind = .function }, + .{ .node = "class_statement", .kind = .type }, + .{ .node = "class_method_definition", .kind = .function }, + .{ .node = "class_property_definition", .kind = .field }, + .{ .node = "enum_statement", .kind = .type }, + .{ .node = "enum_member", .kind = .field }, + } }, +}; + +fn rulesOf(grammar: []const u8) []const Rule { + for (symbol_rules) |entry| if (std.mem.eql(u8, entry[0], grammar)) return entry[1]; + return &.{}; +} + +/// A walk's symbols, node by node in preorder (`contextFromTree`). +const SymbolWalk = struct { + gpa: std.mem.Allocator, + rules: []const Rule, + source: []const u8, + out: std.ArrayList(Symbol) = .empty, + /// The scopes the node is in, the innermost last. + scopes: [max_scopes]Scope = undefined, + depth: u8 = 0, + + /// Where a scope ends, its kind, and the symbol its members are named + /// in (an index + 1, 0 none). + const Scope = struct { end: u32, kind: SymbolKind, symbol: u32 }; + /// Deeper scopes are their parent's. + const max_scopes = 32; + + fn visit(w: *SymbolWalk, node: ts.Node) !void { + while (w.depth > 0 and w.scopes[w.depth - 1].end <= node.startByte()) w.depth -= 1; + const in: Scope = if (w.depth > 0) w.scopes[w.depth - 1] else .{ .end = 0, .kind = .module, .symbol = 0 }; + // A test's body (a macro's) lists nothing: its types are its + // locals' (a test's `const Find = struct`). + if (in.kind == .other) return; + const kind_name = node.kind(); + const rule = for (w.rules) |r| { + if (std.mem.eql(u8, r.node, kind_name)) break r; + } else return; + const found = symbolOf(rule, node, w.source, in.kind) orelse return; + // A body's consts and vars are its locals, none of them listed. + const local = in.kind != .type and in.kind != .module and in.kind != .scope; + if (local and (found.kind == .constant or found.kind == .variable)) return; + var named = in.symbol; + if (found.name) |name| { + // A longer name is cut (a test's sentence), on a character. + var end = name.endByte(); + if (end - name.startByte() > max_name) { + end = name.startByte() + max_name; + while (end > name.startByte() and w.source[end] & 0xc0 == 0x80) end -= 1; + } + try w.out.append(w.gpa, .{ + .kind = found.kind, + .line = name.startPoint().row, + .name_start = name.startByte(), + .name_end = end, + .end = found.end, + .parent = in.symbol, + }); + // A const's or a field's members are not named in it. + if (found.kind == .type or found.kind == .function or found.kind == .module or found.kind == .scope) named = @intCast(w.out.items.len); + } + if (w.depth == max_scopes) return; + w.scopes[w.depth] = .{ .end = node.endByte(), .kind = if (found.kind == .scope) rule.kind else found.kind, .symbol = named }; + w.depth += 1; + } +}; + +/// What node `node` declares by `rule`, in a scope of kind `in`: its kind, +/// its name (null: an anonymous scope) and where its row's words end. +fn symbolOf(rule: Rule, node: ts.Node, source: []const u8, in: SymbolKind) ?struct { kind: SymbolKind, name: ?ts.Node, end: u32 } { + if (rule.unless_in.len > 0) if (node.parent()) |up| if (std.mem.eql(u8, up.kind(), rule.unless_in)) return null; + var kind = rule.kind; + var name: ?ts.Node = null; + var end = if (node.childByFieldName("body")) |body| body.startByte() else node.endByte(); + switch (rule.how) { + .plain => name = nameOf(node, rule.name), + .scope => { + name = nameOf(node, rule.name); + kind = .scope; + }, + .body => { + if (node.childByFieldName("body") == null) return null; + name = nameOf(node, rule.name); + if (name == null) kind = .scope; + }, + .declarator => { + var d = node; + while (d.childByFieldName("declarator")) |next| { + if (std.mem.eql(u8, next.kind(), "function_declarator")) kind = .function; + d = next; + } + name = nameOf(node, rule.name); + if (kind == .variable and constant(source, node.startByte(), name orelse return null)) kind = .constant; + }, + .value => { + // Named by a name, never a pattern (`const { a, b } = ...`, + // OCaml's `let () = ...`). + name = nameOf(node, rule.name); + if (name) |n| if (!nameLike(n.kind())) return null; + kind = valueKind(node, source) orelse kind; + // JavaScript's keyword is its declaration's (`const a = 1, b`). + const from = if (std.mem.eql(u8, rule.node, "variable_declarator")) (node.parent() orelse node).startByte() else node.startByte(); + if (kind == .variable and constant(source, from, name orelse return null)) kind = .constant; + }, + .binding => { + const n = node.childByFieldName(rule.name) orelse nameOf(node, rule.name) orelse return null; + if (!nameLike(n.kind())) return null; + name = n; + if (in == .type) kind = .field else if (kind == .variable and constant(source, node.startByte(), n)) kind = .constant; + }, + .head => { + const elixir = std.mem.eql(u8, rule.node, "call"); + const first = (if (elixir) node.childByFieldName("target") else node.namedChild(0)) orelse return null; + const word = source[first.startByte()..first.endByte()]; + kind = for (rule.heads) |h| { + if (std.mem.eql(u8, h[0], word)) break h[1]; + } else return null; + var second = (if (elixir) childOfKind(node, "arguments") else node.namedChild(1)) orelse return null; + if (elixir) second = second.namedChild(0) orelse return null; + if (second.childByFieldName("target")) |target| second = target; + name = if (nameLike(second.kind())) second else nameOf(second, "name"); + }, + } + // Zig's: a function's name is its prototype's, its body a Block; a + // test's its string. + if (std.mem.eql(u8, rule.node, "Decl")) { + const proto = childOfKind(node, "FnProto") orelse return null; + name = proto.childByFieldName("function"); + if (childOfKind(node, "Block")) |block| end = block.startByte(); + } else if (std.mem.eql(u8, rule.node, "TestDecl")) { + const first = node.namedChild(0) orelse return null; + if (std.mem.eql(u8, first.kind(), "Block")) return null; + name = first; + if (childOfKind(node, "Block")) |block| end = block.startByte(); + } + if (name == null and kind != .scope) return null; + if (name) |n| if (n.endByte() <= n.startByte()) return null; + return .{ .kind = kind, .name = name, .end = end }; +} + +/// The longest name a symbol has: a longer one is cut. +const max_name = 200; + +/// The node naming `node`: its field `field`, whole on its line (C++'s +/// `namespace v8::internal`, Rust's `impl Vec<T>`); without one, its +/// declarator's (C's `int *f(void)`: `f`); else the first name under it, +/// past its type, value, body and parameters (Kotlin's, Fortran's). +fn nameOf(node: ts.Node, field: []const u8) ?ts.Node { + if (field.len == 0) return null; + var n = node; + if (node.childByFieldName(field)) |f| { + if (f.startPoint().row == f.endPoint().row) return f; + n = f; + } else while (n.childByFieldName("declarator")) |d| n = d; + if (nameLike(n.kind())) return n; + if (n.childByFieldName("name")) |f| if (nameLike(f.kind())) return f; + return firstName(n, 3); +} + +fn firstName(node: ts.Node, depth: u8) ?ts.Node { + if (depth == 0) return null; + const skipped = [_][]const u8{ "type", "value", "body", "parameters", "return_type", "returns", "result", "superclass", "arguments", "default", "trait" }; + var i: u32 = 0; + while (i < node.childCount()) : (i += 1) { + const child = node.child(i) orelse continue; + if (!child.isNamed()) continue; + const field = node.fieldNameForChild(i) orelse ""; + if (for (skipped) |s| { + if (std.mem.eql(u8, s, field)) break true; + } else false) continue; + const kind = child.kind(); + if (std.mem.indexOf(u8, kind, "modifier") != null or std.mem.indexOf(u8, kind, "annotation") != null or + std.mem.indexOf(u8, kind, "parameter") != null or std.mem.indexOf(u8, kind, "attribute") != null or + std.mem.indexOf(u8, kind, "decorator") != null or std.mem.indexOf(u8, kind, "comment") != null or + std.mem.indexOf(u8, kind, "literal") != null) continue; + if (nameLike(kind)) return child; + if (firstName(child, depth - 1)) |found| return found; + } + return null; +} + +/// A node kind that is a name: an identifier, a `*_name`, a word. +fn nameLike(kind: []const u8) bool { + if (std.ascii.endsWithIgnoreCase(kind, "identifier") or std.mem.endsWith(u8, kind, "name")) return true; + for ([_][]const u8{ "word", "constant", "atom", "variable", "constructor", "type_constructor", "alias" }) |k| { + if (std.mem.eql(u8, kind, k)) return true; + } + return false; +} + +/// What a binding's value makes it, where it says (else null): Zig's +/// `struct {...}`, `error{...}`, `@This()`, `@Type(...)` a type and +/// `@import(...)` a module; JavaScript's function a function and class a +/// type; OCaml's `let f x = ...` (a parameter) a function. +fn valueKind(node: ts.Node, source: []const u8) ?SymbolKind { + if (node.childByFieldName("value")) |value| { + const kind = value.kind(); + for ([_][]const u8{ "arrow_function", "function_expression", "generator_function" }) |k| if (std.mem.eql(u8, kind, k)) return .function; + if (std.mem.eql(u8, kind, "class")) return .type; + return null; + } + if (childOfKind(node, "parameter") != null) return .function; + // Zig's value: the last of the VarDecl, under its ErrorUnionExpr. + var v = node.namedChild(node.namedChildCount() -| 1) orelse return null; + while (std.mem.eql(u8, v.kind(), "ErrorUnionExpr")) v = v.namedChild(0) orelse return null; + if (!std.mem.eql(u8, v.kind(), "SuffixExpr")) return null; + const first = v.namedChild(0) orelse return null; + const kind = first.kind(); + if (std.mem.eql(u8, kind, "ContainerDecl") or std.mem.eql(u8, kind, "ErrorSetDecl")) return .type; + if (!std.mem.eql(u8, kind, "BUILTINIDENTIFIER")) return null; + const builtin = source[first.startByte()..first.endByte()]; + if (std.mem.eql(u8, builtin, "@This") or std.mem.eql(u8, builtin, "@Type")) return .type; + if ((std.mem.eql(u8, builtin, "@import") or std.mem.eql(u8, builtin, "@cImport")) and v.namedChildCount() == 2) return .module; + return null; +} + +/// Whether a binding is a const: a keyword says so between `from` and its +/// name, or after the name before its value (Ada's `K : constant`). +fn constant(source: []const u8, from: usize, name: ts.Node) bool { + const after = source[name.endByte()..]; + const before_value = std.mem.indexOfAny(u8, after, "=\n") orelse after.len; + for ([_][]const u8{ source[@min(from, name.startByte())..name.startByte()], after[0..before_value] }) |text| { + var words = std.mem.tokenizeAny(u8, text, " \t\r\n,:()*&"); + while (words.next()) |word| for ([_][]const u8{ "const", "constexpr", "val", "final", "readonly", "parameter", "constant" }) |k| { + if (std.mem.eql(u8, word, k)) return true; + }; + } + return false; +} + fn paint(styles: []u8, source: []const u8, selected: Selected) void { const tree = selected.parser.parseString(source, null) orelse return; defer tree.destroy(); @@ -2180,3 +2753,131 @@ test "syntax: a grammar handed in at run time colours and walks as the one compi forgetLanguages(); try std.testing.expect(!supportsPath("x.mine")); } + +/// Each of `source`'s symbols as `mark qualified name`, in the walk's order. +fn symbolLines(gpa: std.mem.Allocator, path: []const u8, source: []const u8) ![]const u8 { + var made = try context(gpa, path, source); + defer made.deinit(gpa); + var out: std.Io.Writer.Allocating = .init(gpa); + defer out.deinit(); + for (made.symbols) |sym| { + if (sym.kind == .scope) continue; + try out.writer.print("{s} ", .{sym.kind.mark()}); + var chain: [8]u32 = undefined; + var n: usize = 0; + var up = sym.parent; + while (up != 0 and n < chain.len) : (up = made.symbols[up - 1].parent) { + chain[n] = up; + n += 1; + } + while (n > 0) { + n -= 1; + const s = made.symbols[chain[n] - 1]; + try out.writer.print("{s}.", .{source[s.name_start..s.name_end]}); + } + try out.writer.print("{s}\n", .{source[sym.name_start..sym.name_end]}); + } + return out.toOwnedSlice(); +} + +test "syntax symbols: a Zig file's types, functions, fields and the rest by their declarations and values, each named in the containers it is in; a function's locals and an unnamed test none of them (UX DESIGN N2)" { + if (comptime !minimal_grammars) return error.SkipZigTest; + const gpa = std.testing.allocator; + start(gpa); + defer stop(); + const source = + \\const std = @import("std"); + \\pub const Counts = struct { + \\ lines: usize = 0, + \\ pub const zero: Counts = .{}; + \\ pub fn add(c: *Counts) void { + \\ const local = 1; + \\ c.lines += local; + \\ } + \\}; + \\const Mode = enum { fast, slow }; + \\const Failure = error{ Late, Lost }; + \\const Self = @This(); + \\var hits: u32 = 0; + \\fn List(comptime T: type) type { + \\ return struct { items: []T }; + \\} + \\test "count" { + \\ const Local = struct { + \\ fn helper() void {} + \\ }; + \\ _ = Local; + \\} + \\test {} + \\extern fn tick() void; + \\ + ; + // A test's name longer than a row's room is cut, its body still none. + const xs: [250]u8 = @splat('x'); + const long = "test \"" ++ xs ++ "\" {\n const Inner = struct {};\n _ = Inner;\n}\n"; + const lines = try symbolLines(gpa, "a.zig", source ++ long); + defer gpa.free(lines); + try std.testing.expectEqualStrings( + \\n std + \\t Counts + \\m Counts.lines + \\c Counts.zero + \\f Counts.add + \\t Mode + \\m Mode.fast + \\m Mode.slow + \\t Failure + \\t Self + \\v hits + \\f List + \\m List.items + \\· "count" + \\f tick + \\ + ++ "· \"" ++ xs[0 .. max_name - 1].* ++ "\n", lines); +} + +test "syntax symbols: C, C++, Rust, Go, Python and JavaScript by their kind tables, members named in their types, an impl's in its type, locals none" { + if (!full_grammars) return error.SkipZigTest; + const gpa = std.testing.allocator; + start(gpa); + defer stop(); + const cases = [_]struct { path: []const u8, source: []const u8, want: []const u8 }{ + .{ .path = "a.c", .source = "#define LIMIT 4\nstruct point { int x; int *y; };\ntypedef struct { int a; } pair;\nenum color { RED };\nstatic int counter = 0;\nconst int limit = 4;\nint add(int a) { int local = a; return local; }\nint later(void);\nstruct point p;\n", .want = "· LIMIT\nt point\nm point.x\nm point.y\nt pair\nm pair.a\nt color\nm color.RED\nv counter\nc limit\nf add\nf later\nv p\n" }, + .{ .path = "a.cc", .source = "namespace torque {\nclass Parser : public Base {\n public:\n Parser();\n int Parse(int depth) const { return depth; }\n int depth_;\n};\nint Parser::Run(int n) { int local = n; return local; }\nusing Alias = int;\n}\nnamespace v8::internal {\nint flags;\n}\n", .want = "n torque\nt torque.Parser\nf torque.Parser.Parser\nf torque.Parser.Parse\nm torque.Parser.depth_\nf torque.Parser::Run\nt torque.Alias\nn v8::internal\nv v8::internal.flags\n" }, + .{ .path = "a.rs", .source = "mod m {\npub struct S { pub a: u32 }\nenum E { A, B(u32) }\ntrait T { fn f(&self); }\nimpl S { pub fn new() -> Self { let x = 1; S { a: x } } }\nconst C: u32 = 1;\nstatic G: u32 = 2;\nmacro_rules! mac { () => {} }\n}\n", .want = "n m\nt m.S\nm m.S.a\nt m.E\nm m.E.A\nm m.E.B\nt m.T\nf m.T.f\nf m.S.new\nc m.C\nv m.G\n· m.mac\n" }, + .{ .path = "a.go", .source = "package main\ntype S struct { A int }\ntype I interface { M() }\nconst C = 1\nvar V = 2\nfunc F() { var x = 1; _ = x }\nfunc (s *S) M() {}\n", .want = "t S\nm S.A\nt I\nf I.M\nc C\nv V\nf F\nf M\n" }, + .{ .path = "a.py", .source = "X = 1\nclass C:\n attr = 2\n def m(self):\n y = 3\n self.z = 4\ndef f():\n pass\n", .want = "v X\nt C\nm C.attr\nf C.m\nf f\n" }, + .{ .path = "a.js", .source = "const A = 1;\nlet b = 2;\nfunction f() { const local = 1; }\nclass K { field = 1; m() {} }\nconst arrow = () => 1;\nconst Klass = class {};\nconst { x, y } = A;\n", .want = "c A\nv b\nf f\nt K\nm K.field\nf K.m\nf arrow\nt Klass\n" }, + }; + for (cases) |case| { + const lines = try symbolLines(gpa, case.path, case.source); + defer gpa.free(lines); + std.testing.expectEqualStrings(case.want, lines) catch |err| { + std.debug.print("in {s}\n", .{case.path}); + return err; + }; + } +} + +test "syntax symbols: every kind table names nodes of its grammar, and a grammar with none (JSON) lists no symbol" { + if (!full_grammars) return error.SkipZigTest; + const gpa = std.testing.allocator; + start(gpa); + defer stop(); + var tables: usize = 0; + for (symbol_rules) |entry| { + const spec = for (&specs) |*spec| { + if (std.mem.eql(u8, spec.name, entry[0])) break spec; + } else return error.NoGrammar; + for (entry[1]) |rule| std.testing.expect(langOf(spec).idForNodeKind(rule.node, true) != 0) catch |err| { + std.debug.print("{s} has no node {s}\n", .{ entry[0], rule.node }); + return err; + }; + tables += 1; + } + try std.testing.expectEqual(@as(usize, 23), tables); + var made = try context(gpa, "a.json", "{\"a\": 1}\n"); + defer made.deinit(gpa); + try std.testing.expectEqual(@as(usize, 0), made.symbols.len); +} diff --git a/core/tagline.zig b/core/tagline.zig index 0ec26d2f..8e8c5d2d 100644 --- a/core/tagline.zig +++ b/core/tagline.zig @@ -12,11 +12,14 @@ const config = @import("config.zig"); const Layer = @import("Layer.zig"); const layout = @import("layout.zig"); const TagState = @import("TagState.zig"); +const Messages = @import("Messages.zig"); const Pane = panes.Pane; const Text = panes.Text; const TAG_TEXT_INSET = pardes.TAG_TEXT_INSET; const Pardes = pardes.Pardes; +/// The words a pane of each kind had in its tag before UX K' (its own +/// text until edited then): what `kindTail` says. pub const pane_tail = " " ++ config.pane_builtins_str; pub const file_pane_tail = " " ++ config.file_pane_builtins_str; fn withFileCommands(comptime tail: []const u8, comptime words: []const u8) []const u8 { @@ -41,39 +44,161 @@ pub const query_live_tail = " Del"; pub const query_frozen_tail = " Save Undock Del"; /// ...and while its Grep waits at 2000 lines for More (Stream.zig). pub const query_capped_tail = " More Del"; + +/// A file's computed words (UX K'3) by which of `Diff`, `Filter`, `Save`, +/// `Undo` and `Redo` act now (bit 0 to 4), each after a blank, `Del` last. +const file_words = words: { + const names = [_][]const u8{ "Diff", "Filter", "Save", "Undo", "Redo" }; + var table: [1 << names.len][]const u8 = undefined; + for (&table, 0..) |*words, bits| { + words.* = ""; + for (names, 0..) |name, i| if (bits >> i & 1 == 1) { + words.* = words.* ++ " " ++ name; + }; + words.* = words.* ++ " Del"; + } + break :words table; +}; + +/// A pane's computed words at rest (UX K'3): the words that act now, each +/// after a blank, read-only and made again from its state, as its path is. +/// The tag's own text (the user's) follows them. +pub fn computedWords(pane: *const Pane) []const u8 { + // A kind's: its addon's words, then Del (Kind.reopen). + if (pane.addon) |k| if (k.tail.len > 0) return k.tail.slice(); + if (pane.query) |q| return if (q.frozen) query_frozen_tail else if (q.capped) query_capped_tail else query_live_tail; + if (pane.file) |*f| { + if (f.output) |out| if (out.from == .preview) return query_live_tail; + if (f.listing != null) return " Get Del"; + const j = &f.history.journal; + var bits = fileBits(pane, f); + if (!dirty(pane)) bits &= ~@as(usize, 4); + // A step back with something in it: insert mode's mark is a step + // of none until a key types (Text.Journal.mark keeps one such, on + // top), and Undo would act on nothing. + if (j.done == 0 or (j.done == 1 and j.steps.items[0].n == 0)) bits &= ~@as(usize, 8); + if (j.done == j.steps.items.len) bits &= ~@as(usize, 16); + return file_words[bits]; + } + if (pane.command != null) return if (pane.command_done) " Del" else " Kill Del"; + return " Del"; +} + +/// The computed words pane `pane` can come to show (K'3: Save, Undo and +/// Redo come and go with its edits, a query's as it freezes): what a +/// placement leaves its tag the rows for (layout.minRows), so an edit +/// never takes a row its column did not give. A reading pane's are its +/// own (its first edit holds it): its walk folds to the rows it has with +/// them (`folded`). +pub fn widestWords(p: *const Pardes, pane: *const Pane) []const u8 { + if (pardes.Trail.reading(p, pane)) return computedWords(pane); + if (pane.query != null) return query_frozen_tail; + if (pane.file) |*f| if (f.listing == null and (if (f.output) |out| out.from != .preview else true)) + return file_words[fileBits(pane, f)]; + return computedWords(pane); +} + +/// A file's computed words that its kind can show (file_words' bits): +/// Diff for a diff (a .patch, a +Pager holding one, the Diff view), +/// Filter for a pager, Save where it saves (never a +New's, K'3: SPC f s +/// asks it a path), Undo and Redo. +fn fileBits(pane: *const Pane, f: *const panes.File.State) usize { + const diff = if (f.pager) f.pager_diff else pane.colorAlgo() == .diff or + (if (f.output) |out| std.meta.eql(out.from, panes.Output.Origin{ .cmd = .Diff }) else false); + const scratch = if (f.output) |out| std.meta.eql(out.from, panes.Output.Origin{ .cmd = .New }) else false; + const saves = panes.Output.fileTraits(f.output).saves and !scratch; + return @as(usize, @intFromBool(diff)) | @as(usize, @intFromBool(f.pager)) << 1 | @as(usize, @intFromBool(saves)) << 2 | 8 | 16; +} /// A file with changes it has not saved. pub fn dirty(pane: *const panes.Pane) bool { const f = pane.file orelse return false; return panes.Output.fileTraits(f.output).saves and (f.revision != f.saved_revision or f.disk_gone); } -/// What a column's tag says until someone edits it. +/// What a column's tag said before UX K', its own text then: a dump's own +/// text equal to it is dropped (dump.dropOldTags), and a column's exec +/// still takes its words (ninep/cols.zig paneWord). pub const column_tag_default = "New Term Find Grep Joincol Delcol"; -/// What a header says until someone edits it: for the workspace the -/// fixed builtins, plus `Restore <path>` once a dump exists. -pub fn headerDefault(p: *Pardes, what: Text.What) []const u8 { - if (what == .column) return column_tag_default; - const row = topbarDefault(p); - const d = p.last_dump orelse return row; - return std.fmt.allocPrint(p.scratch.allocator(), "{s} Restore {s}", .{ row, d }) catch row; +/// A header's computed words (UX K'2), read-only, made again from the +/// session's state as a pane tag's are: the window's, then `Restore +/// <path>` once a dump exists; a column's, with Joincol and Delcol where +/// there is a second column for them. +pub fn headerWords(p: *Pardes, what: Text.What) []const u8 { + if (what == .column) return if (p.view().ncol > 1) config.columns_words_str else config.column_words_str; + const d = p.last_dump orelse return config.window_words_str; + return std.fmt.allocPrint(p.scratch.allocator(), "{s} Restore {s}", .{ config.window_words_str, d }) catch config.window_words_str; } -/// The workspace row's words for this view: the window's row, with Fonts, -/// in a window's view alone; a terminal's view (a terminal's build, or a -/// terminal's replica of a window's session) has the row without it. -fn topbarDefault(p: *Pardes) []const u8 { - if (comptime @import("builtins.zig").capabilities.font_picker) if (@import("builtins.zig").registry.here(p, .Fonts)) return config.topbar_window_str; - return config.topbar_terminal_str; +/// A header as it is shown, read and edited: its computed words, a blank, +/// then the user's text (UX K'1), everything typed into it, as a pane +/// tag's own text follows its prefix. +pub fn headerText(p: *Pardes, t: *const Text) ![]u8 { + const own: []const u8 = t.own orelse ""; + return std.mem.concat(p.scratch.allocator(), u8, &.{ headerWords(p, t.what), " ", own }); } -/// the topbar line -- render and click dispatch must agree on this exact -/// string +/// The window's tag -- render and click dispatch must agree on this exact +/// string. pub fn topbar(p: *Pardes) []const u8 { - return p.global_tag.own orelse headerDefault(p, .workspace); + return headerText(p, &p.global_tag) catch config.window_words_str; +} + +pub fn columnTag(p: *Pardes, c: usize) []const u8 { + return headerText(p, &p.view().col_tags[c]) catch config.column_words_str; +} + +/// A header's width in glyphs as headerText makes it, made of nothing. +fn headerWidth(p: *const Pardes, t: *const Text) usize { + const tab = p.settings.tab; + const own = if (t.own) |text| panes.File.displayWidth(tab, text) else 0; + const column: []const u8 = if (p.view().ncol > 1) config.columns_words_str else config.column_words_str; + if (t.what == .column) return column.len + 1 + own; + const restore = if (p.last_dump) |d| " Restore ".len + panes.File.displayWidth(tab, d) else 0; + return config.window_words_str.len + restore + 1 + own; +} + +/// The window row's two sides (UX K'2), in cells from the window's left: +/// column 0's tag from the inset, `column` cells (its text and its caret's +/// cell; none but while layout.columnInWindowRow), and the window's tag +/// from `words` to the right edge, its last cell the caret's, a server's +/// progress after its text while one runs and the row has room for it +/// (draw.zig). Draw, the mouse, workspaceBlank and a pixel shell's grid +/// read it. +pub const WindowRow = struct { column: u16, words: u16 }; +pub fn windowRow(p: *const Pardes) WindowRow { + const v = p.view(); + const inset = @min(TAG_TEXT_INSET, v.screen_w); + const column = if (layout.columnInWindowRow(p)) @min(cellsFor(p, headerWidth(p, &v.col_tags[0]) + 1), v.screen_w - inset) else 0; + var glyphs = headerWidth(p, &p.global_tag) + 1; + // The progress where the row has room for it beside the column's + // words; else it is not drawn (draw.zig), and moves nothing. + if (sessionProgress(p)) |said| { + const with = glyphs + 2 + progressWidth(p, said); + if (cellsFor(p, with) <= v.screen_w -| (inset + column)) glyphs = with; + } + return .{ .column = column, .words = @max(v.screen_w -| cellsFor(p, glyphs), inset + column) }; +} + +/// A server's progress that is no pane's, the session's: shown at the +/// window tag's end while it runs. +pub fn sessionProgress(p: *const Pardes) ?*const Messages.Said { + for (p.messages.live[0..p.messages.live_len]) |*said| if (said.kind == .progress and said.pane == 0) return said; + return null; } -pub fn columnTag(p: *const Pardes, c: usize) []const u8 { - return p.view().col_tags[c].own orelse column_tag_default; +/// The width of a server's progress as the window's tag shows it: its +/// glyph, a blank and its words. +pub fn progressWidth(p: *const Pardes, said: *const Messages.Said) usize { + return panes.File.displayWidth(p.settings.tab, Messages.Kind.progress.glyph()) + 1 + panes.File.displayWidth(p.settings.tab, said.words()); +} + +/// The grid cells `glyphs` tagline glyphs take: layout.tagCapacity's +/// inverse. +fn cellsFor(p: *const Pardes, glyphs: usize) u16 { + const m = p.view().row_metrics; + const body: usize = @max(1, m.body_w); + const tag: usize = @max(1, m.tagline_w); + return @intCast(@min(std.math.maxInt(u16), (glyphs * tag + body - 1) / body)); } /// The header with the keyboard, when one has it. @@ -93,11 +218,14 @@ pub fn revealHeader(p: *Pardes) void { }; const text = edit.flatSurface(p.editor(), t) catch |err| return p.reportError(.at(v.active), "tag", err); const cur: usize = @intCast(@max(0, t.cur_row)); - const rows: usize = if (p.headerColumn() != null) layout.columnBarHeight(p) else p.topBarHeight(); + // Column 0's tag in the window row (UX K'2) has that row and its side. + const in_row = p.headerColumn() != null and layout.columnInWindowRow(p); + const rows: usize = if (p.headerColumn() != null and !in_row) layout.columnBarHeight(p) else p.topBarHeight(); if (cur < v.header_top) v.header_top = cur; if (rows > 0 and cur >= v.header_top + rows) v.header_top = cur + 1 - rows; const line = modal.lineSlice(text, cur); - const width = layout.tagCapacity(p, if (p.headerColumn()) |c| v.col_w[c] -| TAG_TEXT_INSET else v.screen_w -| TAG_TEXT_INSET); + const sides = windowRow(p); + const width = layout.tagCapacity(p, if (p.headerColumn()) |c| (if (in_row) sides.column else v.col_w[c] -| TAG_TEXT_INSET) else v.screen_w -| sides.words); const col = panes.File.rawDisplayCol(p.settings.tab, line, @min(@as(usize, @intCast(@max(0, t.cur_col))), line.len)); if (col < v.header_scroll) v.header_scroll = col; if (col >= v.header_scroll + width) v.header_scroll = col -| (width -| 1); @@ -120,9 +248,9 @@ fn shownDir(arena: std.mem.Allocator, pane: *Pane) ![]const u8 { return pardes.ctlfs.events.shown(dir, out); } -/// The computed start of a pane's tag -- its path and dirty marker, a -/// PDF's page, a terminal's directory -- without the space that parts it -/// from the tag's own text. It is never stored, and never edited. +/// The computed start of a pane's tag -- its path, a PDF's page, a +/// terminal's directory -- without its computed words (restPrefix). It is +/// never stored, and never edited. pub fn pathPrefix(p: *const Pardes, arena: std.mem.Allocator, pane: *Pane) ![]const u8 { // Out of rest (UX D1) the owner's word and the newest step's, each with // its ` › `, before the head: the path, the forward steps and Keep @@ -240,7 +368,9 @@ pub fn folded(p: *const Pardes, pane: *const Pane) Fold { const name = if (pane.prompt == .name) pane.input.own orelse f.path else f.path; const keep = pardes.Trail.reading(p, pane); const tail = curTail(pane); - const bare = panes.File.displayWidth(tab, name) + @as(usize, if (keep) " Keep".len else 0) + panes.File.displayWidth(tab, tail); + // Its computed words and the blank before its own text (restPrefix). + const words = panes.File.displayWidth(tab, computedWords(pane)) + 1; + const bare = panes.File.displayWidth(tab, name) + @as(usize, if (keep) " Keep".len else 0) + words + panes.File.displayWidth(tab, tail); var whole: usize = pardes.Trail.shown_steps; while (whole > 1 and rowsOf(bare + walkCells(t, whole, tab), width) > rowsOf(bare, width)) whole -= 1; const r = p.view().rects[id]; @@ -249,34 +379,38 @@ pub fn folded(p: *const Pardes, pane: *const Pane) Fold { // one the layout has given its width and not yet its height (the band // host's floor, layout.floorRows, wraps its tag at rest then). if (!keep or !walked or pane.prompt == .name or pane.collapsed or !pane.tag_expanded or r.w == 0 or r.h == 0) return .{ .whole = whole }; - // Its first line: the prefix, the space restPrefix gives a tail - // without one, the tail's first line; and the rows its others take. + // Its first line: the prefix, its computed words and their blank, the + // own text's first line; and the rows its others take. const first = std.mem.indexOfScalar(u8, tail, '\n') orelse tail.len; var below: usize = 0; if (first < tail.len) { var lines = std.mem.splitScalar(u8, tail[first + 1 ..], '\n'); while (lines.next()) |line| below += rowsOf(panes.File.displayWidth(tab, line), width); } - const gap: usize = @intFromBool(tail.len > 0 and std.mem.indexOfScalar(u8, " \t\n", tail[0]) == null); - const rest = " Keep".len + gap + panes.File.displayWidth(tab, tail[0..first]); + const rest = " Keep".len + words + panes.File.displayWidth(tab, tail[0..first]); const path = panes.File.displayWidth(tab, name); const rows = r.h -| layout.min_body_rows; if (@min(rowsOf(walkCells(t, whole, tab) + path + rest, width) + below, pardes.MAX_TAG_ROWS) <= rows) return .{ .whole = whole }; // The newest step alone, then as much of the path's end as fits, after - // a `…` cell. + // a `…` cell; where its basename does not fit beside the newest step + // (a column too narrow for its tag's words), that step folds into the + // `+N` too. const room = (rows -| below) * width; - const used = walkCells(t, 1, tab) + rest; - if (used + path <= room) return .{ .whole = 1, .squeezed = true }; - const drop = used + path + 1 - room; const base = if (std.mem.lastIndexOfScalar(u8, name, '/')) |slash| slash + 1 else 0; - var cut: usize = 0; - var cells: usize = 0; - while (cut < base and cells < drop) { - const next = modal.nextGrapheme(name, cut); - cells += panes.File.displayWidth(tab, name[cut..next]); - cut = next; + var shown: usize = 1; + while (true) : (shown -= 1) { + const used = walkCells(t, shown, tab) + rest; + if (used + path <= room) return .{ .whole = shown, .squeezed = true }; + const drop = used + path + 1 - room; + var cut: usize = 0; + var cells: usize = 0; + while (cut < base and cells < drop) { + const next = modal.nextGrapheme(name, cut); + cells += panes.File.displayWidth(tab, name[cut..next]); + cut = next; + } + if (shown == 0 or cells >= drop) return .{ .whole = shown, .cut = @min(cut, base), .squeezed = true }; } - return .{ .whole = 1, .cut = @min(cut, base), .squeezed = true }; } /// The cells a walk's words take at rest with its newest `whole` back @@ -334,38 +468,52 @@ pub fn tagPrefix(p: *Pardes, pane: *Pane) ![]u8 { /// The prefix as the tag shows it, built in `arena`. pub fn prefixIn(p: *const Pardes, arena: std.mem.Allocator, pane: *Pane) ![]u8 { - // Out of rest the head follows: its words end in their own space. - if (pardes.Trail.outOfRest(p, pane)) return arena.dupe(u8, try pathPrefix(p, arena, pane)); + // Out of rest the head follows: its words end in their own space; a + // question at rest follows the path, in place of the computed words. + if (pardes.Trail.outOfRest(p, pane) or TagState.asks(p, pane)) return arena.dupe(u8, try pathPrefix(p, arena, pane)); return restPrefix(p, arena, pane); } -/// The prefix as the tag has it at rest, whatever its state: what its own -/// text follows, so what its cursor and selections are offsets after -/// (Core.sync's `tag_lead`), and the rows it takes at rest -/// (layout.wantedTagRows). +/// The prefix as the tag has it at rest, whatever its state: its path, +/// its computed words (UX K'1) and a blank, read-only, which its own text +/// follows: what its cursor and selections are offsets after (Core.sync's +/// `tag_lead`), what an edit must leave as it is (edit.zig), and the rows +/// it takes at rest (layout.wantedTagRows). The blank is the prefix's: +/// with the own text's first word against `Del`, Look and Exec would see +/// one word. pub fn restPrefix(p: *const Pardes, arena: std.mem.Allocator, pane: *Pane) ![]u8 { - const prefix = try restPath(p, arena, pane); - // The space between the prefix and the tag's own text is the text's - // (every default starts with one), but the prefix is computed, so it - // cannot trust the text to keep it: with it deleted, Look and Exec - // would see the path and the first word as one. The prefix brings its - // own then. - const tail = curTail(pane); - if (tail.len > 0 and std.mem.indexOfScalar(u8, " \t\n", tail[0]) == null) - return std.fmt.allocPrint(arena, "{s} ", .{prefix}); - return arena.dupe(u8, prefix); + return prefixWith(p, arena, pane, computedWords(pane)); } -/// The tag's own text: what the user made of it, or until then the -/// default a pane of its kind starts with. +/// The prefix at rest with computed words `words` (restPrefix's own, or +/// the widest its pane can come to show, widestWords). +pub fn prefixWith(p: *const Pardes, arena: std.mem.Allocator, pane: *Pane, words: []const u8) ![]u8 { + return std.mem.concat(arena, u8, &.{ try restPath(p, arena, pane), words, " " }); +} + +/// The tag's own text: the user's (UX K'1), everything typed into the tag +/// after its computed words, kept as typed; until then a terminal's word +/// for its shell, none for the rest. pub fn curTail(pane: *const Pane) []const u8 { return pane.tag.own orelse defaultTail(pane); } +/// A tag's own text until it is edited: a terminal's word for its shell, +/// `Term` until the shell says its name, then `Term+<shell>` +/// (Core.acknowledgeShell; a click opens another of it), as before UX +/// K'; none for the rest. pub fn defaultTail(pane: *const Pane) []const u8 { - // A kind's: Term, its words for its panes, Collapse Del (Kind.open). - if (pane.addon) |k| if (k.tail.len > 0) return k.tail.slice(); - if (pane.query) |q| return if (q.frozen) query_frozen_tail else if (q.capped) query_capped_tail else query_live_tail; + if (!pane.isTerminal() or pane.command != null) return ""; + return if (pane.shell_tail_len > 0) pane.shell_tail[0..pane.shell_tail_len] else "Term"; +} + +/// The words a pane of its kind had in its tag before UX K', its own text +/// until edited then: an own text a dump restores equal to it is dropped +/// (dump.zig dropOldTags). +pub fn kindTail(pane: *const Pane) []const u8 { + // A kind's: its words (Kind.reopen). + if (pane.addon) |k| return k.tail.slice(); + if (pane.query != null) return computedWords(pane); if (pane.file) |file| if (file.output) |out| if (out.from == .preview) return query_live_tail; if (pane.file) |file| if (file.listing != null) return dir_pane_tail; if (pane.file) |file| if (file.pager) return if (file.pager_diff) pager_diff_pane_tail else pager_pane_tail; @@ -378,7 +526,7 @@ pub fn defaultTail(pane: *const Pane) []const u8 { if (panes.File.supportsContext(pane)) return if (speaks) lsp_context_pane_tail else context_pane_tail; if (pane.file != null) return if (speaks) lsp_pane_tail else file_pane_tail; if (pane.command != null) return command_pane_tail; - if (pane.isTerminal()) return if (pane.shell_tail_len > 0) pane.shell_tail[0..pane.shell_tail_len] else terminal_pane_tail; + if (pane.isTerminal()) return terminal_pane_tail; return pane_tail; } @@ -399,18 +547,14 @@ pub fn tagText(p: *Pardes, arena: std.mem.Allocator, pane: *Pane) ![]u8 { /// Give the keyboard to the tag in normal mode (`:`), its cursor where /// the tag last had it. The first time there is nothing to remember, and -/// it starts on Save, so that `:` and the execute key write the file. +/// it starts on the user's text (UX K'1), after the computed words: what +/// is typed goes there. pub fn enterTag(p: *Pardes, pane: *Pane) void { const t = &pane.tag; const whole = tagText(p, p.scratch.allocator(), pane) catch |err| return p.reportError(.at(p.view().active), "tag", err); if (!t.cur_pinned) { - // Save is looked for in the tag's own text, after the prefix. - const lead = whole.len - curTail(pane).len; - const tail = whole[lead..]; - var words = std.mem.tokenizeAny(u8, tail, " \t\n"); - const at = lead + while (words.next()) |word| { - if (std.mem.eql(u8, word, "Save")) break @intFromPtr(word.ptr) - @intFromPtr(tail.ptr); - } else tail.len - std.mem.trimStart(u8, tail, " ").len; + const tail = curTail(pane); + const at = whole.len - std.mem.trimStart(u8, tail, " ").len; const cursor = modal.positionAt(whole, @min(at, whole.len)); t.cur_row = @intCast(cursor.row); t.cur_col = @intCast(cursor.col); @@ -616,13 +760,18 @@ pub fn exitHeader(p: *Pardes) void { } /// Give the keyboard to a column's tag, or the workspace's for null, in -/// normal mode, its cursor where that header last had it. +/// normal mode, its cursor where that header last had it; the first time +/// on the user's text, after the computed words (UX K'1), as enterTag. pub fn enterHeader(p: *Pardes, column: ?usize) void { exitHeader(p); if (p.panes[p.view().active]) |pane| pane.focus = .body; p.view().header = if (column) |c| .{ .column = c } else .workspace; if (column) |c| p.setActiveColumn(c); const t = focusedHeader(p) orelse return exitHeader(p); + if (!t.cur_pinned) { + t.cur_row = 0; + t.cur_col = @intCast(headerWords(p, t.what).len + 1); + } takeKeyboard(t, edit.flatSurface(p.editor(), t) catch |err| return p.reportError(.at(p.view().active), "tag", err)); } @@ -641,19 +790,23 @@ pub fn headerSelection(t: *const Text, text: []const u8, row: usize) ?struct { l return .{ .lo = @max(lo, start) - start, .hi = @min(hi, end) - start }; } -/// Whether the workspace tag is blank at cell (col, row): its inset left of -/// the text, or past the text's end with two cells kept free for the caret -/// (a B1 there still types at the end of the tag). A pixel shell lets the -/// window be dragged by such a cell, as a browser by the space beside its -/// tabs: blank is no text, so no button of acme's is taken from any. A -/// column's tag and a pane's are not: their blank is where B1 types. +/// Whether the window row is blank at cell (col, row): its inset, the +/// cells between its two sides (UX K'2), or past the window's text with +/// two cells kept free for the caret (a B1 there still types at the end of +/// the tag). A pixel shell lets the window be dragged by such a cell, as a +/// browser by the space beside its tabs: blank is no text, so no button of +/// acme's is taken from any. A column's tag and a pane's are not: their +/// blank is where B1 types. pub fn workspaceBlank(p: *Pardes, col: u16, row: u16, tag_hit: ?pardes.TagHit) bool { const v = p.view(); if (row >= p.topBarHeight() or col >= v.screen_w) return false; if (col < TAG_TEXT_INSET) return true; - const text = edit.flatSurface(p.editor(), &p.global_tag) catch return false; + const sides = windowRow(p); + if (col < TAG_TEXT_INSET + sides.column) return false; + if (col < sides.words) return true; + const text = topbar(p); const scroll: usize = if (v.header != null and p.headerColumn() == null) v.header_scroll else 0; - const at = @as(usize, Layer.columnAt(p, .workspace, 0, tag_hit, false, 0) orelse (col - TAG_TEXT_INSET)) + scroll; + const at = @as(usize, Layer.columnAt(p, .workspace, 0, tag_hit, false, 0) orelse (col - sides.words)) + scroll; return at >= panes.File.displayWidth(p.settings.tab, modal.lineSlice(text, 0)) + 2; } @@ -661,15 +814,17 @@ pub fn workspaceBlank(p: *Pardes, col: u16, row: u16, tag_hit: ?pardes.TagHit) b /// pasted or restored from a dump into one becomes a space, the caret and /// the selection kept on the same characters. pub fn flattenHeaders(p: *Pardes) void { - for (p.view().col_tags[0..p.view().ncol]) |*t| flatten(t); - flatten(&p.global_tag); + for (p.view().col_tags[0..p.view().ncol]) |*t| flatten(p, t); + flatten(p, &p.global_tag); } -fn flatten(t: *Text) void { +fn flatten(p: *Pardes, t: *Text) void { const own = t.own orelse return; if (std.mem.indexOfScalar(u8, own, '\n') == null) return; - const cur = modal.offsetAt(own, .{ .row = @intCast(@max(0, t.cur_row)), .col = @intCast(@max(0, t.cur_col)) }); - const anchor = modal.offsetAt(own, .{ .row = @intCast(@max(0, t.vsel.row)), .col = @intCast(@max(0, t.vsel.col)) }); + // The caret and the anchor are in the text as shown, words and all. + const shown = headerText(p, t) catch return; + const cur = modal.offsetAt(shown, .{ .row = @intCast(@max(0, t.cur_row)), .col = @intCast(@max(0, t.cur_col)) }); + const anchor = modal.offsetAt(shown, .{ .row = @intCast(@max(0, t.vsel.row)), .col = @intCast(@max(0, t.vsel.col)) }); std.mem.replaceScalar(u8, own, '\n', ' '); t.cur_row = 0; t.cur_col = @intCast(cur); @@ -691,25 +846,22 @@ pub fn wordBoundsAtCol(str: []const u8, col: usize) ?WordBounds { return .{ .lo = lo, .hi = hi }; } -test "the workspace tag is blank left of its text and past its end, and nowhere else" { +test "the window row is blank at its inset and between its two sides, and nowhere else (UX K'2)" { const p = try Pardes.init(std.testing.allocator, .{ .cols = 80, .rows = 12, .tty_only = true }); defer p.deinit(); - p.global_tag.own = try p.gpa.dupe(u8, "Newcol Exit"); p.sync(); var arena = std.heap.ArenaAllocator.init(std.testing.allocator); defer arena.deinit(); _ = try p.render(arena.allocator()); - const end = TAG_TEXT_INSET + "Newcol Exit".len; - try std.testing.expect(workspaceBlank(p, 0, 0, null)); - try std.testing.expect(workspaceBlank(p, TAG_TEXT_INSET - 1, 0, null)); - // Every cell of the text, the gap between its words too, is not. - for (TAG_TEXT_INSET..end) |c| try std.testing.expect(!workspaceBlank(p, @intCast(c), 0, null)); - // The two cells after it are the caret's, then blank to the edge. - try std.testing.expect(!workspaceBlank(p, end, 0, null)); - try std.testing.expect(!workspaceBlank(p, end + 1, 0, null)); - try std.testing.expect(workspaceBlank(p, end + 2, 0, null)); - try std.testing.expect(workspaceBlank(p, 79, 0, null)); - // Below the workspace tag: a column's tag, a pane: never. + const sides = windowRow(p); + try std.testing.expect(sides.column > 0 and TAG_TEXT_INSET + sides.column < sides.words); + for (0..TAG_TEXT_INSET) |c| try std.testing.expect(workspaceBlank(p, @intCast(c), 0, null)); + // The column's words and their caret's cell are not; the cells between + // the two sides are; the window's words and their caret's cell are not. + for (TAG_TEXT_INSET..TAG_TEXT_INSET + sides.column) |c| try std.testing.expect(!workspaceBlank(p, @intCast(c), 0, null)); + for (TAG_TEXT_INSET + sides.column..sides.words) |c| try std.testing.expect(workspaceBlank(p, @intCast(c), 0, null)); + for (sides.words..80) |c| try std.testing.expect(!workspaceBlank(p, @intCast(c), 0, null)); + // Below the window row: a column's tag, a pane: never. for (1..12) |r| try std.testing.expect(!workspaceBlank(p, 79, @intCast(r), null)); // Hidden, there is none. p.settings.workspace_tag = false; @@ -724,10 +876,11 @@ test "a column or workspace tag is one line: a newline in it is a space" { p.view().col_tags[0].cur_col = 2; p.global_tag.own = try p.gpa.dupe(u8, "Newcol\nExit"); p.sync(); - try std.testing.expectEqualStrings("New Snarf", columnTag(p, 0)); + try std.testing.expectEqualStrings("New Term New Snarf", columnTag(p, 0)); try std.testing.expectEqualStrings("Newcol Exit", p.global_tag.own.?); + // The caret on the same character, `a` of Snarf. try std.testing.expectEqual(@as(i32, 0), p.view().col_tags[0].cur_row); - try std.testing.expectEqual(@as(i32, 6), p.view().col_tags[0].cur_col); + try std.testing.expectEqual(@as(i32, "New Term New Sn".len), p.view().col_tags[0].cur_col); try std.testing.expectEqual(pardes.COLBAR_H, layout.columnBarHeight(p)); try std.testing.expectEqual(pardes.TOPBAR_H, p.topBarHeight()); } @@ -741,3 +894,203 @@ test "a pane tag wraps a long line onto rows, and offsets map both ways" { try std.testing.expectEqual(@as(usize, 10), shown.toReal(11)); // the 'e' of Del try std.testing.expectEqual(@as(usize, 11), shown.fromReal(10)); } + +/// What pane `pane`'s tag says after its path: its computed words, the +/// blank before its own text, and that text. +fn afterPath(p: *Pardes, pane: *Pane) ![]const u8 { + const a = p.scratch.allocator(); + const whole = try tagText(p, a, pane); + return whole[(try pathPrefix(p, a, pane)).len..]; +} + +fn typeKeys(p: *Pardes, keys: []const u8) void { + for (keys) |ch| p.update(.{ .key = .{ .cp = ch, .text = &[_]u8{ch} } }); +} + +test "a pane tag's computed words are the words that act now, its own text after them (UX K'1, K'3)" { + const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 30, .tty_only = true }); + defer p.deinit(); + const pane = try p.setTestFile("one\n"); + const f = &pane.file.?; + p.sync(); + // A file reading (its jumps walk): Keep (its walk's, after its path), + // Del. + try std.testing.expectEqualStrings("/test.txt Keep Del ", try tagText(p, p.scratch.allocator(), pane)); + // Held and clean, no undo step: Del alone. + pane.trail.held = true; + try std.testing.expectEqualStrings(" Del ", try afterPath(p, pane)); + // Typed into twice: unsaved, an undo step: Save Undo Del. + typeKeys(p, "ix"); + p.update(.{ .key = .{ .cp = pardes.Key.escape } }); + typeKeys(p, "iy"); + p.update(.{ .key = .{ .cp = pardes.Key.escape } }); + try std.testing.expectEqualStrings(" Save Undo Del ", try afterPath(p, pane)); + // Undone once: a step each way, Redo after Undo. + typeKeys(p, "u"); + try std.testing.expectEqualStrings(" Save Undo Redo Del ", try afterPath(p, pane)); + // Saved: clean, Save gone. + f.saved_revision = f.revision; + try std.testing.expectEqualStrings(" Undo Redo Del ", try afterPath(p, pane)); + // A diff, a pager, a pager holding a diff: Diff, Filter first. + const path = f.path; + f.path = @constCast("/x.patch"); + try std.testing.expectEqualStrings(" Diff Undo Redo Del", computedWords(pane)); + f.path = path; + f.pager = true; + try std.testing.expectEqualStrings(" Filter Undo Redo Del", computedWords(pane)); + f.pager_diff = true; + try std.testing.expectEqualStrings(" Diff Filter Undo Redo Del", computedWords(pane)); + f.pager = false; + f.pager_diff = false; + // A +New: Del, and Undo once it is typed into (it saves nowhere). + p.newScratchBelow(0); + const scratch = p.panes[p.view().active].?; + try std.testing.expect(scratch != pane); + try std.testing.expectEqualStrings(" Del ", try afterPath(p, scratch)); + typeKeys(p, "iz"); + p.update(.{ .key = .{ .cp = pardes.Key.escape } }); + try std.testing.expectEqualStrings(" Undo Del ", try afterPath(p, scratch)); + // A kind's own words, then Del; a pane of no kind: Del. + const doc_id = p.freeSlot().?; + const doc = try pardes.Kind.open(p, doc_id, pardes.Kind.test_kind.of(p), "/tmp/words.ppm", ""); + try std.testing.expect(std.mem.endsWith(u8, computedWords(doc), " Del")); + try std.testing.expect(std.mem.indexOf(u8, computedWords(doc), "Collapse") == null); +} + +test "typing in a tag goes after its computed words, and stays the user's text through a change of state (UX K'1)" { + const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 30, .tty_only = true }); + defer p.deinit(); + const pane = try p.setTestFile("one\n"); + pane.trail.held = true; + p.sync(); + // `:` `:` gives the keyboard to the tag, on its own text, after Del. + enterTag(p, pane); + p.sync(); + typeKeys(p, "iMine"); + p.update(.{ .key = .{ .cp = pardes.Key.escape } }); + try std.testing.expectEqualStrings("Mine", pane.tag.own.?); + try std.testing.expectEqualStrings(" Del Mine", try afterPath(p, pane)); + // An edit of the computed words is refused: a Backspace at the start + // of the user's text, on the blank before it. + pane.tag.cur_col = @intCast((try restPrefix(p, p.scratch.allocator(), pane)).len); + typeKeys(p, "i"); + p.update(.{ .key = .{ .cp = pardes.Key.backspace } }); + p.update(.{ .key = .{ .cp = pardes.Key.escape } }); + try std.testing.expectEqualStrings("Mine", pane.tag.own.?); + try std.testing.expectEqualStrings(" Del Mine", try afterPath(p, pane)); + // The body changed: Save Undo come in, the user's text after them, + // the tag's caret on the same character of it. + pane.focus = .body; + typeKeys(p, "ix"); + p.update(.{ .key = .{ .cp = pardes.Key.escape } }); + p.sync(); + try std.testing.expectEqualStrings(" Save Undo Del Mine", try afterPath(p, pane)); + try std.testing.expectEqualStrings("Mine", pane.tag.own.?); + const whole = try tagText(p, p.scratch.allocator(), pane); + try std.testing.expectEqual(@as(u8, 'M'), whole[@intCast(pane.tag.cur_col)]); +} + +test "a dump of a build before UX K' restores a tag's old default own text as none, any other as the user's (UX K'1)" { + const dump = @import("dump.zig"); + const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 30, .tty_only = true }); + defer p.deinit(); + const pane = try p.setTestFile("one\n"); + // What a tag of its kind said before (its own text, once edited). + pane.tag.own = try p.gpa.dupe(u8, kindTail(pane)); + try dump.dumpState(p); + const dropped = try dump.restore(p, p.dump_out.?, "old"); + defer dropped.deinit(); + try std.testing.expect(dropped.panes[0].?.tag.own == null); + try std.testing.expectEqualStrings("/test.txt Keep Del ", try tagText(dropped, dropped.scratch.allocator(), dropped.panes[0].?)); + // Edited around: kept whole, after the computed words. + p.gpa.free(pane.tag.own.?); + pane.tag.own = try p.gpa.dupe(u8, " Save Term Collapse Follow Del Mine"); + try dump.dumpState(p); + const kept = try dump.restore(p, p.dump_out.?, "custom"); + defer kept.deinit(); + try std.testing.expectEqualStrings(" Save Term Collapse Follow Del Mine", kept.panes[0].?.tag.own.?); +} + +test "a header reads its computed words, then the user's text: typed there, kept through a change of its words (UX K'1, K'2)" { + const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 30, .tty_only = true }); + defer p.deinit(); + _ = try p.setTestFile("one\n"); + try std.testing.expectEqualStrings("Find Grep Newcol Help Exit ", topbar(p)); + try std.testing.expectEqualStrings("New Term ", columnTag(p, 0)); + // The window's tag given the keyboard starts on the user's text. + enterHeader(p, null); + typeKeys(p, "iMine"); + p.update(.{ .key = .{ .cp = pardes.Key.escape } }); + try std.testing.expectEqualStrings("Mine", p.global_tag.own.?); + try std.testing.expectEqualStrings("Find Grep Newcol Help Exit Mine", topbar(p)); + // A Backspace on the blank before it is refused: the words are no one's. + p.global_tag.cur_col = "Find Grep Newcol Help Exit ".len; + typeKeys(p, "i"); + p.update(.{ .key = .{ .cp = pardes.Key.backspace } }); + p.update(.{ .key = .{ .cp = pardes.Key.escape } }); + try std.testing.expectEqualStrings("Find Grep Newcol Help Exit Mine", topbar(p)); + // A dump: its Restore comes into the words, the user's text after it. + p.setLastDump("/tmp/a.zon"); + try std.testing.expectEqualStrings("Find Grep Newcol Help Exit Restore /tmp/a.zon Mine", topbar(p)); + // A second column: Joincol and Delcol come into every column's words. + exitHeader(p); + try std.testing.expect(p.executeBuiltinLine(0, "Newcol")); + p.sync(); + try std.testing.expectEqualStrings("New Term Joincol Delcol ", columnTag(p, 0)); + try std.testing.expectEqualStrings("New Term Joincol Delcol ", columnTag(p, 1)); + // Newcol gave the keyboard to the new column's tag, on its user's text. + try std.testing.expectEqual(@as(?usize, 1), p.headerColumn()); + typeKeys(p, "iTwo"); + p.update(.{ .key = .{ .cp = pardes.Key.escape } }); + try std.testing.expectEqualStrings("New Term Joincol Delcol Two", columnTag(p, 1)); + try std.testing.expectEqualStrings("Two", p.view().col_tags[1].own.?); +} + +test "a dump of a build before UX K' restores a header's old default own text as none, any other as the user's (UX K'1)" { + const dump = @import("dump.zig"); + const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 30, .tty_only = true }); + defer p.deinit(); + _ = try p.setTestFile("one\n"); + // What the window's and a column's tags said before, with a Restore. + p.global_tag.own = try p.gpa.dupe(u8, config.topbar_terminal_str ++ " Restore /tmp/old.zon"); + p.view().col_tags[0].own = try p.gpa.dupe(u8, column_tag_default); + try dump.dumpState(p); + const dropped = try dump.restore(p, p.dump_out.?, "old"); + defer dropped.deinit(); + try std.testing.expect(dropped.global_tag.own == null); + try std.testing.expect(dropped.view().col_tags[0].own == null); + try std.testing.expectEqualStrings("New Term ", columnTag(dropped, 0)); + // The window's row with Fonts, and no Restore, is dropped too. + p.gpa.free(p.global_tag.own.?); + p.global_tag.own = try p.gpa.dupe(u8, config.topbar_window_str); + try dump.dumpState(p); + const window = try dump.restore(p, p.dump_out.?, "window"); + defer window.deinit(); + try std.testing.expect(window.global_tag.own == null); + // Edited around: kept whole, after the computed words. + p.gpa.free(p.global_tag.own.?); + p.global_tag.own = try p.gpa.dupe(u8, config.topbar_terminal_str ++ " Mine"); + p.gpa.free(p.view().col_tags[0].own.?); + p.view().col_tags[0].own = try p.gpa.dupe(u8, "New Mine"); + try dump.dumpState(p); + const kept = try dump.restore(p, p.dump_out.?, "custom"); + defer kept.deinit(); + try std.testing.expectEqualStrings(config.topbar_terminal_str ++ " Mine", kept.global_tag.own.?); + try std.testing.expectEqualStrings("New Term New Mine", columnTag(kept, 0)); +} + +test "a server's progress goes after the window's words where the row has room for it, and moves them by nothing where it has not (UX K'2)" { + const p = try Pardes.init(std.testing.allocator, .{ .cols = 84, .rows = 20, .tty_only = true }); + defer p.deinit(); + _ = try p.setTestFile("one\n"); + const alone = windowRow(p).words; + try std.testing.expectEqual(@as(u16, 84 - "Find Grep Newcol Help Exit ".len - 1), alone); + // Too long for the row beside the column's words: not drawn, and the + // words stay where they were. + _ = Messages.say(p, .progress, pardes.MAX_PANES, "lsp zls ready \u{2014} /tmp/claude-1000/a/long/session/directory"); + try std.testing.expectEqual(alone, windowRow(p).words); + // Short: after the words, two cells between, the words left by as + // much (`⋯ zls 3/9`, 9 cells). + _ = Messages.say(p, .progress, pardes.MAX_PANES, "zls 3/9"); + try std.testing.expectEqual(alone - 2 - 9, windowRow(p).words); +} diff --git a/core/term/terminal.zig b/core/term/terminal.zig index 88eb1443..1c2310b1 100644 --- a/core/term/terminal.zig +++ b/core/term/terminal.zig @@ -418,10 +418,10 @@ pub const min_contrast: f64 = 1.5; /// `generate256Color` over the theme's sixteen), made again only when the /// theme's are not the ones `cache` was made of. pub fn filterPalette(cache: *FilterPalette, ink: *const Ink) *const [256][3]u8 { - const wanted: FilterPalette.Key = .{ .bg = ink.bg orelse ink.tag_bg, .fg = ink.fg orelse ink.tag_fg, .base = ink.base }; + const wanted: FilterPalette.Key = .{ .bg = ink.bg, .fg = ink.fg, .ansi = ink.ansi }; if (cache.key) |old| if (std.meta.eql(old, wanted)) return &cache.colors; var seed = GColor.default; - for (ink.base, 0..) |rgb, i| seed[i] = asGhostRgb(rgb); + for (ink.ansi, 0..) |rgb, i| seed[i] = asGhostRgb(rgb); const colors = GColor.generate256Color(seed, .empty, asGhostRgb(wanted.bg), asGhostRgb(wanted.fg), false); for (&cache.colors, colors) |*dst, src| dst.* = asTriple(src); cache.key = wanted; @@ -1333,6 +1333,12 @@ fn cellStyle(ink: *const Ink, ci: ghostty_vt.PageList.Cell, filtered: ?*Filter, }, else => {}, }; + // SGR faint on the page's text is the page's dim ink (DESIGN.md R15): + // toward the page, so as faint on a light theme as on a dark one. + if (cs.dim and std.meta.eql(cs.fg, plain.Color{ .rgb = ink.fg })) { + cs.fg = .{ .rgb = ink.dim }; + cs.dim = false; + } return cs; } @@ -1353,8 +1359,8 @@ pub fn filterOf(ink: *const Ink, palette: *FilterPalette, vt: ?*const ghostty_vt for (&source, 0..) |*rgb, i| rgb.* = t.colorForXterm(.{ .palette = @intCast(i) }) orelse rgb.*; } - var theme_bg = asGhostRgb(ink.bg orelse ink.tag_bg); - var theme_fg = asGhostRgb(ink.fg orelse ink.tag_fg); + var theme_bg = asGhostRgb(ink.bg); + var theme_fg = asGhostRgb(ink.fg); var dynamic_bg = if (vt) |t| t.colorForXterm(.{ .dynamic = .background }) else null; var dynamic_fg = if (vt) |t| t.colorForXterm(.{ .dynamic = .foreground }) else null; if (vt != null and vt.?.modes.get(.reverse_colors)) { @@ -1504,10 +1510,7 @@ fn colorDistance(a: GColor.RGB, b: GColor.RGB) u32 { fn ghostColor(ink: *const Ink, color: ghostty_vt.Style.Color, is_bg: bool) plain.Color { return switch (color) { - .none => blk: { - const t = if (is_bg) ink.bg else ink.fg; - break :blk if (t) |c| .{ .rgb = c } else .default; - }, + .none => if (ink.host) .default else .{ .rgb = if (is_bg) ink.bg else ink.fg }, .palette => |idx| ink.palColor(idx), .rgb => |rgb| .{ .rgb = .{ rgb.r, rgb.g, rgb.b } }, }; diff --git a/core/themes/acme.zig b/core/themes/acme.zig index 34d99805..030874fc 100644 --- a/core/themes/acme.zig +++ b/core/themes/acme.zig @@ -1,10 +1,16 @@ //! acme's yellow page — the light theme, and the one that has to resolve -//! `palette` itself. A theme that only dresses the page can leave a child's +//! `ansi` itself. A theme that only dresses the page can leave a child's //! ANSI indices alone and let the host answer them; on #ffffea that is how you //! get pale yellow `ls` output on pale yellow paper. So the sixteen below are //! darkened for paper: index 7 (the "white" a shell writes most of its output //! in) is a mid grey, and 15 (bright white) is BLACK, because a program asking //! for the brightest color on a light page means "make this stand out". +//! Each of the sixteen reads 4.5:1 on the page (DESIGN.md E1, the native +//! floor): 6 #118888 -> #038384, 8 #888888 -> #757575 and 13 #bb44bb -> +//! #b942b9, each held darker in its hue (R0); 10 #33aa33, 11 #aa7700 and 14 +//! #22aaaa held there land on their normal colour, so they go 0.06 darker +//! than it in OKLab, #016e08, #785300 and #017070 (R14: a bright one is +//! darker on a light page, as 15 is black). //! //! Every colour below that acme has is acme's own, from plan9port's acme.c //! iconinit and draw.h: the tag #eaffff and body #ffffea (each 25% of @@ -24,41 +30,40 @@ //! (draw.h's DMedblue): a navy that reads as ink until you look for it. pub const theme = .{ .name = "acme", - .bg = .{ 0xff, 0xff, 0xea }, - .fg = .{ 0x00, 0x00, 0x00 }, - .sel_bg = .{ 0xee, 0xee, 0x9e }, - .sel_fg = .{ 0x00, 0x00, 0x00 }, - .tag_bg = .{ 0xea, 0xff, 0xff }, - .tag_fg = .{ 0x00, 0x00, 0x00 }, - .tag_name_fg = .{ 0x00, 0x00, 0x99 }, - .box = .{ 0x88, 0x88, 0xcc }, - .box_dim = .{ 0xea, 0xff, 0xff }, - .kw = .{ 0x97, 0x0d, 0xae }, - .str = .{ 0x00, 0x77, 0x33 }, - .num = .{ 0xa0, 0x52, 0x00 }, + .page = .{ 0xff, 0xff, 0xea }, + .text = .{ 0x00, 0x00, 0x00 }, + .selection = .{ 0xee, 0xee, 0x9e }, + .selection_text = .{ 0x00, 0x00, 0x00 }, + .tag = .{ 0xea, 0xff, 0xff }, + .tag_text = .{ 0x00, 0x00, 0x00 }, + .tag_name = .{ 0x00, 0x00, 0x99 }, + .accent = .{ 0x88, 0x88, 0xcc }, + .keyword = .{ 0x97, 0x0d, 0xae }, + .string = .{ 0x00, 0x77, 0x33 }, + .number = .{ 0xa0, 0x52, 0x00 }, .comment = .{ 0x55, 0x55, 0x55 }, - .lineno = .{ 0x99, 0x99, 0x80 }, - .scroll_track = .{ 0x99, 0x99, 0x4c }, - .scroll_thumb = .{ 0xff, 0xff, 0xea }, + .line_number = .{ 0x99, 0x99, 0x80 }, + .rail = .{ 0x99, 0x99, 0x4c }, + .rail_thumb = .{ 0xff, 0xff, 0xea }, // acme paints a column with no window white (cols.c:187). - .empty_col = .{ 0xff, 0xff, 0xff }, - .border = .{ 0x00, 0x00, 0x00 }, + .empty_column = .{ 0xff, 0xff, 0xff }, + .rule = .{ 0x00, 0x00, 0x00 }, .tag_rule = .{ 0x88, 0x88, 0xcc }, .rule_px = 2, - .box_border = .{ 0x88, 0x88, 0xcc }, - .box_dirty = .{ 0x00, 0x00, 0x99 }, + .grip_ring = .{ 0x88, 0x88, 0xcc }, + .dirty = .{ 0x00, 0x00, 0x99 }, .rail_px = 12, - .tag_sel_bg = .{ 0x9e, 0xee, 0xee }, - // A reading pane's tag: the page's yellow, a shade down (pick-ui's). - .tag_reading_bg = .{ 0xf3, 0xf0, 0xcc }, - .sweep_bg = .{ .{ 0xee, 0xee, 0x9e }, .{ 0xaa, 0x00, 0x00 }, .{ 0x00, 0x66, 0x00 } }, - .sweep_fg = .{ .{ 0x00, 0x00, 0x00 }, .{ 0xff, 0xff, 0xff }, .{ 0xff, 0xff, 0xff } }, - .column_box = .{ 0x88, 0x88, 0xcc }, - .column_box_dim = .{ 0x88, 0x88, 0xcc }, - .palette = .{ + .tag_selection = .{ 0x9e, 0xee, 0xee }, + .sweeps = .{ + .{ .ground = .{ 0xee, 0xee, 0x9e }, .text = .{ 0x00, 0x00, 0x00 } }, + .{ .ground = .{ 0xaa, 0x00, 0x00 }, .text = .{ 0xff, 0xff, 0xff } }, + .{ .ground = .{ 0x00, 0x66, 0x00 }, .text = .{ 0xff, 0xff, 0xff } }, + }, + .column_grip = .{ 0x88, 0x88, 0xcc }, + .ansi = .{ .{ 0x00, 0x00, 0x00 }, .{ 0xaa, 0x22, 0x22 }, .{ 0x22, 0x80, 0x22 }, .{ 0x88, 0x66, 0x00 }, - .{ 0x22, 0x44, 0xbb }, .{ 0x99, 0x33, 0x99 }, .{ 0x11, 0x88, 0x88 }, .{ 0x55, 0x55, 0x55 }, - .{ 0x88, 0x88, 0x88 }, .{ 0xcc, 0x33, 0x33 }, .{ 0x33, 0xaa, 0x33 }, .{ 0xaa, 0x77, 0x00 }, - .{ 0x33, 0x55, 0xdd }, .{ 0xbb, 0x44, 0xbb }, .{ 0x22, 0xaa, 0xaa }, .{ 0x00, 0x00, 0x00 }, + .{ 0x22, 0x44, 0xbb }, .{ 0x99, 0x33, 0x99 }, .{ 0x03, 0x83, 0x84 }, .{ 0x55, 0x55, 0x55 }, + .{ 0x75, 0x75, 0x75 }, .{ 0xcc, 0x33, 0x33 }, .{ 0x01, 0x6e, 0x08 }, .{ 0x78, 0x53, 0x00 }, + .{ 0x33, 0x55, 0xdd }, .{ 0xb9, 0x42, 0xb9 }, .{ 0x01, 0x70, 0x70 }, .{ 0x00, 0x00, 0x00 }, }, }; diff --git a/core/themes/alucard.zig b/core/themes/alucard.zig index 1b5695cc..42ed888b 100644 --- a/core/themes/alucard.zig +++ b/core/themes/alucard.zig @@ -9,53 +9,53 @@ //! - unfocused tag text #6c664b -> #5d5841: 3.75:1 on #cfcfde, tag text needs 4.5:1 to be read and run //! Upstream notes: The README gives Alucard only as a palette; roles follow //! dracula.yml, UI surfaces it lacks are derived. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused tag ground #fffbeb -> #b9b9c8: 1.49:1 off the tag, now 1.26:1 (R4, H: a focus step off the tag, and the loudest) pub const theme = .{ .name = "alucard", // ~/05-genizah/dracula-theme/README.md:34 Alucard Background; role as dracula.yml editor.background *BG - .bg = .{ 0xff, 0xfb, 0xeb }, + .page = .{ 0xff, 0xfb, 0xeb }, // ~/05-genizah/dracula-theme/README.md:37 Alucard Foreground; role as dracula.yml editor.foreground *FG - .fg = .{ 0x1f, 0x1f, 0x1f }, + .text = .{ 0x1f, 0x1f, 0x1f }, // ~/05-genizah/dracula-theme/README.md:36 Alucard Selection; role as dracula.yml editor.selectionBackground *SELECTION - .sel_bg = .{ 0xcf, 0xcf, 0xde }, + .selection = .{ 0xcf, 0xcf, 0xde }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x1f, 0x1f, 0x1f }, + .selection_text = .{ 0x1f, 0x1f, 0x1f }, // ~/05-genizah/dracula-theme/README.md:36 Alucard Selection; role as dracula.yml tab.inactiveBackground (*BGDark: Alucard has no BG variants; Selection derived) - .tag_bg = .{ 0xcf, 0xcf, 0xde }, + .tag = .{ 0xcf, 0xcf, 0xde }, // ~/05-genizah/dracula-theme/README.md:38 Alucard Comment; role as dracula.yml tab.inactiveForeground *COMMENT #6c664b, adjusted - .tag_fg = .{ 0x5d, 0x58, 0x41 }, + .tag_text = .{ 0x5d, 0x58, 0x41 }, // ~/05-genizah/dracula-theme/README.md:34 Alucard Background; role as dracula.yml tab.activeBackground *BG - .tag_active_bg = .{ 0xff, 0xfb, 0xeb }, + .tag_focus = .{ 0xff, 0xfb, 0xeb }, // ~/05-genizah/dracula-theme/README.md:37 Alucard Foreground; role as dracula.yml tab.activeForeground *FG - .tag_active_fg = .{ 0x1f, 0x1f, 0x1f }, + .tag_focus_text = .{ 0x1f, 0x1f, 0x1f }, // the focused grip: ~/05-genizah/dracula-theme/README.md:42 Alucard Pink; role as dracula.yml tab.activeBorderTop *PINK - .box = .{ 0xa3, 0x14, 0x4d }, - // derived: the grip at rest, the accent #a3144d faded toward the unfocused tag #cfcfde as far as 1.6:1 off it (0.30 of the way) - .box_dim = .{ 0xc2, 0x97, 0xb3 }, + .accent = .{ 0xa3, 0x14, 0x4d }, // an unsaved grip: the original's warning colour, ~/05-genizah/dracula-theme/README.md:39 Alucard Cyan; role as dracula.yml editorWarning.foreground *CYAN - .box_dirty = .{ 0x03, 0x6a, 0x96 }, + .dirty = .{ 0x03, 0x6a, 0x96 }, // derived: the column grip, the original's type colour, ~/05-genizah/dracula-theme/README.md:39 Alucard Cyan; role as dracula.yml *CYAN - .column_box = .{ 0x03, 0x6a, 0x96 }, + .column_grip = .{ 0x03, 0x6a, 0x96 }, // ~/05-genizah/dracula-theme/README.md:42 Alucard Pink; role as dracula.yml Keywords *PINK - .kw = .{ 0xa3, 0x14, 0x4d }, + .keyword = .{ 0xa3, 0x14, 0x4d }, // ~/05-genizah/dracula-theme/README.md:45 Alucard Yellow; role as dracula.yml Strings *YELLOW - .str = .{ 0x84, 0x6e, 0x15 }, + .string = .{ 0x84, 0x6e, 0x15 }, // ~/05-genizah/dracula-theme/README.md:43 Alucard Purple; role as dracula.yml Constants *PURPLE - .num = .{ 0x64, 0x4a, 0xc9 }, + .number = .{ 0x64, 0x4a, 0xc9 }, // ~/05-genizah/dracula-theme/README.md:38 Alucard Comment; role as dracula.yml Comments *COMMENT .comment = .{ 0x6c, 0x66, 0x4b }, // ~/05-genizah/dracula-theme/README.md:38 Alucard Comment; role as dracula.yml editorLineNumber.foreground *COMMENT - .lineno = .{ 0x6c, 0x66, 0x4b }, + .line_number = .{ 0x6c, 0x66, 0x4b }, // derived: none in the original; the page - .scroll_track = .{ 0xff, 0xfb, 0xeb }, + .rail = .{ 0xff, 0xfb, 0xeb }, // derived: none in the original; line numbers, ~/05-genizah/dracula-theme/README.md:38 Alucard Comment; role as dracula.yml editorLineNumber.foreground *COMMENT - .scroll_thumb = .{ 0x6c, 0x66, 0x4b }, + .rail_thumb = .{ 0x6c, 0x66, 0x4b }, // ~/05-genizah/dracula-theme/README.md:43 Alucard Purple; role as dracula.yml editorGroup.border *PURPLE - .border = .{ 0x64, 0x4a, 0xc9 }, + .rule = .{ 0x64, 0x4a, 0xc9 }, // ~/05-genizah/dracula-theme/README.md:44 Alucard Red; role as dracula.yml editorError.foreground *RED - .diagnostic_error = .{ 0xcb, 0x3a, 0x2a }, + .@"error" = .{ 0xcb, 0x3a, 0x2a }, // ~/05-genizah/dracula-theme/README.md:39 Alucard Cyan; role as dracula.yml editorWarning.foreground *CYAN - .diagnostic_warning = .{ 0x03, 0x6a, 0x96 }, - .palette = .{ + .warning = .{ 0x03, 0x6a, 0x96 }, + .ansi = .{ .{ 0x1f, 0x1f, 0x1f }, // 0: ~/05-genizah/dracula-theme/README.md:37 Alucard Foreground (ANSI 0 derived: Dracula's ansi order with Alucard colours, dark ink as black) .{ 0xcb, 0x3a, 0x2a }, // 1: ~/05-genizah/dracula-theme/README.md:44 Alucard Red (ANSI 1 derived: Dracula's ansi order with Alucard colours, dark ink as black) .{ 0x14, 0x71, 0x0a }, // 2: ~/05-genizah/dracula-theme/README.md:40 Alucard Green (ANSI 2 derived: Dracula's ansi order with Alucard colours, dark ink as black) diff --git a/core/themes/atelier.zig b/core/themes/atelier.zig index 0ad776fa..a730a35b 100644 --- a/core/themes/atelier.zig +++ b/core/themes/atelier.zig @@ -3,36 +3,32 @@ //! designed together. See docs/typ/themes.typ for the shared role contract. pub const theme = .{ .name = "atelier", - .bg = .{ 0xff, 0xfd, 0xeb }, - .fg = .{ 0x29, 0x3f, 0x35 }, - .tag_bg = .{ 0xe4, 0xf0, 0xed }, - .tag_fg = .{ 0x3d, 0x60, 0x55 }, - .tag_name_fg = .{ 0x6e, 0x47, 0x74 }, - .tag_active_name_fg = .{ 0x65, 0x3f, 0x6b }, - .tag_active_bg = .{ 0xd3, 0xe7, 0xdf }, - .tag_active_fg = .{ 0x35, 0x58, 0x4d }, - .box = .{ 0x36, 0x82, 0x6b }, - .box_dim = .{ 0x95, 0xba, 0xa2 }, - .column_box = .{ 0x95, 0x58, 0x15 }, - .column_box_dim = .{ 0xbc, 0xa4, 0x81 }, - .kw = .{ 0x7b, 0x44, 0x89 }, - .str = .{ 0x34, 0x74, 0x3d }, - .num = .{ 0x9a, 0x58, 0x10 }, + .page = .{ 0xff, 0xfd, 0xeb }, + .text = .{ 0x29, 0x3f, 0x35 }, + .tag = .{ 0xe4, 0xf0, 0xed }, + .tag_text = .{ 0x3d, 0x60, 0x55 }, + .tag_name = .{ 0x6e, 0x47, 0x74 }, + .tag_focus = .{ 0xd3, 0xe7, 0xdf }, + .tag_focus_text = .{ 0x35, 0x58, 0x4d }, + .accent = .{ 0x36, 0x82, 0x6b }, + .column_grip = .{ 0x95, 0x58, 0x15 }, + .keyword = .{ 0x7b, 0x44, 0x89 }, + .string = .{ 0x34, 0x74, 0x3d }, + .number = .{ 0x9a, 0x58, 0x10 }, .comment = .{ 0x29, 0x7c, 0x30 }, - .lineno = .{ 0x90, 0x98, 0x80 }, - .lineno_active = .{ 0x88, 0x90, 0x78 }, - .scroll_track = .{ 0xee, 0xec, 0xcf }, - .scroll_thumb = .{ 0x9f, 0xae, 0x76 }, - .border = .{ 0xff, 0xff, 0xff }, - .sel_bg = .{ 0xed, 0xf2, 0xa5 }, - .sel_fg = .{ 0x35, 0x49, 0x2d }, - .search_bg = .{ 0xfe, 0xdd, 0x86 }, - .search_fg = .{ 0x61, 0x47, 0x15 }, - .diagnostic_error = .{ 0xb3, 0x2f, 0x27 }, - .diagnostic_warning = .{ 0x89, 0x5c, 0x00 }, - .diagnostic_info = .{ 0x29, 0x6a, 0x82 }, - .diagnostic_hint = .{ 0x51, 0x75, 0x36 }, - .palette = .{ + .line_number = .{ 0x90, 0x98, 0x80 }, + .line_number_current = .{ 0x88, 0x90, 0x78 }, + .rail = .{ 0xee, 0xec, 0xcf }, + .rail_thumb = .{ 0x9f, 0xae, 0x76 }, + .rule = .{ 0xff, 0xff, 0xff }, + .selection = .{ 0xed, 0xf2, 0xa5 }, + .selection_text = .{ 0x35, 0x49, 0x2d }, + .hit = .{ 0xfe, 0xdd, 0x86 }, + .@"error" = .{ 0xb3, 0x2f, 0x27 }, + .warning = .{ 0x89, 0x5c, 0x00 }, + .info = .{ 0x29, 0x6a, 0x82 }, + .hint = .{ 0x51, 0x75, 0x36 }, + .ansi = .{ .{ 0x29, 0x3f, 0x35 }, .{ 0xa3, 0x3d, 0x37 }, .{ 0x3c, 0x6c, 0x43 }, diff --git a/core/themes/ayu_dark.zig b/core/themes/ayu_dark.zig index 62fb29ed..a98412ba 100644 --- a/core/themes/ayu_dark.zig +++ b/core/themes/ayu_dark.zig @@ -32,59 +32,57 @@ //! terminal.*). palette = every colour of src/generated/dark.ts; alpha entries //! composited over editor.bg (editor.*) or ui.bg (others); skipped shadows: //! ui.panel.shadow, ui.popup.shadow. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #0d1017 -> #04050b: 1.03:1 off the page, now 1.10:1 (H: a band 1.1:1 off the page; R3: tone on tone) pub const theme = .{ .name = "ayu_dark", // ~/05-genizah/vscode-ayu/ayu-dark.json:106 editor.background; source ~/05-genizah/ayu-colors/src/generated/dark.ts:146 editor.bg #10141c - .bg = .{ 0x10, 0x14, 0x1c }, + .page = .{ 0x10, 0x14, 0x1c }, // ~/05-genizah/vscode-ayu/ayu-dark.json:107 editor.foreground; source ~/05-genizah/ayu-colors/src/generated/dark.ts:128 editor.fg #bfbdb6 - .fg = .{ 0xbf, 0xbd, 0xb6 }, + .text = .{ 0xbf, 0xbd, 0xb6 }, // ~/05-genizah/vscode-ayu/ayu-dark.json:112 editor.selectionBackground #3388ff40 composited over editor.background #10141c (~/05-genizah/vscode-ayu/ayu-dark.json:106 editor.background) - .sel_bg = .{ 0x19, 0x31, 0x55 }, + .selection = .{ 0x19, 0x31, 0x55 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xbf, 0xbd, 0xb6 }, + .selection_text = .{ 0xbf, 0xbd, 0xb6 }, // ~/05-genizah/vscode-ayu/ayu-dark.json:102 tab.inactiveBackground; source ~/05-genizah/ayu-colors/src/generated/dark.ts:163 ui.bg #0d1017 - .tag_bg = .{ 0x0d, 0x10, 0x17 }, + .tag = .{ 0x0d, 0x10, 0x17 }, // ~/05-genizah/vscode-ayu/ayu-dark.json:103 tab.inactiveForeground; source ~/05-genizah/ayu-colors/src/generated/dark.ts:149 ui.fg #5a6378 #5a6378, adjusted - .tag_fg = .{ 0x74, 0x7c, 0x8e }, + .tag_text = .{ 0x74, 0x7c, 0x8e }, // ~/05-genizah/vscode-ayu/ayu-dark.json:96 tab.activeBackground; source ~/05-genizah/ayu-colors/src/generated/dark.ts:146 editor.bg #10141c #10141c, adjusted - .tag_active_bg = .{ 0x33, 0x36, 0x3b }, + .tag_focus = .{ 0x33, 0x36, 0x3b }, // ~/05-genizah/vscode-ayu/ayu-dark.json:97 tab.activeForeground; source ~/05-genizah/ayu-colors/src/generated/dark.ts:128 editor.fg #bfbdb6 - .tag_active_fg = .{ 0xbf, 0xbd, 0xb6 }, + .tag_focus_text = .{ 0xbf, 0xbd, 0xb6 }, // the focused grip: ~/05-genizah/vscode-ayu/ayu-dark.json:4 focusBorder [also tab.activeBorderTop]; source ~/05-genizah/ayu-colors/src/generated/dark.ts:167 common.accent.tint #e6b450 - .box = .{ 0xe6, 0xb4, 0x50 }, - // derived: the grip at rest, the accent #e6b450 faded toward the unfocused tag #0d1017 as far as 1.6:1 off it (0.24 of the way) - .box_dim = .{ 0x41, 0x37, 0x25 }, + .accent = .{ 0xe6, 0xb4, 0x50 }, // an unsaved grip: the original's modified colour, ~/05-genizah/vscode-ayu/ayu-dark.json:145 editorGutter.modifiedBackground [also gitDecoration.modifiedResourceForeground]; source ~/05-genizah/ayu-colors/src/generated/dark.ts:118 vcs.modified #73b8ff - .box_dirty = .{ 0x73, 0xb8, 0xff }, + .dirty = .{ 0x73, 0xb8, 0xff }, // derived: the column grip, the original's type colour, ~/05-genizah/vscode-ayu/ayu-dark.json:622 tokenColors "Entity name" foreground; = syntax.entity (~/05-genizah/ayu-colors/src/generated/dark.ts:88 syntax.entity) - .column_box = .{ 0x59, 0xc2, 0xff }, + .column_grip = .{ 0x59, 0xc2, 0xff }, // ~/05-genizah/vscode-ayu/ayu-dark.json:460 tokenColors "Keyword" foreground; = syntax.keyword (~/05-genizah/ayu-colors/src/generated/dark.ts:92 syntax.keyword) - .kw = .{ 0xff, 0x8f, 0x40 }, + .keyword = .{ 0xff, 0x8f, 0x40 }, // ~/05-genizah/vscode-ayu/ayu-dark.json:384 tokenColors "String" foreground; = syntax.string (~/05-genizah/ayu-colors/src/generated/dark.ts:89 syntax.string) - .str = .{ 0xaa, 0xd9, 0x4c }, + .string = .{ 0xaa, 0xd9, 0x4c }, // ~/05-genizah/vscode-ayu/ayu-dark.json:404 tokenColors "Number" foreground; = syntax.constant (~/05-genizah/ayu-colors/src/generated/dark.ts:95 syntax.constant) - .num = .{ 0xd2, 0xa6, 0xff }, + .number = .{ 0xd2, 0xa6, 0xff }, // ~/05-genizah/vscode-ayu/ayu-dark.json:374 tokenColors "Comment" foreground; = syntax.comment (~/05-genizah/ayu-colors/src/generated/dark.ts:94 syntax.comment) .comment = .{ 0x5a, 0x66, 0x73 }, // ~/05-genizah/vscode-ayu/ayu-dark.json:108 editorLineNumber.foreground #5a6378a6 composited over editor.background #10141c (~/05-genizah/vscode-ayu/ayu-dark.json:106 editor.background) [gutter has no own bg, so editor bg] - .lineno = .{ 0x40, 0x47, 0x58 }, + .line_number = .{ 0x40, 0x47, 0x58 }, // ~/05-genizah/vscode-ayu/ayu-dark.json:109 editorLineNumber.activeForeground [gutter has no own bg, so editor bg] - .lineno_active = .{ 0x5a, 0x63, 0x78 }, + .line_number_current = .{ 0x5a, 0x63, 0x78 }, // derived: none in the original; the page - .scroll_track = .{ 0x10, 0x14, 0x1c }, + .rail = .{ 0x10, 0x14, 0x1c }, // ~/05-genizah/vscode-ayu/ayu-dark.json:44 scrollbarSlider.background #5a637866 composited over editor.background #10141c (~/05-genizah/vscode-ayu/ayu-dark.json:106 editor.background) #2e3441, adjusted - .scroll_thumb = .{ 0x31, 0x37, 0x43 }, + .rail_thumb = .{ 0x31, 0x37, 0x43 }, // ~/05-genizah/vscode-ayu/ayu-dark.json:92 editorGroup.border; source ~/05-genizah/ayu-colors/src/generated/dark.ts:150 ui.line #1b1f29 #1b1f29, adjusted - .border = .{ 0x39, 0x3b, 0x42 }, + .rule = .{ 0x39, 0x3b, 0x42 }, // ~/05-genizah/vscode-ayu/ayu-dark.json:119 editor.findMatchBackground; source ~/05-genizah/ayu-colors/src/generated/dark.ts:135 editor.findMatch.active #4c4126 - .search_bg = .{ 0x4c, 0x41, 0x26 }, - // derived: the original keeps text colours over a match; the page's text, whichever reads better on it - .search_fg = .{ 0xbf, 0xbd, 0xb6 }, + .hit = .{ 0x4c, 0x41, 0x26 }, // ~/05-genizah/vscode-ayu/ayu-dark.json:143 editorError.foreground; source ~/05-genizah/ayu-colors/src/generated/dark.ts:170 common.error #d95757 - .diagnostic_error = .{ 0xd9, 0x57, 0x57 }, + .@"error" = .{ 0xd9, 0x57, 0x57 }, // ~/05-genizah/vscode-ayu/ayu-dark.json:144 editorWarning.foreground; source ~/05-genizah/ayu-colors/src/generated/dark.ts:167 common.accent.tint #e6b450 - .diagnostic_warning = .{ 0xe6, 0xb4, 0x50 }, - .palette = .{ + .warning = .{ 0xe6, 0xb4, 0x50 }, + .ansi = .{ .{ 0x1b, 0x1f, 0x29 }, // 0: ~/05-genizah/vscode-ayu/ayu-dark.json:264 terminal.ansiBlack .{ 0xf0, 0x6b, 0x73 }, // 1: ~/05-genizah/vscode-ayu/ayu-dark.json:265 terminal.ansiRed .{ 0x70, 0xbf, 0x56 }, // 2: ~/05-genizah/vscode-ayu/ayu-dark.json:266 terminal.ansiGreen diff --git a/core/themes/ayu_light.zig b/core/themes/ayu_light.zig index 22436be7..730689c3 100644 --- a/core/themes/ayu_light.zig +++ b/core/themes/ayu_light.zig @@ -31,59 +31,62 @@ //! terminal.*). palette = every colour of src/generated/light.ts; alpha entries //! composited over editor.bg (editor.*) or ui.bg (others); skipped shadows: //! ui.panel.shadow, ui.popup.shadow. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #f8f9fa -> #f0f1f2: 1.03:1 off the page, now 1.10:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - focused tag ground #dcddde -> #d7d8d9: 1.20:1 off the tag, now 1.26:1 (R4, H: a focus step off the tag, and the loudest) +//! - focused grip #f29718 -> #ae6a01: 1.60:1 on the focused tag, now 3.03:1 (R6: 3:1) +//! - unsaved grip #478acc -> #3a7dbe: 3.22:1 on the tag, now 3.82:1 (R6: 3:1 on both tags) +//! - error #e65050 -> #d33e41: 3.64:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) +//! - warning #f29718 -> #a76501: 2.22:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "ayu_light", // ~/05-genizah/vscode-ayu/ayu-light.json:106 editor.background; source ~/05-genizah/ayu-colors/src/generated/light.ts:157 editor.bg #fcfcfc - .bg = .{ 0xfc, 0xfc, 0xfc }, + .page = .{ 0xfc, 0xfc, 0xfc }, // ~/05-genizah/vscode-ayu/ayu-light.json:107 editor.foreground; source ~/05-genizah/ayu-colors/src/generated/light.ts:140 editor.fg #5c6166 - .fg = .{ 0x5c, 0x61, 0x66 }, + .text = .{ 0x5c, 0x61, 0x66 }, // ~/05-genizah/vscode-ayu/ayu-light.json:112 editor.selectionBackground #035bd626 composited over editor.background #fcfcfc (~/05-genizah/vscode-ayu/ayu-light.json:106 editor.background) - .sel_bg = .{ 0xd7, 0xe4, 0xf6 }, + .selection = .{ 0xd7, 0xe4, 0xf6 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x5c, 0x61, 0x66 }, + .selection_text = .{ 0x5c, 0x61, 0x66 }, // ~/05-genizah/vscode-ayu/ayu-light.json:102 tab.inactiveBackground; source ~/05-genizah/ayu-colors/src/generated/light.ts:175 ui.bg #f8f9fa - .tag_bg = .{ 0xf8, 0xf9, 0xfa }, + .tag = .{ 0xf8, 0xf9, 0xfa }, // ~/05-genizah/vscode-ayu/ayu-light.json:103 tab.inactiveForeground; source ~/05-genizah/ayu-colors/src/generated/light.ts:161 ui.fg #828e9f #828e9f, adjusted - .tag_fg = .{ 0x68, 0x72, 0x7f }, + .tag_text = .{ 0x68, 0x72, 0x7f }, // ~/05-genizah/vscode-ayu/ayu-light.json:96 tab.activeBackground; source ~/05-genizah/ayu-colors/src/generated/light.ts:157 editor.bg #fcfcfc #fcfcfc, adjusted - .tag_active_bg = .{ 0xdc, 0xdd, 0xde }, + .tag_focus = .{ 0xdc, 0xdd, 0xde }, // ~/05-genizah/vscode-ayu/ayu-light.json:97 tab.activeForeground; source ~/05-genizah/ayu-colors/src/generated/light.ts:140 editor.fg #5c6166 - .tag_active_fg = .{ 0x5c, 0x61, 0x66 }, + .tag_focus_text = .{ 0x5c, 0x61, 0x66 }, // the focused grip: ~/05-genizah/vscode-ayu/ayu-light.json:4 focusBorder [also tab.activeBorderTop]; source ~/05-genizah/ayu-colors/src/generated/light.ts:179 common.accent.tint #f29718 - .box = .{ 0xf2, 0x97, 0x18 }, - // derived: the grip at rest, the accent #f29718 faded toward the unfocused tag #f8f9fa as far as 1.6:1 off it (0.62 of the way) - .box_dim = .{ 0xf4, 0xbc, 0x6e }, + .accent = .{ 0xf2, 0x97, 0x18 }, // an unsaved grip: the original's modified colour, ~/05-genizah/vscode-ayu/ayu-light.json:145 editorGutter.modifiedBackground [also gitDecoration.modifiedResourceForeground]; source ~/05-genizah/ayu-colors/src/generated/light.ts:130 vcs.modified #478acc - .box_dirty = .{ 0x47, 0x8a, 0xcc }, + .dirty = .{ 0x47, 0x8a, 0xcc }, // derived: the column grip, the original's type colour, ~/05-genizah/vscode-ayu/ayu-light.json:622 tokenColors "Entity name" foreground; = syntax.entity (~/05-genizah/ayu-colors/src/generated/light.ts:92 syntax.entity) - .column_box = .{ 0x22, 0xa4, 0xe6 }, + .column_grip = .{ 0x22, 0xa4, 0xe6 }, // ~/05-genizah/vscode-ayu/ayu-light.json:460 tokenColors "Keyword" foreground; = syntax.keyword (~/05-genizah/ayu-colors/src/generated/light.ts:100 syntax.keyword) - .kw = .{ 0xfa, 0x85, 0x32 }, + .keyword = .{ 0xfa, 0x85, 0x32 }, // ~/05-genizah/vscode-ayu/ayu-light.json:384 tokenColors "String" foreground; = syntax.string (~/05-genizah/ayu-colors/src/generated/light.ts:94 syntax.string) - .str = .{ 0x86, 0xb3, 0x00 }, + .string = .{ 0x86, 0xb3, 0x00 }, // ~/05-genizah/vscode-ayu/ayu-light.json:404 tokenColors "Number" foreground; = syntax.constant (~/05-genizah/ayu-colors/src/generated/light.ts:106 syntax.constant) - .num = .{ 0xa3, 0x7a, 0xcc }, + .number = .{ 0xa3, 0x7a, 0xcc }, // ~/05-genizah/vscode-ayu/ayu-light.json:374 tokenColors "Comment" foreground; = syntax.comment (~/05-genizah/ayu-colors/src/generated/light.ts:104 syntax.comment) .comment = .{ 0xad, 0xae, 0xb1 }, // ~/05-genizah/vscode-ayu/ayu-light.json:108 editorLineNumber.foreground #828e9f66 composited over editor.background #fcfcfc (~/05-genizah/vscode-ayu/ayu-light.json:106 editor.background) [gutter has no own bg, so editor bg] - .lineno = .{ 0xcb, 0xd0, 0xd7 }, + .line_number = .{ 0xcb, 0xd0, 0xd7 }, // ~/05-genizah/vscode-ayu/ayu-light.json:109 editorLineNumber.activeForeground #828e9fcc composited over editor.background #fcfcfc (~/05-genizah/vscode-ayu/ayu-light.json:106 editor.background) [gutter has no own bg, so editor bg] - .lineno_active = .{ 0x9a, 0xa4, 0xb2 }, + .line_number_current = .{ 0x9a, 0xa4, 0xb2 }, // derived: none in the original; the page - .scroll_track = .{ 0xfc, 0xfc, 0xfc }, + .rail = .{ 0xfc, 0xfc, 0xfc }, // ~/05-genizah/vscode-ayu/ayu-light.json:44 scrollbarSlider.background #828e9f66 composited over editor.background #fcfcfc (~/05-genizah/vscode-ayu/ayu-light.json:106 editor.background) - .scroll_thumb = .{ 0xcb, 0xd0, 0xd7 }, + .rail_thumb = .{ 0xcb, 0xd0, 0xd7 }, // ~/05-genizah/vscode-ayu/ayu-light.json:92 editorGroup.border #6b7d8f1f composited over editor.background #fcfcfc (~/05-genizah/vscode-ayu/ayu-light.json:106 editor.background); source ~/05-genizah/ayu-colors/src/generated/light.ts:162 ui.line #6b7d8f1f #eaedef, adjusted - .border = .{ 0xc5, 0xc9, 0xcb }, + .rule = .{ 0xc5, 0xc9, 0xcb }, // ~/05-genizah/vscode-ayu/ayu-light.json:119 editor.findMatchBackground; source ~/05-genizah/ayu-colors/src/generated/light.ts:146 editor.findMatch.active #ffe294 - .search_bg = .{ 0xff, 0xe2, 0x94 }, - // derived: the original keeps text colours over a match; the page's text, whichever reads better on it - .search_fg = .{ 0x5c, 0x61, 0x66 }, + .hit = .{ 0xff, 0xe2, 0x94 }, // ~/05-genizah/vscode-ayu/ayu-light.json:143 editorError.foreground; source ~/05-genizah/ayu-colors/src/generated/light.ts:182 common.error #e65050 - .diagnostic_error = .{ 0xe6, 0x50, 0x50 }, + .@"error" = .{ 0xe6, 0x50, 0x50 }, // ~/05-genizah/vscode-ayu/ayu-light.json:144 editorWarning.foreground; source ~/05-genizah/ayu-colors/src/generated/light.ts:179 common.accent.tint #f29718 - .diagnostic_warning = .{ 0xf2, 0x97, 0x18 }, - .palette = .{ + .warning = .{ 0xf2, 0x97, 0x18 }, + .ansi = .{ .{ 0x00, 0x00, 0x00 }, // 0: ~/05-genizah/vscode-ayu/ayu-light.json:264 terminal.ansiBlack .{ 0xf0, 0x6b, 0x6c }, // 1: ~/05-genizah/vscode-ayu/ayu-light.json:265 terminal.ansiRed .{ 0x6c, 0xbf, 0x43 }, // 2: ~/05-genizah/vscode-ayu/ayu-light.json:266 terminal.ansiGreen diff --git a/core/themes/ayu_mirage.zig b/core/themes/ayu_mirage.zig index 23aff67f..fcb7bcd8 100644 --- a/core/themes/ayu_mirage.zig +++ b/core/themes/ayu_mirage.zig @@ -31,59 +31,58 @@ //! terminal.*). palette = every colour of src/generated/mirage.ts; alpha //! entries composited over editor.bg (editor.*) or ui.bg (others); skipped //! shadows: ui.panel.shadow, ui.popup.shadow. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #1f2430 -> #1c212d: 1.07:1 off the page, now 1.11:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - search hit #736950 -> #58402b: 2.67:1 off the page, now 1.51:1 (R8: 1.5:1, the text reading on it) pub const theme = .{ .name = "ayu_mirage", // ~/05-genizah/vscode-ayu/ayu-mirage.json:106 editor.background; source ~/05-genizah/ayu-colors/src/generated/mirage.ts:146 editor.bg #242936 - .bg = .{ 0x24, 0x29, 0x36 }, + .page = .{ 0x24, 0x29, 0x36 }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:107 editor.foreground; source ~/05-genizah/ayu-colors/src/generated/mirage.ts:128 editor.fg #cccac2 - .fg = .{ 0xcc, 0xca, 0xc2 }, + .text = .{ 0xcc, 0xca, 0xc2 }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:112 editor.selectionBackground #409fff40 composited over editor.background #242936 (~/05-genizah/vscode-ayu/ayu-mirage.json:106 editor.background) - .sel_bg = .{ 0x2b, 0x47, 0x68 }, + .selection = .{ 0x2b, 0x47, 0x68 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xcc, 0xca, 0xc2 }, + .selection_text = .{ 0xcc, 0xca, 0xc2 }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:102 tab.inactiveBackground; source ~/05-genizah/ayu-colors/src/generated/mirage.ts:163 ui.bg #1f2430 - .tag_bg = .{ 0x1f, 0x24, 0x30 }, + .tag = .{ 0x1f, 0x24, 0x30 }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:103 tab.inactiveForeground; source ~/05-genizah/ayu-colors/src/generated/mirage.ts:149 ui.fg #707a8c #707a8c, adjusted - .tag_fg = .{ 0x84, 0x8d, 0x9c }, + .tag_text = .{ 0x84, 0x8d, 0x9c }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:96 tab.activeBackground; source ~/05-genizah/ayu-colors/src/generated/mirage.ts:146 editor.bg #242936 #242936, adjusted - .tag_active_bg = .{ 0x3f, 0x43, 0x4c }, + .tag_focus = .{ 0x3f, 0x43, 0x4c }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:97 tab.activeForeground; source ~/05-genizah/ayu-colors/src/generated/mirage.ts:128 editor.fg #cccac2 - .tag_active_fg = .{ 0xcc, 0xca, 0xc2 }, + .tag_focus_text = .{ 0xcc, 0xca, 0xc2 }, // the focused grip: ~/05-genizah/vscode-ayu/ayu-mirage.json:4 focusBorder [also tab.activeBorderTop]; source ~/05-genizah/ayu-colors/src/generated/mirage.ts:167 common.accent.tint #ffcc66 - .box = .{ 0xff, 0xcc, 0x66 }, - // derived: the grip at rest, the accent #ffcc66 faded toward the unfocused tag #1f2430 as far as 1.6:1 off it (0.20 of the way) - .box_dim = .{ 0x4c, 0x46, 0x3b }, + .accent = .{ 0xff, 0xcc, 0x66 }, // an unsaved grip: the original's modified colour, ~/05-genizah/vscode-ayu/ayu-mirage.json:145 editorGutter.modifiedBackground [also gitDecoration.modifiedResourceForeground]; source ~/05-genizah/ayu-colors/src/generated/mirage.ts:118 vcs.modified #80bfff - .box_dirty = .{ 0x80, 0xbf, 0xff }, + .dirty = .{ 0x80, 0xbf, 0xff }, // derived: the column grip, the original's type colour, ~/05-genizah/vscode-ayu/ayu-mirage.json:622 tokenColors "Entity name" foreground; = syntax.entity (~/05-genizah/ayu-colors/src/generated/mirage.ts:88 syntax.entity) - .column_box = .{ 0x73, 0xd0, 0xff }, + .column_grip = .{ 0x73, 0xd0, 0xff }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:460 tokenColors "Keyword" foreground; = syntax.keyword (~/05-genizah/ayu-colors/src/generated/mirage.ts:92 syntax.keyword) - .kw = .{ 0xff, 0xa6, 0x59 }, + .keyword = .{ 0xff, 0xa6, 0x59 }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:384 tokenColors "String" foreground; = syntax.string (~/05-genizah/ayu-colors/src/generated/mirage.ts:89 syntax.string) - .str = .{ 0xd5, 0xff, 0x80 }, + .string = .{ 0xd5, 0xff, 0x80 }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:404 tokenColors "Number" foreground; = syntax.constant (~/05-genizah/ayu-colors/src/generated/mirage.ts:95 syntax.constant) - .num = .{ 0xdf, 0xbf, 0xff }, + .number = .{ 0xdf, 0xbf, 0xff }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:374 tokenColors "Comment" foreground; = syntax.comment (~/05-genizah/ayu-colors/src/generated/mirage.ts:94 syntax.comment) .comment = .{ 0x6e, 0x7c, 0x8f }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:108 editorLineNumber.foreground #707a8c80 composited over editor.background #242936 (~/05-genizah/vscode-ayu/ayu-mirage.json:106 editor.background) [gutter has no own bg, so editor bg] - .lineno = .{ 0x4a, 0x52, 0x61 }, + .line_number = .{ 0x4a, 0x52, 0x61 }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:109 editorLineNumber.activeForeground [gutter has no own bg, so editor bg] - .lineno_active = .{ 0x70, 0x7a, 0x8c }, + .line_number_current = .{ 0x70, 0x7a, 0x8c }, // derived: none in the original; the page - .scroll_track = .{ 0x24, 0x29, 0x36 }, + .rail = .{ 0x24, 0x29, 0x36 }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:44 scrollbarSlider.background #707a8c66 composited over editor.background #242936 (~/05-genizah/vscode-ayu/ayu-mirage.json:106 editor.background) - .scroll_thumb = .{ 0x42, 0x49, 0x58 }, + .rail_thumb = .{ 0x42, 0x49, 0x58 }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:92 editorGroup.border; source ~/05-genizah/ayu-colors/src/generated/mirage.ts:150 ui.line #171b24 #171b24, adjusted - .border = .{ 0x46, 0x49, 0x4d }, + .rule = .{ 0x46, 0x49, 0x4d }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:119 editor.findMatchBackground; source ~/05-genizah/ayu-colors/src/generated/mirage.ts:135 editor.findMatch.active #736950 - .search_bg = .{ 0x73, 0x69, 0x50 }, - // derived: the original keeps text colours over a match; the page's text, whichever reads better on it - .search_fg = .{ 0xcc, 0xca, 0xc2 }, + .hit = .{ 0x73, 0x69, 0x50 }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:143 editorError.foreground; source ~/05-genizah/ayu-colors/src/generated/mirage.ts:170 common.error #ff6666 - .diagnostic_error = .{ 0xff, 0x66, 0x66 }, + .@"error" = .{ 0xff, 0x66, 0x66 }, // ~/05-genizah/vscode-ayu/ayu-mirage.json:144 editorWarning.foreground; source ~/05-genizah/ayu-colors/src/generated/mirage.ts:167 common.accent.tint #ffcc66 - .diagnostic_warning = .{ 0xff, 0xcc, 0x66 }, - .palette = .{ + .warning = .{ 0xff, 0xcc, 0x66 }, + .ansi = .{ .{ 0x17, 0x1b, 0x24 }, // 0: ~/05-genizah/vscode-ayu/ayu-mirage.json:264 terminal.ansiBlack .{ 0xf2, 0x82, 0x73 }, // 1: ~/05-genizah/vscode-ayu/ayu-mirage.json:265 terminal.ansiRed .{ 0x87, 0xd9, 0x6c }, // 2: ~/05-genizah/vscode-ayu/ayu-mirage.json:266 terminal.ansiGreen diff --git a/core/themes/catppuccin_frappe.zig b/core/themes/catppuccin_frappe.zig index 7a97ee2c..de225bdc 100644 --- a/core/themes/catppuccin_frappe.zig +++ b/core/themes/catppuccin_frappe.zig @@ -28,63 +28,62 @@ //! (groups/integrations/gitsigns.lua:11), and neo-tree uses NeoTreeModified = //! peach. Keyword = mauve directly (Statement also mauve). Diagnostic groups //! are in groups/lsp.lua (merged into editor groups by lib/mapper.lua:26). +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - search hit #506373 -> #644a3b: 1.98:1 off the page, now 1.52:1 (R8: 1.5:1, the text reading on it) +//! - hint #81c8be -> #a6d189: 6.41:1 on the page, now 7.10:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "catppuccin_frappe", // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:35 Normal bg = C.base (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:25) - .bg = .{ 0x30, 0x34, 0x46 }, + .page = .{ 0x30, 0x34, 0x46 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:35 Normal fg = C.text (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:16) - .fg = .{ 0xc6, 0xd0, 0xf5 }, + .text = .{ 0xc6, 0xd0, 0xf5 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:107 Visual bg = C.surface1 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:23) - .sel_bg = .{ 0x51, 0x57, 0x6d }, + .selection = .{ 0x51, 0x57, 0x6d }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xc6, 0xd0, 0xf5 }, + .selection_text = .{ 0xc6, 0xd0, 0xf5 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:100 StatusLineNC bg = C.mantle (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:26) - .tag_bg = .{ 0x29, 0x2c, 0x3c }, + .tag = .{ 0x29, 0x2c, 0x3c }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:100 StatusLineNC fg = C.surface1 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:23) #51576d, adjusted - .tag_fg = .{ 0x90, 0x93, 0xa2 }, + .tag_text = .{ 0x90, 0x93, 0xa2 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:99 StatusLine bg = C.mantle (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:26) #292c3c, adjusted - .tag_active_bg = .{ 0x45, 0x4a, 0x5d }, + .tag_focus = .{ 0x45, 0x4a, 0x5d }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:99 StatusLine fg = C.text (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:16) - .tag_active_fg = .{ 0xc6, 0xd0, 0xf5 }, + .tag_focus_text = .{ 0xc6, 0xd0, 0xf5 }, // the focused grip: ~/05-genizah/catppuccin-nvim/lua/catppuccin/utils/lualine.lua:20 lualine normal.a bg = C.blue (used by lua/lualine/themes/catppuccin-frappe.lua) -> C.blue (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:14) - .box = .{ 0x8c, 0xaa, 0xee }, - // derived: the grip at rest, the accent #8caaee faded toward the unfocused tag #292c3c as far as 1.6:1 off it (0.26 of the way) - .box_dim = .{ 0x43, 0x4d, 0x6a }, + .accent = .{ 0x8c, 0xaa, 0xee }, // an unsaved grip: the original's warning colour, ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:51 DiagnosticWarn fg = warning (local warning = C.yellow at line 9) -> C.yellow (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:9) - .box_dirty = .{ 0xe5, 0xc8, 0x90 }, + .dirty = .{ 0xe5, 0xc8, 0x90 }, // derived: the column grip, the original's type colour, ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:32 Type fg = C.yellow (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:9) - .column_box = .{ 0xe5, 0xc8, 0x90 }, + .column_grip = .{ 0xe5, 0xc8, 0x90 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:20 Keyword fg = C.mauve (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:5) - .kw = .{ 0xca, 0x9e, 0xe6 }, + .keyword = .{ 0xca, 0x9e, 0xe6 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:8 String fg = C.green (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:10) - .str = .{ 0xa6, 0xd1, 0x89 }, + .string = .{ 0xa6, 0xd1, 0x89 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:10 Number fg = C.peach (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:8) - .num = .{ 0xef, 0x9f, 0x76 }, + .number = .{ 0xef, 0x9f, 0x76 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:5 Comment fg = C.overlay2 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:19) .comment = .{ 0x94, 0x9c, 0xbb }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:27 LineNr fg = C.surface1 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:23) - .lineno = .{ 0x51, 0x57, 0x6d }, + .line_number = .{ 0x51, 0x57, 0x6d }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:28 CursorLineNr fg = C.lavender (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:15) - .lineno_active = .{ 0xba, 0xbb, 0xf1 }, + .line_number_current = .{ 0xba, 0xbb, 0xf1 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:72 PmenuSbar bg = C.surface0 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:24) - .scroll_track = .{ 0x41, 0x45, 0x59 }, + .rail = .{ 0x41, 0x45, 0x59 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:73 PmenuThumb bg = C.overlay0 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:21) - .scroll_thumb = .{ 0x73, 0x79, 0x94 }, + .rail_thumb = .{ 0x73, 0x79, 0x94 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:114 WinSeparator fg = C.crust (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:27) #232634, adjusted - .border = .{ 0x51, 0x56, 0x6a }, + .rule = .{ 0x51, 0x56, 0x6a }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:91 Search bg = U.darken(C.sky, 0.30, C.base) = blend(fg sky #99d1db, bg base #303446, alpha 0.3) per ~/05-genizah/catppuccin-nvim/lua/catppuccin/utils/colors.lua:29 -> #506373 - .search_bg = .{ 0x50, 0x63, 0x73 }, - // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:91 Search fg = C.text (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:16) - .search_fg = .{ 0xc6, 0xd0, 0xf5 }, + .hit = .{ 0x50, 0x63, 0x73 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:50 DiagnosticError fg = error (local error = C.red at line 8) -> C.red (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:6) - .diagnostic_error = .{ 0xe7, 0x82, 0x84 }, + .@"error" = .{ 0xe7, 0x82, 0x84 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:51 DiagnosticWarn fg = warning (local warning = C.yellow at line 9) -> C.yellow (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:9) - .diagnostic_warning = .{ 0xe5, 0xc8, 0x90 }, + .warning = .{ 0xe5, 0xc8, 0x90 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:52 DiagnosticInfo fg = info (local info = C.sky at line 10) -> C.sky (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:12) - .diagnostic_info = .{ 0x99, 0xd1, 0xdb }, + .info = .{ 0x99, 0xd1, 0xdb }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:53 DiagnosticHint fg = hint (local hint = C.teal at line 11) -> C.teal (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/frappe.lua:11) - .diagnostic_hint = .{ 0x81, 0xc8, 0xbe }, - .palette = .{ + .hint = .{ 0x81, 0xc8, 0xbe }, + .ansi = .{ .{ 0x51, 0x57, 0x6d }, // 0: ~/05-genizah/catppuccin-palette/palette.json:1470 frappe.ansiColors.black.normal .{ 0xe7, 0x82, 0x84 }, // 1: ~/05-genizah/catppuccin-palette/palette.json:1514 frappe.ansiColors.red.normal .{ 0xa6, 0xd1, 0x89 }, // 2: ~/05-genizah/catppuccin-palette/palette.json:1558 frappe.ansiColors.green.normal diff --git a/core/themes/catppuccin_latte.zig b/core/themes/catppuccin_latte.zig index 259198b4..03c95690 100644 --- a/core/themes/catppuccin_latte.zig +++ b/core/themes/catppuccin_latte.zig @@ -28,63 +28,68 @@ //! (groups/integrations/gitsigns.lua:11), and neo-tree uses NeoTreeModified = //! peach. Keyword = mauve directly (Statement also mauve). Diagnostic groups //! are in groups/lsp.lua (merged into editor groups by lib/mapper.lua:26). +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #e6e9ef -> #e3e6ec: 1.08:1 off the page, now 1.11:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - focused tag ground #cdd0da -> #cbced4: 1.23:1 off the tag, now 1.26:1 (R4, H: a focus step off the tag, and the loudest) +//! - unsaved grip #df8e1d -> #a36400: 2.09:1 on the tag, now 3.83:1 (R6: 3:1 on both tags) +//! - selection text #4c4f69 -> #4a4d67: 4.39:1 on the selection, now 4.53:1 (R7: 4.5:1) +//! - search hit #a8daf0 -> #f2bc85: 1.33:1 off the page, now 1.51:1 (R8: 1.5:1, the text reading on it) +//! - warning #df8e1d -> #9d6000: 2.31:1 on the page, now 4.52:1 (R9: 4.5:1, told from the text and the others) +//! - info #04a5e5 -> #0575a4: 2.47:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) +//! - hint #179299 -> #097a81: 3.31:1 on the page, now 4.52:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "catppuccin_latte", // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:35 Normal bg = C.base (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:25) - .bg = .{ 0xef, 0xf1, 0xf5 }, + .page = .{ 0xef, 0xf1, 0xf5 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:35 Normal fg = C.text (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:16) - .fg = .{ 0x4c, 0x4f, 0x69 }, + .text = .{ 0x4c, 0x4f, 0x69 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:107 Visual bg = C.surface1 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:23) - .sel_bg = .{ 0xbc, 0xc0, 0xcc }, + .selection = .{ 0xbc, 0xc0, 0xcc }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x4c, 0x4f, 0x69 }, + .selection_text = .{ 0x4c, 0x4f, 0x69 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:100 StatusLineNC bg = C.mantle (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:26) - .tag_bg = .{ 0xe6, 0xe9, 0xef }, + .tag = .{ 0xe6, 0xe9, 0xef }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:100 StatusLineNC fg = C.surface1 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:23) #bcc0cc, adjusted - .tag_fg = .{ 0x66, 0x68, 0x6e }, + .tag_text = .{ 0x66, 0x68, 0x6e }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:99 StatusLine bg = C.mantle (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:26) #e6e9ef, adjusted - .tag_active_bg = .{ 0xcd, 0xd0, 0xda }, + .tag_focus = .{ 0xcd, 0xd0, 0xda }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:99 StatusLine fg = C.text (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:16) - .tag_active_fg = .{ 0x4c, 0x4f, 0x69 }, + .tag_focus_text = .{ 0x4c, 0x4f, 0x69 }, // the focused grip: ~/05-genizah/catppuccin-nvim/lua/catppuccin/utils/lualine.lua:20 lualine normal.a bg = C.blue (used by lua/lualine/themes/catppuccin-latte.lua) -> C.blue (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:14) - .box = .{ 0x1e, 0x66, 0xf5 }, - // derived: the grip at rest, the accent #1e66f5 faded toward the unfocused tag #e6e9ef as far as 1.6:1 off it (0.38 of the way) - .box_dim = .{ 0x9a, 0xb7, 0xf1 }, + .accent = .{ 0x1e, 0x66, 0xf5 }, // an unsaved grip: the original's warning colour, ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:51 DiagnosticWarn fg = warning (local warning = C.yellow at line 9) -> C.yellow (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:9) - .box_dirty = .{ 0xdf, 0x8e, 0x1d }, + .dirty = .{ 0xdf, 0x8e, 0x1d }, // derived: the column grip, the original's type colour, ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:32 Type fg = C.yellow (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:9) - .column_box = .{ 0xdf, 0x8e, 0x1d }, + .column_grip = .{ 0xdf, 0x8e, 0x1d }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:20 Keyword fg = C.mauve (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:5) - .kw = .{ 0x88, 0x39, 0xef }, + .keyword = .{ 0x88, 0x39, 0xef }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:8 String fg = C.green (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:10) - .str = .{ 0x40, 0xa0, 0x2b }, + .string = .{ 0x40, 0xa0, 0x2b }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:10 Number fg = C.peach (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:8) - .num = .{ 0xfe, 0x64, 0x0b }, + .number = .{ 0xfe, 0x64, 0x0b }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:5 Comment fg = C.overlay2 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:19) .comment = .{ 0x7c, 0x7f, 0x93 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:27 LineNr fg = C.surface1 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:23) - .lineno = .{ 0xbc, 0xc0, 0xcc }, + .line_number = .{ 0xbc, 0xc0, 0xcc }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:28 CursorLineNr fg = C.lavender (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:15) - .lineno_active = .{ 0x72, 0x87, 0xfd }, + .line_number_current = .{ 0x72, 0x87, 0xfd }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:72 PmenuSbar bg = C.surface0 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:24) - .scroll_track = .{ 0xcc, 0xd0, 0xda }, + .rail = .{ 0xcc, 0xd0, 0xda }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:73 PmenuThumb bg = C.overlay0 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:21) - .scroll_thumb = .{ 0x9c, 0xa0, 0xb0 }, + .rail_thumb = .{ 0x9c, 0xa0, 0xb0 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:114 WinSeparator fg = C.crust (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:27) #dce0e8, adjusted - .border = .{ 0xbc, 0xc0, 0xcc }, + .rule = .{ 0xbc, 0xc0, 0xcc }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:91 Search bg = U.darken(C.sky, 0.30, C.base) = blend(fg sky #04a5e5, bg base #eff1f5, alpha 0.3) per ~/05-genizah/catppuccin-nvim/lua/catppuccin/utils/colors.lua:29 -> #a8daf0 - .search_bg = .{ 0xa8, 0xda, 0xf0 }, - // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:91 Search fg = C.text (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:16) - .search_fg = .{ 0x4c, 0x4f, 0x69 }, + .hit = .{ 0xa8, 0xda, 0xf0 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:50 DiagnosticError fg = error (local error = C.red at line 8) -> C.red (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:6) - .diagnostic_error = .{ 0xd2, 0x0f, 0x39 }, + .@"error" = .{ 0xd2, 0x0f, 0x39 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:51 DiagnosticWarn fg = warning (local warning = C.yellow at line 9) -> C.yellow (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:9) - .diagnostic_warning = .{ 0xdf, 0x8e, 0x1d }, + .warning = .{ 0xdf, 0x8e, 0x1d }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:52 DiagnosticInfo fg = info (local info = C.sky at line 10) -> C.sky (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:12) - .diagnostic_info = .{ 0x04, 0xa5, 0xe5 }, + .info = .{ 0x04, 0xa5, 0xe5 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:53 DiagnosticHint fg = hint (local hint = C.teal at line 11) -> C.teal (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/latte.lua:11) - .diagnostic_hint = .{ 0x17, 0x92, 0x99 }, - .palette = .{ + .hint = .{ 0x17, 0x92, 0x99 }, + .ansi = .{ .{ 0x5c, 0x5f, 0x77 }, // 0: ~/05-genizah/catppuccin-palette/palette.json:562 latte.ansiColors.black.normal .{ 0xd2, 0x0f, 0x39 }, // 1: ~/05-genizah/catppuccin-palette/palette.json:606 latte.ansiColors.red.normal .{ 0x40, 0xa0, 0x2b }, // 2: ~/05-genizah/catppuccin-palette/palette.json:650 latte.ansiColors.green.normal diff --git a/core/themes/catppuccin_macchiato.zig b/core/themes/catppuccin_macchiato.zig index 918c3257..db75f482 100644 --- a/core/themes/catppuccin_macchiato.zig +++ b/core/themes/catppuccin_macchiato.zig @@ -28,63 +28,62 @@ //! (groups/integrations/gitsigns.lua:11), and neo-tree uses NeoTreeModified = //! peach. Keyword = mauve directly (Statement also mauve). Diagnostic groups //! are in groups/lsp.lua (merged into editor groups by lib/mapper.lua:26). +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #1e2030 -> #1d1f2f: 1.09:1 off the page, now 1.11:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - hint #8bd5ca -> #a6da95: 8.74:1 on the page, now 9.17:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "catppuccin_macchiato", // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:35 Normal bg = C.base (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:25) - .bg = .{ 0x24, 0x27, 0x3a }, + .page = .{ 0x24, 0x27, 0x3a }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:35 Normal fg = C.text (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:16) - .fg = .{ 0xca, 0xd3, 0xf5 }, + .text = .{ 0xca, 0xd3, 0xf5 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:107 Visual bg = C.surface1 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:23) - .sel_bg = .{ 0x49, 0x4d, 0x64 }, + .selection = .{ 0x49, 0x4d, 0x64 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xca, 0xd3, 0xf5 }, + .selection_text = .{ 0xca, 0xd3, 0xf5 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:100 StatusLineNC bg = C.mantle (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:26) - .tag_bg = .{ 0x1e, 0x20, 0x30 }, + .tag = .{ 0x1e, 0x20, 0x30 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:100 StatusLineNC fg = C.surface1 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:23) #494d64, adjusted - .tag_fg = .{ 0x87, 0x8a, 0x99 }, + .tag_text = .{ 0x87, 0x8a, 0x99 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:99 StatusLine bg = C.mantle (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:26) #1e2030, adjusted - .tag_active_bg = .{ 0x3d, 0x40, 0x53 }, + .tag_focus = .{ 0x3d, 0x40, 0x53 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:99 StatusLine fg = C.text (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:16) - .tag_active_fg = .{ 0xca, 0xd3, 0xf5 }, + .tag_focus_text = .{ 0xca, 0xd3, 0xf5 }, // the focused grip: ~/05-genizah/catppuccin-nvim/lua/catppuccin/utils/lualine.lua:20 lualine normal.a bg = C.blue (used by lua/lualine/themes/catppuccin-macchiato.lua) -> C.blue (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:14) - .box = .{ 0x8a, 0xad, 0xf4 }, - // derived: the grip at rest, the accent #8aadf4 faded toward the unfocused tag #1e2030 as far as 1.6:1 off it (0.24 of the way) - .box_dim = .{ 0x38, 0x42, 0x5f }, + .accent = .{ 0x8a, 0xad, 0xf4 }, // an unsaved grip: the original's warning colour, ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:51 DiagnosticWarn fg = warning (local warning = C.yellow at line 9) -> C.yellow (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:9) - .box_dirty = .{ 0xee, 0xd4, 0x9f }, + .dirty = .{ 0xee, 0xd4, 0x9f }, // derived: the column grip, the original's type colour, ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:32 Type fg = C.yellow (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:9) - .column_box = .{ 0xee, 0xd4, 0x9f }, + .column_grip = .{ 0xee, 0xd4, 0x9f }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:20 Keyword fg = C.mauve (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:5) - .kw = .{ 0xc6, 0xa0, 0xf6 }, + .keyword = .{ 0xc6, 0xa0, 0xf6 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:8 String fg = C.green (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:10) - .str = .{ 0xa6, 0xda, 0x95 }, + .string = .{ 0xa6, 0xda, 0x95 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:10 Number fg = C.peach (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:8) - .num = .{ 0xf5, 0xa9, 0x7f }, + .number = .{ 0xf5, 0xa9, 0x7f }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:5 Comment fg = C.overlay2 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:19) .comment = .{ 0x93, 0x9a, 0xb7 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:27 LineNr fg = C.surface1 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:23) - .lineno = .{ 0x49, 0x4d, 0x64 }, + .line_number = .{ 0x49, 0x4d, 0x64 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:28 CursorLineNr fg = C.lavender (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:15) - .lineno_active = .{ 0xb7, 0xbd, 0xf8 }, + .line_number_current = .{ 0xb7, 0xbd, 0xf8 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:72 PmenuSbar bg = C.surface0 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:24) - .scroll_track = .{ 0x36, 0x3a, 0x4f }, + .rail = .{ 0x36, 0x3a, 0x4f }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:73 PmenuThumb bg = C.overlay0 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:21) - .scroll_thumb = .{ 0x6e, 0x73, 0x8d }, + .rail_thumb = .{ 0x6e, 0x73, 0x8d }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:114 WinSeparator fg = C.crust (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:27) #181926, adjusted - .border = .{ 0x46, 0x49, 0x5c }, + .rule = .{ 0x46, 0x49, 0x5c }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:91 Search bg = U.darken(C.sky, 0.30, C.base) = blend(fg sky #91d7e3, bg base #24273a, alpha 0.3) per ~/05-genizah/catppuccin-nvim/lua/catppuccin/utils/colors.lua:29 -> #455c6d - .search_bg = .{ 0x45, 0x5c, 0x6d }, - // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:91 Search fg = C.text (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:16) - .search_fg = .{ 0xca, 0xd3, 0xf5 }, + .hit = .{ 0x45, 0x5c, 0x6d }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:50 DiagnosticError fg = error (local error = C.red at line 8) -> C.red (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:6) - .diagnostic_error = .{ 0xed, 0x87, 0x96 }, + .@"error" = .{ 0xed, 0x87, 0x96 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:51 DiagnosticWarn fg = warning (local warning = C.yellow at line 9) -> C.yellow (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:9) - .diagnostic_warning = .{ 0xee, 0xd4, 0x9f }, + .warning = .{ 0xee, 0xd4, 0x9f }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:52 DiagnosticInfo fg = info (local info = C.sky at line 10) -> C.sky (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:12) - .diagnostic_info = .{ 0x91, 0xd7, 0xe3 }, + .info = .{ 0x91, 0xd7, 0xe3 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:53 DiagnosticHint fg = hint (local hint = C.teal at line 11) -> C.teal (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/macchiato.lua:11) - .diagnostic_hint = .{ 0x8b, 0xd5, 0xca }, - .palette = .{ + .hint = .{ 0x8b, 0xd5, 0xca }, + .ansi = .{ .{ 0x49, 0x4d, 0x64 }, // 0: ~/05-genizah/catppuccin-palette/palette.json:2378 macchiato.ansiColors.black.normal .{ 0xed, 0x87, 0x96 }, // 1: ~/05-genizah/catppuccin-palette/palette.json:2422 macchiato.ansiColors.red.normal .{ 0xa6, 0xda, 0x95 }, // 2: ~/05-genizah/catppuccin-palette/palette.json:2466 macchiato.ansiColors.green.normal diff --git a/core/themes/catppuccin_mocha.zig b/core/themes/catppuccin_mocha.zig index fb34a923..dae31a69 100644 --- a/core/themes/catppuccin_mocha.zig +++ b/core/themes/catppuccin_mocha.zig @@ -28,63 +28,62 @@ //! (groups/integrations/gitsigns.lua:11), and neo-tree uses NeoTreeModified = //! peach. Keyword = mauve directly (Statement also mauve). Diagnostic groups //! are in groups/lsp.lua (merged into editor groups by lib/mapper.lua:26). +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #181825 -> #151522: 1.07:1 off the page, now 1.10:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - hint #94e2d5 -> #a6e3a1: 11.01:1 on the page, now 11.03:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "catppuccin_mocha", // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:35 Normal bg = C.base (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:25) - .bg = .{ 0x1e, 0x1e, 0x2e }, + .page = .{ 0x1e, 0x1e, 0x2e }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:35 Normal fg = C.text (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:16) - .fg = .{ 0xcd, 0xd6, 0xf4 }, + .text = .{ 0xcd, 0xd6, 0xf4 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:107 Visual bg = C.surface1 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:23) - .sel_bg = .{ 0x45, 0x47, 0x5a }, + .selection = .{ 0x45, 0x47, 0x5a }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xcd, 0xd6, 0xf4 }, + .selection_text = .{ 0xcd, 0xd6, 0xf4 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:100 StatusLineNC bg = C.mantle (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:26) - .tag_bg = .{ 0x18, 0x18, 0x25 }, + .tag = .{ 0x18, 0x18, 0x25 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:100 StatusLineNC fg = C.surface1 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:23) #45475a, adjusted - .tag_fg = .{ 0x81, 0x82, 0x8f }, + .tag_text = .{ 0x81, 0x82, 0x8f }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:99 StatusLine bg = C.mantle (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:26) #181825, adjusted - .tag_active_bg = .{ 0x39, 0x3a, 0x4a }, + .tag_focus = .{ 0x39, 0x3a, 0x4a }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:99 StatusLine fg = C.text (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:16) - .tag_active_fg = .{ 0xcd, 0xd6, 0xf4 }, + .tag_focus_text = .{ 0xcd, 0xd6, 0xf4 }, // the focused grip: ~/05-genizah/catppuccin-nvim/lua/catppuccin/utils/lualine.lua:20 lualine normal.a bg = C.blue (used by lua/lualine/themes/catppuccin-mocha.lua) -> C.blue (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:14) - .box = .{ 0x89, 0xb4, 0xfa }, - // derived: the grip at rest, the accent #89b4fa faded toward the unfocused tag #181825 as far as 1.6:1 off it (0.24 of the way) - .box_dim = .{ 0x33, 0x3d, 0x58 }, + .accent = .{ 0x89, 0xb4, 0xfa }, // an unsaved grip: the original's warning colour, ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:51 DiagnosticWarn fg = warning (local warning = C.yellow at line 9) -> C.yellow (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:9) - .box_dirty = .{ 0xf9, 0xe2, 0xaf }, + .dirty = .{ 0xf9, 0xe2, 0xaf }, // derived: the column grip, the original's type colour, ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:32 Type fg = C.yellow (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:9) - .column_box = .{ 0xf9, 0xe2, 0xaf }, + .column_grip = .{ 0xf9, 0xe2, 0xaf }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:20 Keyword fg = C.mauve (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:5) - .kw = .{ 0xcb, 0xa6, 0xf7 }, + .keyword = .{ 0xcb, 0xa6, 0xf7 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:8 String fg = C.green (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:10) - .str = .{ 0xa6, 0xe3, 0xa1 }, + .string = .{ 0xa6, 0xe3, 0xa1 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:10 Number fg = C.peach (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:8) - .num = .{ 0xfa, 0xb3, 0x87 }, + .number = .{ 0xfa, 0xb3, 0x87 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/syntax.lua:5 Comment fg = C.overlay2 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:19) .comment = .{ 0x93, 0x99, 0xb2 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:27 LineNr fg = C.surface1 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:23) - .lineno = .{ 0x45, 0x47, 0x5a }, + .line_number = .{ 0x45, 0x47, 0x5a }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:28 CursorLineNr fg = C.lavender (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:15) - .lineno_active = .{ 0xb4, 0xbe, 0xfe }, + .line_number_current = .{ 0xb4, 0xbe, 0xfe }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:72 PmenuSbar bg = C.surface0 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:24) - .scroll_track = .{ 0x31, 0x32, 0x44 }, + .rail = .{ 0x31, 0x32, 0x44 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:73 PmenuThumb bg = C.overlay0 (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:21) - .scroll_thumb = .{ 0x6c, 0x70, 0x86 }, + .rail_thumb = .{ 0x6c, 0x70, 0x86 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:114 WinSeparator fg = C.crust (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:27) #11111b, adjusted - .border = .{ 0x3e, 0x40, 0x4f }, + .rule = .{ 0x3e, 0x40, 0x4f }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:91 Search bg = U.darken(C.sky, 0.30, C.base) = blend(fg sky #89dceb, bg base #1e1e2e, alpha 0.3) per ~/05-genizah/catppuccin-nvim/lua/catppuccin/utils/colors.lua:29 -> #3e5767 - .search_bg = .{ 0x3e, 0x57, 0x67 }, - // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/editor.lua:91 Search fg = C.text (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:16) - .search_fg = .{ 0xcd, 0xd6, 0xf4 }, + .hit = .{ 0x3e, 0x57, 0x67 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:50 DiagnosticError fg = error (local error = C.red at line 8) -> C.red (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:6) - .diagnostic_error = .{ 0xf3, 0x8b, 0xa8 }, + .@"error" = .{ 0xf3, 0x8b, 0xa8 }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:51 DiagnosticWarn fg = warning (local warning = C.yellow at line 9) -> C.yellow (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:9) - .diagnostic_warning = .{ 0xf9, 0xe2, 0xaf }, + .warning = .{ 0xf9, 0xe2, 0xaf }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:52 DiagnosticInfo fg = info (local info = C.sky at line 10) -> C.sky (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:12) - .diagnostic_info = .{ 0x89, 0xdc, 0xeb }, + .info = .{ 0x89, 0xdc, 0xeb }, // ~/05-genizah/catppuccin-nvim/lua/catppuccin/groups/lsp.lua:53 DiagnosticHint fg = hint (local hint = C.teal at line 11) -> C.teal (~/05-genizah/catppuccin-nvim/lua/catppuccin/palettes/mocha.lua:11) - .diagnostic_hint = .{ 0x94, 0xe2, 0xd5 }, - .palette = .{ + .hint = .{ 0x94, 0xe2, 0xd5 }, + .ansi = .{ .{ 0x45, 0x47, 0x5a }, // 0: ~/05-genizah/catppuccin-palette/palette.json:3286 mocha.ansiColors.black.normal .{ 0xf3, 0x8b, 0xa8 }, // 1: ~/05-genizah/catppuccin-palette/palette.json:3330 mocha.ansiColors.red.normal .{ 0xa6, 0xe3, 0xa1 }, // 2: ~/05-genizah/catppuccin-palette/palette.json:3374 mocha.ansiColors.green.normal diff --git a/core/themes/clay.zig b/core/themes/clay.zig index ba76ad35..4b28fb36 100644 --- a/core/themes/clay.zig +++ b/core/themes/clay.zig @@ -4,36 +4,32 @@ //! Pardes-specific tag, search, diagnostic and ANSI roles; see docs/typ/themes.typ. pub const theme = .{ .name = "clay", - .bg = .{ 0x10, 0x10, 0x0e }, - .fg = .{ 0xf3, 0xe5, 0xbc }, - .tag_bg = .{ 0x34, 0x3f, 0x36 }, - .tag_fg = .{ 0xd7, 0xd6, 0xb6 }, - .tag_name_fg = .{ 0xaa, 0xe0, 0xe0 }, - .tag_active_name_fg = .{ 0xb5, 0xec, 0xec }, - .tag_active_bg = .{ 0x42, 0x4f, 0x40 }, - .tag_active_fg = .{ 0xe3, 0xe2, 0xc2 }, - .box = .{ 0x8a, 0xc8, 0x74 }, - .box_dim = .{ 0x68, 0x7c, 0x4d }, - .column_box = .{ 0xdd, 0x7c, 0x97 }, - .column_box_dim = .{ 0x87, 0x5e, 0x65 }, - .kw = .{ 0xff, 0x88, 0x65 }, - .str = .{ 0xd1, 0xd5, 0x0c }, - .num = .{ 0xe0, 0x79, 0x95 }, + .page = .{ 0x10, 0x10, 0x0e }, + .text = .{ 0xf3, 0xe5, 0xbc }, + .tag = .{ 0x34, 0x3f, 0x36 }, + .tag_text = .{ 0xd7, 0xd6, 0xb6 }, + .tag_name = .{ 0xaa, 0xe0, 0xe0 }, + .tag_focus = .{ 0x42, 0x4f, 0x40 }, + .tag_focus_text = .{ 0xe3, 0xe2, 0xc2 }, + .accent = .{ 0x8a, 0xc8, 0x74 }, + .column_grip = .{ 0xdd, 0x7c, 0x97 }, + .keyword = .{ 0xff, 0x88, 0x65 }, + .string = .{ 0xd1, 0xd5, 0x0c }, + .number = .{ 0xe0, 0x79, 0x95 }, .comment = .{ 0xf6, 0xb9, 0x5b }, - .lineno = .{ 0x69, 0x64, 0x55 }, - .lineno_active = .{ 0x71, 0x6c, 0x5d }, - .scroll_track = .{ 0x22, 0x21, 0x19 }, - .scroll_thumb = .{ 0x8c, 0x94, 0x67 }, - .border = .{ 0x74, 0x87, 0x61 }, - .sel_bg = .{ 0x50, 0x5c, 0x38 }, - .sel_fg = .{ 0xfb, 0xf1, 0xc7 }, - .search_bg = .{ 0x6f, 0x54, 0x1f }, - .search_fg = .{ 0xff, 0xe2, 0xa0 }, - .diagnostic_error = .{ 0xff, 0x88, 0x65 }, - .diagnostic_warning = .{ 0xff, 0xbf, 0x2a }, - .diagnostic_info = .{ 0x7b, 0xbd, 0xac }, - .diagnostic_hint = .{ 0x89, 0xca, 0x72 }, - .palette = .{ + .line_number = .{ 0x69, 0x64, 0x55 }, + .line_number_current = .{ 0x71, 0x6c, 0x5d }, + .rail = .{ 0x22, 0x21, 0x19 }, + .rail_thumb = .{ 0x8c, 0x94, 0x67 }, + .rule = .{ 0x74, 0x87, 0x61 }, + .selection = .{ 0x50, 0x5c, 0x38 }, + .selection_text = .{ 0xfb, 0xf1, 0xc7 }, + .hit = .{ 0x6f, 0x54, 0x1f }, + .@"error" = .{ 0xff, 0x88, 0x65 }, + .warning = .{ 0xff, 0xbf, 0x2a }, + .info = .{ 0x7b, 0xbd, 0xac }, + .hint = .{ 0x89, 0xca, 0x72 }, + .ansi = .{ .{ 0x10, 0x10, 0x0e }, .{ 0xfb, 0x8a, 0x69 }, .{ 0xb8, 0xbb, 0x26 }, diff --git a/core/themes/dark.zig b/core/themes/dark.zig index e93fd489..24506f6b 100644 --- a/core/themes/dark.zig +++ b/core/themes/dark.zig @@ -1,34 +1,36 @@ -//! pardes's own dark theme, and the boot default until the helix capture -//! displaced it. It stays in the ring because it is the only one that leaves -//! `bg`/`fg` NULL: the page keeps the host terminal's own default cell, so -//! pardes sits inside whatever the surrounding terminal already looks like and -//! only paints its chrome. Every other theme here dresses the whole page. -//! -//! The selection pair is the warm tan pardes used to paint EVERY theme's -//! selection with, back when those six numbers were module constants. This is -//! the theme it belongs to: a null page is the host terminal's, and a tan that -//! reads as keyboard-driven on whatever dark cell that turns out to be is -//! exactly what it was picked for. +//! pardes dark: the host terminal's own page, white comments, violet stuff. +//! The one theme that leaves `page` and `text` NULL: in a terminal the page +//! is the host's own cell, ink and sixteen, so pardes sits inside whatever +//! the terminal already looks like and paints only its chrome; a window +//! draws colors.null_page (#121212) and #cccccc, and its sixteen below. +//! DESIGN.md part C: comments the brightest ink (#f0f0f0, 16.4:1), keywords +//! violet (#d76ef0, 6.6:1), a lilac tag, a violet grip that reads (#a58bff, +//! 3.4:1 on the focused tag) and a violet selection (#46337a) so the hits +//! keep amber; its own severities and sixteen (the window's). pub const theme = .{ .name = "dark", - .bg = null, - .fg = null, - .sel_bg = .{ 0x51, 0x3c, 0x17 }, - .sel_fg = .{ 0xd8, 0xc8, 0xa8 }, - .tag_bg = .{ 0x2c, 0x2a, 0x3e }, - .tag_fg = .{ 0x96, 0x96, 0x96 }, - // The focused tag: its band lighter in its own hue (1.54:1 off the - // plain one), its ink lighter to keep reading on it. - .tag_active_bg = .{ 0x48, 0x45, 0x66 }, - .tag_active_fg = .{ 0xc8, 0xc8, 0xc8 }, - .box = .{ 0x66, 0x3f, 0xe0 }, - .box_dim = .{ 0x35, 0x3a, 0x58 }, - .kw = .{ 0xda, 0x5e, 0xea }, - .str = .{ 0x85, 0xc3, 0x6f }, - .num = .{ 0xe1, 0xcb, 0x5f }, + .page = null, + .text = null, + .tag = .{ 0x2c, 0x2a, 0x3e }, + .tag_text = .{ 0xab, 0xa9, 0xc3 }, + .tag_focus_text = .{ 0xd6, 0xd4, 0xe8 }, + .accent = .{ 0xa5, 0x8b, 0xff }, + .selection = .{ 0x46, 0x33, 0x7a }, + .selection_text = .{ 0xf4, 0xf0, 0xff }, + .keyword = .{ 0xd7, 0x6e, 0xf0 }, + .string = .{ 0x8f, 0xca, 0x78 }, + .number = .{ 0xe3, 0xcd, 0x64 }, .comment = .{ 0xf0, 0xf0, 0xf0 }, - .lineno = .{ 0x5a, 0x5a, 0x5a }, - .scroll_track = .{ 0x2a, 0x2a, 0x2a }, - .scroll_thumb = .{ 0x52, 0x52, 0x52 }, - .palette = null, + .line_number = .{ 0x5c, 0x5c, 0x66 }, + .line_number_current = .{ 0x8e, 0x8c, 0x9e }, + .@"error" = .{ 0xff, 0x6e, 0x7f }, + .warning = .{ 0xff, 0xb4, 0x54 }, + .info = .{ 0x7f, 0xa8, 0xff }, + .hint = .{ 0x62, 0xd2, 0xc4 }, + .ansi = .{ + .{ 0x2c, 0x2a, 0x3e }, .{ 0xff, 0x6e, 0x7f }, .{ 0x8f, 0xca, 0x78 }, .{ 0xe3, 0xcd, 0x64 }, + .{ 0x7f, 0xa8, 0xff }, .{ 0xd7, 0x6e, 0xf0 }, .{ 0x62, 0xd2, 0xc4 }, .{ 0xc4, 0xc4, 0xcc }, + .{ 0x7e, 0x7b, 0x96 }, .{ 0xff, 0x95, 0xa1 }, .{ 0xae, 0xe3, 0x9a }, .{ 0xf2, 0xe0, 0x8a }, + .{ 0xa6, 0xc3, 0xff }, .{ 0xe6, 0x9c, 0xf7 }, .{ 0x8f, 0xe6, 0xda }, .{ 0xf0, 0xf0, 0xf0 }, + }, }; diff --git a/core/themes/dark_plus.zig b/core/themes/dark_plus.zig index 9c1cb689..f0a13f1e 100644 --- a/core/themes/dark_plus.zig +++ b/core/themes/dark_plus.zig @@ -8,67 +8,67 @@ //! Adjusted to meet pardes's floors (chrome only; text, syntax and ANSI are untouched): //! - unfocused tag ground #2d2d2d -> #3c3c3c: 1.21:1 off the focused one (the page, kept), pardes needs 1.5:1 on a dark page //! - unfocused tag text #969696 -> #a7a7a7: 3.73:1 on #3c3c3c, tag text needs 4.5:1 to be read and run +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused tag ground #1e1e1e -> #565656: 1.51:1 off the tag, now 1.50:1 (R4, H: a focus step off the tag, and the loudest) +//! - focused grip #007fd4 -> #4dabff: 1.74:1 on the focused tag, now 3.00:1 (R6: 3:1) +//! - unsaved grip #3399cc -> #4db0e4: 3.45:1 on the tag, now 4.54:1 (R6: 3:1 on both tags) pub const theme = .{ .name = "dark_plus", // /usr/share/code/resources/app/extensions/theme-defaults/themes/dark_vs.json:1 colors."editor.background" - .bg = .{ 0x1e, 0x1e, 0x1e }, + .page = .{ 0x1e, 0x1e, 0x1e }, // /usr/share/code/resources/app/extensions/theme-defaults/themes/dark_vs.json:1 colors."editor.foreground" - .fg = .{ 0xd4, 0xd4, 0xd4 }, + .text = .{ 0xd4, 0xd4, 0xd4 }, // ~/05-genizah/vscode/src/vs/platform/theme/common/colors/editorColors.ts:122 editor.selectionBackground dark - .sel_bg = .{ 0x26, 0x4f, 0x78 }, + .selection = .{ 0x26, 0x4f, 0x78 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xd4, 0xd4, 0xd4 }, + .selection_text = .{ 0xd4, 0xd4, 0xd4 }, // ~/05-genizah/vscode/src/vs/workbench/common/theme.ts:36 tab.inactiveBackground dark #2d2d2d, adjusted - .tag_bg = .{ 0x3c, 0x3c, 0x3c }, + .tag = .{ 0x3c, 0x3c, 0x3c }, // ~/05-genizah/vscode/src/vs/workbench/common/theme.ts:56 tab.inactiveForeground dark = transparent(tab.activeForeground #FFFFFF, 0.5) over #2d2d2d #969696, adjusted - .tag_fg = .{ 0xa7, 0xa7, 0xa7 }, + .tag_text = .{ 0xa7, 0xa7, 0xa7 }, // ~/05-genizah/vscode/src/vs/workbench/common/theme.ts:31 tab.activeBackground = editorBackground - .tag_active_bg = .{ 0x1e, 0x1e, 0x1e }, + .tag_focus = .{ 0x1e, 0x1e, 0x1e }, // ~/05-genizah/vscode/src/vs/workbench/common/theme.ts:49 tab.activeForeground dark Color.white - .tag_active_fg = .{ 0xff, 0xff, 0xff }, + .tag_focus_text = .{ 0xff, 0xff, 0xff }, // the tagline is the status bar: ~/05-genizah/vscode/src/vs/workbench/common/theme.ts:298 statusBar.background dark #007ACC - .tagline_bg = .{ 0x00, 0x7a, 0xcc }, + .workspace = .{ 0x00, 0x7a, 0xcc }, // ~/05-genizah/vscode/src/vs/workbench/common/theme.ts:289 statusBar.foreground dark #FFFFFF - .tagline_fg = .{ 0xff, 0xff, 0xff }, + .workspace_text = .{ 0xff, 0xff, 0xff }, // the focused grip: ~/05-genizah/vscode/src/vs/platform/theme/common/colors/baseColors.ts:38 focusBorder dark - .box = .{ 0x00, 0x7f, 0xd4 }, - // derived: the grip at rest, the accent #007fd4 faded toward the unfocused tag #3c3c3c as far as 1.6:1 off it (0.54 of the way) - .box_dim = .{ 0x1c, 0x60, 0x8e }, + .accent = .{ 0x00, 0x7f, 0xd4 }, // an unsaved grip: the original's modified colour, ~/05-genizah/vscode/src/vs/workbench/common/theme.ts:176 tab.activeModifiedBorder dark - .box_dirty = .{ 0x33, 0x99, 0xcc }, + .dirty = .{ 0x33, 0x99, 0xcc }, // derived: the column grip, the original's type colour, /usr/share/code/resources/app/extensions/theme-defaults/themes/dark_plus.json:1 tokenColors entity.name.type - .column_box = .{ 0x4e, 0xc9, 0xb0 }, + .column_grip = .{ 0x4e, 0xc9, 0xb0 }, // /usr/share/code/resources/app/extensions/theme-defaults/themes/dark_vs.json:1 tokenColors keyword (keyword.control is #C586C0 in dark_plus.json:1; pardes has one keyword colour) - .kw = .{ 0x56, 0x9c, 0xd6 }, + .keyword = .{ 0x56, 0x9c, 0xd6 }, // /usr/share/code/resources/app/extensions/theme-defaults/themes/dark_vs.json:1 tokenColors string - .str = .{ 0xce, 0x91, 0x78 }, + .string = .{ 0xce, 0x91, 0x78 }, // /usr/share/code/resources/app/extensions/theme-defaults/themes/dark_vs.json:1 tokenColors constant.numeric - .num = .{ 0xb5, 0xce, 0xa8 }, + .number = .{ 0xb5, 0xce, 0xa8 }, // /usr/share/code/resources/app/extensions/theme-defaults/themes/dark_vs.json:1 tokenColors comment .comment = .{ 0x6a, 0x99, 0x55 }, // ~/05-genizah/vscode/src/vs/editor/common/core/editorColorRegistry.ts:29 editorLineNumber.foreground dark - .lineno = .{ 0x85, 0x85, 0x85 }, + .line_number = .{ 0x85, 0x85, 0x85 }, // ~/05-genizah/vscode/src/vs/editor/common/core/editorColorRegistry.ts:48 editorActiveLineNumber.foreground dark (editorLineNumber.activeForeground defaults to it, :49) - .lineno_active = .{ 0xc6, 0xc6, 0xc6 }, + .line_number_current = .{ 0xc6, 0xc6, 0xc6 }, // ~/05-genizah/vscode/src/vs/platform/theme/common/colors/miscColors.ts:68 scrollbar.background null: the editor shows through - .scroll_track = .{ 0x1e, 0x1e, 0x1e }, + .rail = .{ 0x1e, 0x1e, 0x1e }, // ~/05-genizah/vscode/src/vs/platform/theme/common/colors/miscColors.ts:57 scrollbarSlider.background dark #797979 at 0.4, over #1e1e1e - .scroll_thumb = .{ 0x42, 0x42, 0x42 }, + .rail_thumb = .{ 0x42, 0x42, 0x42 }, // ~/05-genizah/vscode/src/vs/workbench/common/theme.ts:237 editorGroup.border dark - .border = .{ 0x44, 0x44, 0x44 }, + .rule = .{ 0x44, 0x44, 0x44 }, // ~/05-genizah/vscode/src/vs/platform/theme/common/colors/editorColors.ts:149 editor.findMatchBackground dark - .search_bg = .{ 0x51, 0x5c, 0x6a }, - // derived: the original keeps text colours over a match; the page's text, whichever reads better on it - .search_fg = .{ 0xd4, 0xd4, 0xd4 }, + .hit = .{ 0x51, 0x5c, 0x6a }, // ~/05-genizah/vscode/src/vs/platform/theme/common/colors/editorColors.ts:71 editorError.foreground dark - .diagnostic_error = .{ 0xf1, 0x4c, 0x4c }, + .@"error" = .{ 0xf1, 0x4c, 0x4c }, // ~/05-genizah/vscode/src/vs/platform/theme/common/colors/editorColors.ts:84 editorWarning.foreground dark - .diagnostic_warning = .{ 0xcc, 0xa7, 0x00 }, + .warning = .{ 0xcc, 0xa7, 0x00 }, // ~/05-genizah/vscode/src/vs/platform/theme/common/colors/editorColors.ts:97 editorInfo.foreground dark - .diagnostic_info = .{ 0x59, 0xa4, 0xf9 }, + .info = .{ 0x59, 0xa4, 0xf9 }, // ~/05-genizah/vscode/src/vs/platform/theme/common/colors/editorColors.ts:106 editorHint.foreground dark #eeeeee at 0.7, over #1e1e1e - .diagnostic_hint = .{ 0xb0, 0xb0, 0xb0 }, - .palette = .{ + .hint = .{ 0xb0, 0xb0, 0xb0 }, + .ansi = .{ .{ 0x00, 0x00, 0x00 }, // 0: ~/05-genizah/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.ts:107 terminal.ansiBlack dark .{ 0xcd, 0x31, 0x31 }, // 1: ~/05-genizah/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.ts:116 terminal.ansiRed dark .{ 0x0d, 0xbc, 0x79 }, // 2: ~/05-genizah/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.ts:125 terminal.ansiGreen dark diff --git a/core/themes/daybreak.zig b/core/themes/daybreak.zig index e032b994..2e6c0b8a 100644 --- a/core/themes/daybreak.zig +++ b/core/themes/daybreak.zig @@ -3,36 +3,32 @@ //! designed together. See docs/typ/themes.typ for the shared role contract. pub const theme = .{ .name = "daybreak", - .bg = .{ 0xff, 0xff, 0xff }, - .fg = .{ 0x14, 0x2d, 0x40 }, - .tag_bg = .{ 0xed, 0xf2, 0xf7 }, - .tag_fg = .{ 0x29, 0x46, 0x5e }, - .tag_name_fg = .{ 0x5a, 0x2d, 0x67 }, - .tag_active_name_fg = .{ 0x52, 0x25, 0x5f }, - .tag_active_bg = .{ 0xdf, 0xea, 0xf3 }, - .tag_active_fg = .{ 0x21, 0x3e, 0x56 }, - .box = .{ 0x00, 0x61, 0x98 }, - .box_dim = .{ 0x7b, 0x9e, 0xb7 }, - .column_box = .{ 0x7f, 0x42, 0x00 }, - .column_box_dim = .{ 0xb7, 0x9a, 0x7a }, - .kw = .{ 0x65, 0x1a, 0x98 }, - .str = .{ 0x1a, 0x65, 0x2b }, - .num = .{ 0x7f, 0x42, 0x00 }, + .page = .{ 0xff, 0xff, 0xff }, + .text = .{ 0x14, 0x2d, 0x40 }, + .tag = .{ 0xed, 0xf2, 0xf7 }, + .tag_text = .{ 0x29, 0x46, 0x5e }, + .tag_name = .{ 0x5a, 0x2d, 0x67 }, + .tag_focus = .{ 0xdf, 0xea, 0xf3 }, + .tag_focus_text = .{ 0x21, 0x3e, 0x56 }, + .accent = .{ 0x00, 0x61, 0x98 }, + .column_grip = .{ 0x7f, 0x42, 0x00 }, + .keyword = .{ 0x65, 0x1a, 0x98 }, + .string = .{ 0x1a, 0x65, 0x2b }, + .number = .{ 0x7f, 0x42, 0x00 }, .comment = .{ 0x08, 0x62, 0x39 }, - .lineno = .{ 0x88, 0x93, 0x9b }, - .lineno_active = .{ 0x80, 0x8b, 0x93 }, - .scroll_track = .{ 0xe6, 0xed, 0xf3 }, - .scroll_thumb = .{ 0x66, 0x85, 0xa0 }, - .border = .{ 0xc5, 0xcf, 0xd7 }, - .sel_bg = .{ 0xb9, 0xdf, 0xfb }, - .sel_fg = .{ 0x10, 0x36, 0x4f }, - .search_bg = .{ 0xff, 0xe3, 0x96 }, - .search_fg = .{ 0x4b, 0x35, 0x00 }, - .diagnostic_error = .{ 0xb3, 0x08, 0x22 }, - .diagnostic_warning = .{ 0x70, 0x49, 0x00 }, - .diagnostic_info = .{ 0x00, 0x5c, 0x8a }, - .diagnostic_hint = .{ 0x36, 0x5b, 0x25 }, - .palette = .{ + .line_number = .{ 0x88, 0x93, 0x9b }, + .line_number_current = .{ 0x80, 0x8b, 0x93 }, + .rail = .{ 0xe6, 0xed, 0xf3 }, + .rail_thumb = .{ 0x66, 0x85, 0xa0 }, + .rule = .{ 0xc5, 0xcf, 0xd7 }, + .selection = .{ 0xb9, 0xdf, 0xfb }, + .selection_text = .{ 0x10, 0x36, 0x4f }, + .hit = .{ 0xff, 0xe3, 0x96 }, + .@"error" = .{ 0xb3, 0x08, 0x22 }, + .warning = .{ 0x70, 0x49, 0x00 }, + .info = .{ 0x00, 0x5c, 0x8a }, + .hint = .{ 0x36, 0x5b, 0x25 }, + .ansi = .{ .{ 0x14, 0x2d, 0x40 }, .{ 0xa1, 0x1c, 0x30 }, .{ 0x24, 0x5b, 0x30 }, diff --git a/core/themes/doom_one.zig b/core/themes/doom_one.zig index 9db8bdee..1d3df86a 100644 --- a/core/themes/doom_one.zig +++ b/core/themes/doom_one.zig @@ -29,61 +29,59 @@ //! from tab-bar faces (inherit tab-line-*). The doom-modeline package //! (separate) draws on the mode-line face; its accent bar is doom-modeline-bar //! = highlight. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - search hit #387aa7 -> #594324: 3.01:1 off the page, now 1.50:1 (R8: 1.5:1, the text reading on it) pub const theme = .{ .name = "doom_one", // ~/05-genizah/doomemacs-themes/doom-themes-base.el:13 default :background bg; bg = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:56 bg (GUI/default column #282c34) - .bg = .{ 0x28, 0x2c, 0x34 }, + .page = .{ 0x28, 0x2c, 0x34 }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:13 default :foreground fg; fg = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:57 fg (GUI/default column #bbc2cf) - .fg = .{ 0xbb, 0xc2, 0xcf }, + .text = .{ 0xbb, 0xc2, 0xcf }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:15 region :background region; region = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:110 region = (doom-lighten (car bg-alt) #21242b 0.15) = (doom-blend #21242b #FFFFFF 0.85) = #42444a (computed per ~/05-genizah/doomemacs-themes/doom-themes.el:301-343 doom-blend/darken/lighten) - .sel_bg = .{ 0x42, 0x44, 0x4a }, + .selection = .{ 0x42, 0x44, 0x4a }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xbb, 0xc2, 0xcf }, + .selection_text = .{ 0xbb, 0xc2, 0xcf }, // ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:145 mode-line-inactive :background modeline-bg-inactive; modeline-bg-inactive = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:128 modeline-bg-inactive = bg-alt (car bg-alt) -> #21242b - .tag_bg = .{ 0x21, 0x24, 0x2b }, + .tag = .{ 0x21, 0x24, 0x2b }, // ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:145 mode-line-inactive :foreground modeline-fg-alt; modeline-fg-alt = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:121 modeline-fg-alt = base5 -> #5b6268 #5b6268, adjusted - .tag_fg = .{ 0x86, 0x8b, 0x8f }, + .tag_text = .{ 0x86, 0x8b, 0x8f }, // ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:142 mode-line :background modeline-bg; modeline-bg = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:122 modeline-bg = (doom-darken bg-alt #21242b 0.1) (doom-one-brighter-modeline nil) = (doom-blend #21242b #000000 0.9) = #1d2026 (computed per ~/05-genizah/doomemacs-themes/doom-themes.el:301-343 doom-blend/darken/lighten) #1d2026, adjusted - .tag_active_bg = .{ 0x40, 0x44, 0x4b }, + .tag_focus = .{ 0x40, 0x44, 0x4b }, // ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:142 mode-line :foreground modeline-fg; modeline-fg = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:120 modeline-fg = fg -> #bbc2cf - .tag_active_fg = .{ 0xbb, 0xc2, 0xcf }, + .tag_focus_text = .{ 0xbb, 0xc2, 0xcf }, // the focused grip: ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:154 doom-modeline-bar :background highlight (the modeline accent bar; also cursor/link/minibuffer-prompt, ~/05-genizah/doomemacs-themes/doom-themes-base.el:17); highlight = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:95 highlight = blue -> #51afef - .box = .{ 0x51, 0xaf, 0xef }, - // derived: the grip at rest, the accent #51afef faded toward the unfocused tag #21242b as far as 1.6:1 off it (0.26 of the way) - .box_dim = .{ 0x2d, 0x48, 0x5e }, + .accent = .{ 0x51, 0xaf, 0xef }, // an unsaved grip: the original's modified colour, ~/05-genizah/doomemacs-themes/doom-themes-base.el:412 diff-changed :foreground violet (doom-modeline-buffer-modified not defined in doom-themes); violet = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:88 violet (GUI/default column #a9a1e1) - .box_dirty = .{ 0xa9, 0xa1, 0xe1 }, + .dirty = .{ 0xa9, 0xa1, 0xe1 }, // derived: the column grip, the original's type colour, ~/05-genizah/doomemacs-themes/doom-themes-base.el:57 font-lock-type-face :foreground type; type = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:106 type = yellow -> #ecbe7b - .column_box = .{ 0xec, 0xbe, 0x7b }, + .column_grip = .{ 0xec, 0xbe, 0x7b }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:44 font-lock-keyword-face :foreground keywords; keywords = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:103 keywords = blue -> #51afef - .kw = .{ 0x51, 0xaf, 0xef }, + .keyword = .{ 0x51, 0xaf, 0xef }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:56 font-lock-string-face :foreground strings; strings = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:107 strings = green -> #98be65 - .str = .{ 0x98, 0xbe, 0x65 }, + .string = .{ 0x98, 0xbe, 0x65 }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:769 highlight-numbers-number :foreground numbers; numbers = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:109 numbers = orange -> #da8548 - .num = .{ 0xda, 0x85, 0x48 }, + .number = .{ 0xda, 0x85, 0x48 }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:37 font-lock-comment-face :foreground comments; comments = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:99 comments = base5 (doom-one-brighter-comments nil) -> #5b6268 .comment = .{ 0x5b, 0x62, 0x68 }, // ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:137 line-number &override :foreground base4; base4 = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:73 base4 (GUI/default column #3f444a) - .lineno = .{ 0x3f, 0x44, 0x4a }, + .line_number = .{ 0x3f, 0x44, 0x4a }, // ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:138 line-number-current-line &override :foreground fg; fg = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:57 fg (GUI/default column #bbc2cf) - .lineno_active = .{ 0xbb, 0xc2, 0xcf }, + .line_number_current = .{ 0xbb, 0xc2, 0xcf }, // derived: none in the original; the page - .scroll_track = .{ 0x28, 0x2c, 0x34 }, + .rail = .{ 0x28, 0x2c, 0x34 }, // derived: none in the original; line numbers, ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:137 line-number &override :foreground base4; base4 = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:73 base4 (GUI/default column #3f444a) #3f444a, adjusted - .scroll_thumb = .{ 0x44, 0x49, 0x4f }, + .rail_thumb = .{ 0x44, 0x49, 0x4f }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:28 vertical-border :foreground vertical-bar; vertical-bar = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:96 vertical-bar = (doom-darken base1 #1c1f24 0.1) = (doom-blend #1c1f24 #000000 0.9) = #191b20 (computed per ~/05-genizah/doomemacs-themes/doom-themes.el:301-343 doom-blend/darken/lighten) #191b20, adjusted - .border = .{ 0x4a, 0x4d, 0x55 }, + .rule = .{ 0x4a, 0x4d, 0x55 }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:23 lazy-highlight &dark :background (doom-darken highlight #51afef 0.3) = (doom-blend #51afef #000000 0.7) = #387aa7 (computed per ~/05-genizah/doomemacs-themes/doom-themes.el:301-331); isearch inherits lazy-highlight (~/05-genizah/doomemacs-themes/doom-themes-base.el:820) - .search_bg = .{ 0x38, 0x7a, 0xa7 }, - // ~/05-genizah/doomemacs-themes/doom-themes-base.el:23 lazy-highlight &dark :foreground base8 (isearch :inherit lazy-highlight, ~/05-genizah/doomemacs-themes/doom-themes-base.el:820); base8 = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:77 base8 (GUI/default column #dfdfdf) - .search_fg = .{ 0xdf, 0xdf, 0xdf }, + .hit = .{ 0x38, 0x7a, 0xa7 }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:30 error face :foreground error; error = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:111 error = red -> #ff6c6b - .diagnostic_error = .{ 0xff, 0x6c, 0x6b }, + .@"error" = .{ 0xff, 0x6c, 0x6b }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:31 warning face :foreground warning; warning = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:112 warning = yellow -> #ecbe7b - .diagnostic_warning = .{ 0xec, 0xbe, 0x7b }, + .warning = .{ 0xec, 0xbe, 0x7b }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:32 success face :foreground success; success = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:113 success = green -> #98be65 - .diagnostic_info = .{ 0x98, 0xbe, 0x65 }, - .palette = .{ + .info = .{ 0x98, 0xbe, 0x65 }, + .ansi = .{ .{ 0x28, 0x2c, 0x34 }, // 0: ~/05-genizah/doomemacs-themes/doom-themes-base.el:198 ansi-color-black :foreground bg; bg = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:56 bg (GUI/default column #282c34) .{ 0xff, 0x6c, 0x6b }, // 1: ~/05-genizah/doomemacs-themes/doom-themes-base.el:199 ansi-color-red :foreground red; red = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:80 red (GUI/default column #ff6c6b) .{ 0x98, 0xbe, 0x65 }, // 2: ~/05-genizah/doomemacs-themes/doom-themes-base.el:200 ansi-color-green :foreground green; green = ~/05-genizah/doomemacs-themes/themes/doom-one-theme.el:82 green (GUI/default column #98be65) diff --git a/core/themes/doom_one_light.zig b/core/themes/doom_one_light.zig index c95b5c17..b70a9272 100644 --- a/core/themes/doom_one_light.zig +++ b/core/themes/doom_one_light.zig @@ -31,61 +31,63 @@ //! because ansi-color-black/white map to bg/fg; tabline_fg = fg-alt #c6c7c7 is //! very low-contrast on bg-alt; the variable is named modeline-bg-alt-inactive //! in this theme. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #4078f2 -> #3167df: 2.42:1 on the focused tag, now 3.04:1 (R6: 3:1) +//! - unsaved grip #b751b6 -> #ab45aa: 3.30:1 on the tag, now 3.86:1 (R6: 3:1 on both tags) +//! - search hit #c2d3f7 -> #f4c783: 1.44:1 off the page, now 1.51:1 (R8: 1.5:1, the text reading on it) +//! - error #e45649 -> #ce4136: 3.51:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) +//! - info #50a14f -> #318332: 3.07:1 on the page, now 4.55:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "doom_one_light", // ~/05-genizah/doomemacs-themes/doom-themes-base.el:13 default :background bg; bg = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:47 bg (GUI/default column #fafafa) - .bg = .{ 0xfa, 0xfa, 0xfa }, + .page = .{ 0xfa, 0xfa, 0xfa }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:13 default :foreground fg; fg = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:48 fg (GUI/default column #383a42) - .fg = .{ 0x38, 0x3a, 0x42 }, + .text = .{ 0x38, 0x3a, 0x42 }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:15 region :background region; region = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:101 region = (doom-darken (car bg-alt) #f0f0f0 0.1) = (doom-blend #f0f0f0 #000000 0.9) = #d8d8d8 (computed per ~/05-genizah/doomemacs-themes/doom-themes.el:301-343 doom-blend/darken/lighten) - .sel_bg = .{ 0xd8, 0xd8, 0xd8 }, + .selection = .{ 0xd8, 0xd8, 0xd8 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x38, 0x3a, 0x42 }, + .selection_text = .{ 0x38, 0x3a, 0x42 }, // ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:138 mode-line-inactive :background modeline-bg-inactive; modeline-bg-inactive = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:121 modeline-bg-inactive = (doom-darken bg #fafafa 0.1) = (doom-blend #fafafa #000000 0.9) = #e1e1e1 (computed per ~/05-genizah/doomemacs-themes/doom-themes.el:301-343 doom-blend/darken/lighten) - .tag_bg = .{ 0xe1, 0xe1, 0xe1 }, + .tag = .{ 0xe1, 0xe1, 0xe1 }, // ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:138 mode-line-inactive :foreground modeline-fg-alt; modeline-fg-alt = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:112 modeline-fg-alt = (doom-blend violet #b751b6 base4 #9ca0a4 0.2) (doom-one-light-brighter-modeline nil) = #a190a7 (computed per ~/05-genizah/doomemacs-themes/doom-themes.el:301-343 doom-blend/darken/lighten) #a190a7, adjusted - .tag_fg = .{ 0x6a, 0x5f, 0x6e }, + .tag_text = .{ 0x6a, 0x5f, 0x6e }, // ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:135 mode-line :background modeline-bg; modeline-bg = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:115 modeline-bg = base1 (doom-one-light-brighter-modeline nil) -> #e7e7e7 #e7e7e7, adjusted - .tag_active_bg = .{ 0xc8, 0xc8, 0xc9 }, + .tag_focus = .{ 0xc8, 0xc8, 0xc9 }, // ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:135 mode-line :foreground modeline-fg; modeline-fg = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:111 modeline-fg = fg -> #383a42 - .tag_active_fg = .{ 0x38, 0x3a, 0x42 }, + .tag_focus_text = .{ 0x38, 0x3a, 0x42 }, // the focused grip: ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:152 doom-modeline-bar :background highlight (the modeline accent bar; also cursor/link/minibuffer-prompt, ~/05-genizah/doomemacs-themes/doom-themes-base.el:17); highlight = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:86 highlight = blue -> #4078f2 - .box = .{ 0x40, 0x78, 0xf2 }, - // derived: the grip at rest, the accent #4078f2 faded toward the unfocused tag #e1e1e1 as far as 1.6:1 off it (0.46 of the way) - .box_dim = .{ 0x97, 0xb1, 0xe9 }, + .accent = .{ 0x40, 0x78, 0xf2 }, // an unsaved grip: the original's modified colour, ~/05-genizah/doomemacs-themes/doom-themes-base.el:412 diff-changed :foreground violet (doom-modeline-buffer-modified not defined in doom-themes); violet = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:79 violet (GUI/default column #b751b6) - .box_dirty = .{ 0xb7, 0x51, 0xb6 }, + .dirty = .{ 0xb7, 0x51, 0xb6 }, // derived: the column grip, the original's type colour, ~/05-genizah/doomemacs-themes/doom-themes-base.el:57 font-lock-type-face :foreground type; type = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:97 type = yellow -> #986801 - .column_box = .{ 0x98, 0x68, 0x01 }, + .column_grip = .{ 0x98, 0x68, 0x01 }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:44 font-lock-keyword-face :foreground keywords; keywords = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:94 keywords = red -> #e45649 - .kw = .{ 0xe4, 0x56, 0x49 }, + .keyword = .{ 0xe4, 0x56, 0x49 }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:56 font-lock-string-face :foreground strings; strings = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:98 strings = green -> #50a14f - .str = .{ 0x50, 0xa1, 0x4f }, + .string = .{ 0x50, 0xa1, 0x4f }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:769 highlight-numbers-number :foreground numbers; numbers = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:100 numbers = orange -> #da8548 - .num = .{ 0xda, 0x85, 0x48 }, + .number = .{ 0xda, 0x85, 0x48 }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:37 font-lock-comment-face :foreground comments; comments = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:90 comments = base4 (doom-one-light-brighter-comments nil) -> #9ca0a4 .comment = .{ 0x9c, 0xa0, 0xa4 }, // ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:132 line-number &override :foreground (doom-lighten base4 #9ca0a4 0.15) = (doom-blend #9ca0a4 #FFFFFF 0.85) = #aaaeb1 (computed per ~/05-genizah/doomemacs-themes/doom-themes.el:301-343) - .lineno = .{ 0xaa, 0xae, 0xb1 }, + .line_number = .{ 0xaa, 0xae, 0xb1 }, // ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:133 line-number-current-line &override :foreground base8; base8 = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:68 base8 (GUI/default column #1b2229) - .lineno_active = .{ 0x1b, 0x22, 0x29 }, + .line_number_current = .{ 0x1b, 0x22, 0x29 }, // derived: none in the original; the page - .scroll_track = .{ 0xfa, 0xfa, 0xfa }, + .rail = .{ 0xfa, 0xfa, 0xfa }, // derived: none in the original; line numbers, ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:132 line-number &override :foreground (doom-lighten base4 #9ca0a4 0.15) = (doom-blend #9ca0a4 #FFFFFF 0.85) = #aaaeb1 (computed per ~/05-genizah/doomemacs-themes/doom-themes.el:301-343) - .scroll_thumb = .{ 0xaa, 0xae, 0xb1 }, + .rail_thumb = .{ 0xaa, 0xae, 0xb1 }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:28 vertical-border :foreground vertical-bar; vertical-bar = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:87 vertical-bar = (doom-darken base2 #dfdfdf 0.1) = (doom-blend #dfdfdf #000000 0.9) = #c8c8c8 (computed per ~/05-genizah/doomemacs-themes/doom-themes.el:301-343 doom-blend/darken/lighten) - .border = .{ 0xc8, 0xc8, 0xc8 }, + .rule = .{ 0xc8, 0xc8, 0xc8 }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:24 lazy-highlight &light :background (doom-blend bg #fafafa highlight #4078f2 0.7) = #c2d3f7 (computed per ~/05-genizah/doomemacs-themes/doom-themes.el:301-319); isearch inherits lazy-highlight (~/05-genizah/doomemacs-themes/doom-themes-base.el:820) - .search_bg = .{ 0xc2, 0xd3, 0xf7 }, - // ~/05-genizah/doomemacs-themes/doom-themes-base.el:24 lazy-highlight &light :foreground base0 (isearch :inherit lazy-highlight, ~/05-genizah/doomemacs-themes/doom-themes-base.el:820); base0 = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:60 base0 (GUI/default column #f0f0f0) - .search_fg = .{ 0xf0, 0xf0, 0xf0 }, + .hit = .{ 0xc2, 0xd3, 0xf7 }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:30 error face :foreground error; error = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:102 error = red -> #e45649 - .diagnostic_error = .{ 0xe4, 0x56, 0x49 }, + .@"error" = .{ 0xe4, 0x56, 0x49 }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:31 warning face :foreground warning; warning = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:103 warning = yellow -> #986801 - .diagnostic_warning = .{ 0x98, 0x68, 0x01 }, + .warning = .{ 0x98, 0x68, 0x01 }, // ~/05-genizah/doomemacs-themes/doom-themes-base.el:32 success face :foreground success; success = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:104 success = green -> #50a14f - .diagnostic_info = .{ 0x50, 0xa1, 0x4f }, - .palette = .{ + .info = .{ 0x50, 0xa1, 0x4f }, + .ansi = .{ .{ 0xfa, 0xfa, 0xfa }, // 0: ~/05-genizah/doomemacs-themes/doom-themes-base.el:198 ansi-color-black :foreground bg; bg = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:47 bg (GUI/default column #fafafa) .{ 0xe4, 0x56, 0x49 }, // 1: ~/05-genizah/doomemacs-themes/doom-themes-base.el:199 ansi-color-red :foreground red; red = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:71 red (GUI/default column #e45649) .{ 0x50, 0xa1, 0x4f }, // 2: ~/05-genizah/doomemacs-themes/doom-themes-base.el:200 ansi-color-green :foreground green; green = ~/05-genizah/doomemacs-themes/themes/doom-one-light-theme.el:73 green (GUI/default column #50a14f) diff --git a/core/themes/dracula.zig b/core/themes/dracula.zig index 16c6ba43..53bd74eb 100644 --- a/core/themes/dracula.zig +++ b/core/themes/dracula.zig @@ -8,57 +8,56 @@ //! Adjusted to meet pardes's floors (chrome only; text, syntax and ANSI are untouched): //! - focused tag ground #282a36 -> #41434d: 1.11:1 off the unfocused #21222c, pardes needs 1.5:1 on a dark page //! - unfocused tag text #6272a4 -> #7b89b3: 3.36:1 on #21222c, tag text needs 4.5:1 to be read and run +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #94527e -> #be78a6: 1.76:1 on the focused tag, now 3.01:1 (R6: 3:1) +//! - search hit #947151 -> #004c63: 3.21:1 off the page, now 1.50:1 (R8: 1.5:1, the text reading on it) pub const theme = .{ .name = "dracula", // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:185 editor.background: *BG (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:10) - .bg = .{ 0x28, 0x2a, 0x36 }, + .page = .{ 0x28, 0x2a, 0x36 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:184 editor.foreground: *FG (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:11) - .fg = .{ 0xf8, 0xf8, 0xf2 }, + .text = .{ 0xf8, 0xf8, 0xf2 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:189 editor.selectionBackground: *SELECTION (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:12) - .sel_bg = .{ 0x44, 0x47, 0x5a }, + .selection = .{ 0x44, 0x47, 0x5a }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xf8, 0xf8, 0xf2 }, + .selection_text = .{ 0xf8, 0xf8, 0xf2 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:178 tab.inactiveBackground: *BGDark (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:50) - .tag_bg = .{ 0x21, 0x22, 0x2c }, + .tag = .{ 0x21, 0x22, 0x2c }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:179 tab.inactiveForeground: *COMMENT (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:13) #6272a4, adjusted - .tag_fg = .{ 0x7b, 0x89, 0xb3 }, + .tag_text = .{ 0x7b, 0x89, 0xb3 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:172 tab.activeBackground: *BG (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:10) #282a36, adjusted - .tag_active_bg = .{ 0x41, 0x43, 0x4d }, + .tag_focus = .{ 0x41, 0x43, 0x4d }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:173 tab.activeForeground: *FG (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:11) - .tag_active_fg = .{ 0xf8, 0xf8, 0xf2 }, + .tag_focus_text = .{ 0xf8, 0xf8, 0xf2 }, // the focused grip: ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:175 tab.activeBorderTop: !alpha [*PINK, 80] over BG - .box = .{ 0x94, 0x52, 0x7e }, - // derived: the grip at rest, the accent #94527e faded toward the unfocused tag #21222c as far as 1.6:1 off it (0.50 of the way) - .box_dim = .{ 0x5b, 0x3a, 0x55 }, + .accent = .{ 0x94, 0x52, 0x7e }, // an unsaved grip: the original's warning colour, ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:250 editorWarning.foreground: *CYAN (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:14) - .box_dirty = .{ 0x8b, 0xe9, 0xfd }, + .dirty = .{ 0x8b, 0xe9, 0xfd }, // derived: the column grip, the original's function colour, ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:688 tokenColors "Function names" *GREEN - .column_box = .{ 0x50, 0xfa, 0x7b }, + .column_grip = .{ 0x50, 0xfa, 0x7b }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:725 tokenColors "Keywords" *PINK - .kw = .{ 0xff, 0x79, 0xc6 }, + .keyword = .{ 0xff, 0x79, 0xc6 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:978 tokenColors "Strings" *YELLOW - .str = .{ 0xf1, 0xfa, 0x8c }, + .string = .{ 0xf1, 0xfa, 0x8c }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:640 tokenColors "Constants" *PURPLE - .num = .{ 0xbd, 0x93, 0xf9 }, + .number = .{ 0xbd, 0x93, 0xf9 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:601 tokenColors "Comments" *COMMENT .comment = .{ 0x62, 0x72, 0xa4 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:186 editorLineNumber.foreground: *COMMENT (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:13) - .lineno = .{ 0x62, 0x72, 0xa4 }, + .line_number = .{ 0x62, 0x72, 0xa4 }, // derived: none in the original; the page - .scroll_track = .{ 0x28, 0x2a, 0x36 }, + .rail = .{ 0x28, 0x2a, 0x36 }, // derived: none in the original; line numbers, ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:186 editorLineNumber.foreground: *COMMENT (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:13) - .scroll_thumb = .{ 0x62, 0x72, 0xa4 }, + .rail_thumb = .{ 0x62, 0x72, 0xa4 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:167 editorGroup.border: *PURPLE (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:18) - .border = .{ 0xbd, 0x93, 0xf9 }, + .rule = .{ 0xbd, 0x93, 0xf9 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:197 editor.findMatchBackground: !alpha [*ORANGE, 80] over BG - .search_bg = .{ 0x94, 0x71, 0x51 }, - // derived: the original keeps text colours over a match; the page's text, whichever reads better on it - .search_fg = .{ 0xf8, 0xf8, 0xf2 }, + .hit = .{ 0x94, 0x71, 0x51 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:248 editorError.foreground: *RED (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:19) - .diagnostic_error = .{ 0xff, 0x55, 0x55 }, + .@"error" = .{ 0xff, 0x55, 0x55 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:250 editorWarning.foreground: *CYAN (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:14) - .diagnostic_warning = .{ 0x8b, 0xe9, 0xfd }, - .palette = .{ + .warning = .{ 0x8b, 0xe9, 0xfd }, + .ansi = .{ .{ 0x21, 0x22, 0x2c }, // 0: ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:67 terminal.ansiBlack: *COLOR0 (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:22) .{ 0xff, 0x55, 0x55 }, // 1: ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:68 terminal.ansiRed: *COLOR1 (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:23) .{ 0x50, 0xfa, 0x7b }, // 2: ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:69 terminal.ansiGreen: *COLOR2 (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:24) diff --git a/core/themes/dracula_soft.zig b/core/themes/dracula_soft.zig index 9a8d5788..74396635 100644 --- a/core/themes/dracula_soft.zig +++ b/core/themes/dracula_soft.zig @@ -8,57 +8,56 @@ //! Adjusted to meet pardes's floors (chrome only; text, syntax and ANSI are untouched): //! - focused tag ground #282a36 -> #454751: 1.05:1 off the unfocused #272727, pardes needs 1.5:1 on a dark page //! - unfocused tag text #7b7f8b -> #8b8e99: 3.74:1 on #272727, tag text needs 4.5:1 to be read and run +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #7d6976 -> #a28d9b: 1.83:1 on the focused tag, now 3.00:1 (R6: 3:1) +//! - search hit #947151 -> #004c63: 3.21:1 off the page, now 1.50:1 (R8: 1.5:1, the text reading on it) pub const theme = .{ .name = "dracula_soft", // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:185 editor.background: *BG (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:10) - .bg = .{ 0x28, 0x2a, 0x36 }, + .page = .{ 0x28, 0x2a, 0x36 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:184 editor.foreground: *FG (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:11); Soft: desaturate(20) (~/05-genizah/dracula-visual-studio-code/scripts/generate.js:44) - .fg = .{ 0xf6, 0xf6, 0xf4 }, + .text = .{ 0xf6, 0xf6, 0xf4 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:189 editor.selectionBackground: *SELECTION (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:12) - .sel_bg = .{ 0x44, 0x47, 0x5a }, + .selection = .{ 0x44, 0x47, 0x5a }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xf6, 0xf6, 0xf4 }, + .selection_text = .{ 0xf6, 0xf6, 0xf4 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:178 tab.inactiveBackground: *BGDark (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:50); Soft: desaturate(20) (~/05-genizah/dracula-visual-studio-code/scripts/generate.js:44) - .tag_bg = .{ 0x27, 0x27, 0x27 }, + .tag = .{ 0x27, 0x27, 0x27 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:179 tab.inactiveForeground: *COMMENT (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:13); Soft: desaturate(20) (~/05-genizah/dracula-visual-studio-code/scripts/generate.js:44) #7b7f8b, adjusted - .tag_fg = .{ 0x8b, 0x8e, 0x99 }, + .tag_text = .{ 0x8b, 0x8e, 0x99 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:172 tab.activeBackground: *BG (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:10) #282a36, adjusted - .tag_active_bg = .{ 0x45, 0x47, 0x51 }, + .tag_focus = .{ 0x45, 0x47, 0x51 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:173 tab.activeForeground: *FG (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:11); Soft: desaturate(20) (~/05-genizah/dracula-visual-studio-code/scripts/generate.js:44) - .tag_active_fg = .{ 0xf6, 0xf6, 0xf4 }, + .tag_focus_text = .{ 0xf6, 0xf6, 0xf4 }, // the focused grip: ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:175 tab.activeBorderTop: !alpha [*PINK, 80] over BG; Soft: desaturate(20) (~/05-genizah/dracula-visual-studio-code/scripts/generate.js:44) - .box = .{ 0x7d, 0x69, 0x76 }, - // derived: the grip at rest, the accent #7d6976 faded toward the unfocused tag #272727 as far as 1.6:1 off it (0.46 of the way) - .box_dim = .{ 0x4f, 0x45, 0x4b }, + .accent = .{ 0x7d, 0x69, 0x76 }, // an unsaved grip: the original's warning colour, ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:250 editorWarning.foreground: *CYAN (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:14); Soft: desaturate(20) (~/05-genizah/dracula-visual-studio-code/scripts/generate.js:44) - .box_dirty = .{ 0x97, 0xe1, 0xf1 }, + .dirty = .{ 0x97, 0xe1, 0xf1 }, // derived: the column grip, the original's function colour, ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:688 tokenColors "Function names" *GREEN; Soft: desaturate(20) - .column_box = .{ 0x62, 0xe8, 0x84 }, + .column_grip = .{ 0x62, 0xe8, 0x84 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:725 tokenColors "Keywords" *PINK; Soft: desaturate(20) - .kw = .{ 0xf2, 0x86, 0xc4 }, + .keyword = .{ 0xf2, 0x86, 0xc4 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:978 tokenColors "Strings" *YELLOW; Soft: desaturate(20) - .str = .{ 0xe7, 0xee, 0x98 }, + .string = .{ 0xe7, 0xee, 0x98 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:640 tokenColors "Constants" *PURPLE; Soft: desaturate(20) - .num = .{ 0xbf, 0x9e, 0xee }, + .number = .{ 0xbf, 0x9e, 0xee }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:601 tokenColors "Comments" *COMMENT; Soft: desaturate(20) .comment = .{ 0x7b, 0x7f, 0x8b }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:186 editorLineNumber.foreground: *COMMENT (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:13); Soft: desaturate(20) (~/05-genizah/dracula-visual-studio-code/scripts/generate.js:44) - .lineno = .{ 0x7b, 0x7f, 0x8b }, + .line_number = .{ 0x7b, 0x7f, 0x8b }, // derived: none in the original; the page - .scroll_track = .{ 0x28, 0x2a, 0x36 }, + .rail = .{ 0x28, 0x2a, 0x36 }, // derived: none in the original; line numbers, ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:186 editorLineNumber.foreground: *COMMENT (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:13); Soft: desaturate(20) (~/05-genizah/dracula-visual-studio-code/scripts/generate.js:44) - .scroll_thumb = .{ 0x7b, 0x7f, 0x8b }, + .rail_thumb = .{ 0x7b, 0x7f, 0x8b }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:167 editorGroup.border: *PURPLE (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:18); Soft: desaturate(20) (~/05-genizah/dracula-visual-studio-code/scripts/generate.js:44) - .border = .{ 0xbf, 0x9e, 0xee }, + .rule = .{ 0xbf, 0x9e, 0xee }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:197 editor.findMatchBackground: !alpha [*ORANGE, 80] over BG - .search_bg = .{ 0x94, 0x71, 0x51 }, - // derived: the original keeps text colours over a match; the page's text, whichever reads better on it - .search_fg = .{ 0xf6, 0xf6, 0xf4 }, + .hit = .{ 0x94, 0x71, 0x51 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:248 editorError.foreground: *RED (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:19); Soft: desaturate(20) (~/05-genizah/dracula-visual-studio-code/scripts/generate.js:44) - .diagnostic_error = .{ 0xee, 0x66, 0x66 }, + .@"error" = .{ 0xee, 0x66, 0x66 }, // ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:250 editorWarning.foreground: *CYAN (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:14); Soft: desaturate(20) (~/05-genizah/dracula-visual-studio-code/scripts/generate.js:44) - .diagnostic_warning = .{ 0x97, 0xe1, 0xf1 }, - .palette = .{ + .warning = .{ 0x97, 0xe1, 0xf1 }, + .ansi = .{ .{ 0x27, 0x27, 0x27 }, // 0: ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:67 terminal.ansiBlack: *COLOR0 (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:22); Soft: desaturate(20) (~/05-genizah/dracula-visual-studio-code/scripts/generate.js:44) .{ 0xee, 0x66, 0x66 }, // 1: ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:68 terminal.ansiRed: *COLOR1 (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:23); Soft: desaturate(20) (~/05-genizah/dracula-visual-studio-code/scripts/generate.js:44) .{ 0x62, 0xe8, 0x84 }, // 2: ~/05-genizah/dracula-visual-studio-code/src/dracula.yml:69 terminal.ansiGreen: *COLOR2 (~/05-genizah/dracula-visual-studio-code/src/dracula.yml:24); Soft: desaturate(20) (~/05-genizah/dracula-visual-studio-code/scripts/generate.js:44) diff --git a/core/themes/duckbones.zig b/core/themes/duckbones.zig index c4f86997..dd2d92e7 100644 --- a/core/themes/duckbones.zig +++ b/core/themes/duckbones.zig @@ -15,63 +15,63 @@ //! (bold only), so it inherits Normal. TabLine links to StatusLine, TabLineFill //! to StatusLineNC. Accent is the lualine normal-mode a bg, a muted neutral //! (the theme is contrast-based, not hue-accented). Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #4f5570 -> #7e85a2: 1.51:1 on the focused tag, now 3.04:1 (R6: 3:1) +//! - error #e03600 -> #e63c0d: 4.24:1 on the page, now 4.53:1 (R9: 4.5:1, told from the text and the others) +//! - hint #795ccc -> #8569da: 3.81:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "duckbones", // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:34 Normal guibg - .bg = .{ 0x0e, 0x10, 0x1a }, + .page = .{ 0x0e, 0x10, 0x1a }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:34 Normal guifg - .fg = .{ 0xeb, 0xef, 0xc0 }, + .text = .{ 0xeb, 0xef, 0xc0 }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:212 Visual guibg - .sel_bg = .{ 0x37, 0x38, 0x2d }, + .selection = .{ 0x37, 0x38, 0x2d }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xeb, 0xef, 0xc0 }, + .selection_text = .{ 0xeb, 0xef, 0xc0 }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:199 StatusLineNC guibg - .tag_bg = .{ 0x1a, 0x1d, 0x2b }, + .tag = .{ 0x1a, 0x1d, 0x2b }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:199 StatusLineNC guifg - .tag_fg = .{ 0xf0, 0xf5, 0xc4 }, + .tag_text = .{ 0xf0, 0xf5, 0xc4 }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:196 StatusLine guibg #232738, adjusted - .tag_active_bg = .{ 0x35, 0x3b, 0x51 }, + .tag_focus = .{ 0x35, 0x3b, 0x51 }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:196 StatusLine guifg - .tag_active_fg = .{ 0xeb, 0xef, 0xc0 }, + .tag_focus_text = .{ 0xeb, 0xef, 0xc0 }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/duckbones_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0x4f, 0x55, 0x70 }, - // derived: the grip at rest, the accent #444a67 faded toward the unfocused tag #1a1d2b as far as 1.6:1 off it (0.76 of the way) - .box_dim = .{ 0x3a, 0x3f, 0x59 }, + .accent = .{ 0x4f, 0x55, 0x70 }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/duckbones.vim:42 Changed guifg - .box_dirty = .{ 0x00, 0xa3, 0xcb }, + .dirty = .{ 0x00, 0xa3, 0xcb }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/duckbones.vim:208 Type guifg - .column_box = .{ 0x89, 0x8f, 0xb1 }, + .column_grip = .{ 0x89, 0x8f, 0xb1 }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:193 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0x79, 0x5c, 0xcc }, + .keyword = .{ 0x79, 0x5c, 0xcc }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:202 String guifg - .str = .{ 0xae, 0xb1, 0x8d }, + .string = .{ 0xae, 0xb1, 0x8d }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:165 Number guifg - .num = .{ 0xae, 0xb1, 0x8d }, + .number = .{ 0xae, 0xb1, 0x8d }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:48 Comment guifg .comment = .{ 0x5a, 0x5f, 0x7b }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:151 LineNr guifg - .lineno = .{ 0x51, 0x58, 0x7a }, + .line_number = .{ 0x51, 0x58, 0x7a }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:63 CursorLineNr guifg - .lineno_active = .{ 0xeb, 0xef, 0xc0 }, + .line_number_current = .{ 0xeb, 0xef, 0xc0 }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:168 PmenuSbar guibg - .scroll_track = .{ 0x4b, 0x51, 0x70 }, + .rail = .{ 0x4b, 0x51, 0x70 }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:170 PmenuThumb guibg - .scroll_thumb = .{ 0x75, 0x7d, 0xa3 }, + .rail_thumb = .{ 0x75, 0x7d, 0xa3 }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:219 WinSeparator guifg - .border = .{ 0x51, 0x58, 0x7a }, + .rule = .{ 0x51, 0x58, 0x7a }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:174 Search guibg - .search_bg = .{ 0x4d, 0x31, 0x91 }, - // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:174 Search guifg - .search_fg = .{ 0xeb, 0xef, 0xc0 }, + .hit = .{ 0x4d, 0x31, 0x91 }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:114 Error guifg via DiagnosticError->Error (link :115) - .diagnostic_error = .{ 0xe0, 0x36, 0x00 }, + .@"error" = .{ 0xe0, 0x36, 0x00 }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:213 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :214) - .diagnostic_warning = .{ 0xe3, 0x95, 0x00 }, + .warning = .{ 0xe3, 0x95, 0x00 }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:73 DiagnosticInfo guifg - .diagnostic_info = .{ 0x00, 0xa3, 0xcb }, + .info = .{ 0x00, 0xa3, 0xcb }, // ~/05-genizah/zenbones.nvim/colors/duckbones.vim:68 DiagnosticHint guifg - .diagnostic_hint = .{ 0x79, 0x5c, 0xcc }, - .palette = .{ + .hint = .{ 0x79, 0x5c, 0xcc }, + .ansi = .{ .{ 0x0e, 0x10, 0x1a }, // 0: ~/05-genizah/zenbones.nvim/colors/duckbones.vim:18 g:terminal_color_0 .{ 0xe0, 0x36, 0x00 }, // 1: ~/05-genizah/zenbones.nvim/colors/duckbones.vim:19 g:terminal_color_1 .{ 0x5d, 0xcd, 0x97 }, // 2: ~/05-genizah/zenbones.nvim/colors/duckbones.vim:20 g:terminal_color_2 diff --git a/core/themes/dusk.zig b/core/themes/dusk.zig index 06f90ab2..30db779f 100644 --- a/core/themes/dusk.zig +++ b/core/themes/dusk.zig @@ -3,36 +3,32 @@ //! designed together. See docs/typ/themes.typ for the shared role contract. pub const theme = .{ .name = "dusk", - .bg = .{ 0x39, 0x32, 0x3b }, - .fg = .{ 0xc3, 0xb6, 0xc1 }, - .tag_bg = .{ 0x2c, 0x26, 0x30 }, - .tag_fg = .{ 0xc6, 0xb6, 0xc5 }, - .tag_name_fg = .{ 0x96, 0xc9, 0xb8 }, - .tag_active_name_fg = .{ 0xa1, 0xd5, 0xc4 }, - .tag_active_bg = .{ 0x3b, 0x2f, 0x3b }, - .tag_active_fg = .{ 0xd2, 0xc2, 0xd1 }, - .box = .{ 0xed, 0xb0, 0x92 }, - .box_dim = .{ 0x74, 0x54, 0x69 }, - .column_box = .{ 0xbd, 0xce, 0x8e }, - .column_box_dim = .{ 0x75, 0x7a, 0x5f }, - .kw = .{ 0xd0, 0xa7, 0xf2 }, - .str = .{ 0xbe, 0xd1, 0x8b }, - .num = .{ 0xf7, 0xb2, 0x83 }, + .page = .{ 0x39, 0x32, 0x3b }, + .text = .{ 0xc3, 0xb6, 0xc1 }, + .tag = .{ 0x2c, 0x26, 0x30 }, + .tag_text = .{ 0xc6, 0xb6, 0xc5 }, + .tag_name = .{ 0x96, 0xc9, 0xb8 }, + .tag_focus = .{ 0x3b, 0x2f, 0x3b }, + .tag_focus_text = .{ 0xd2, 0xc2, 0xd1 }, + .accent = .{ 0xed, 0xb0, 0x92 }, + .column_grip = .{ 0xbd, 0xce, 0x8e }, + .keyword = .{ 0xd0, 0xa7, 0xf2 }, + .string = .{ 0xbe, 0xd1, 0x8b }, + .number = .{ 0xf7, 0xb2, 0x83 }, .comment = .{ 0xff, 0xb8, 0x7b }, - .lineno = .{ 0x82, 0x71, 0x7e }, - .lineno_active = .{ 0x8a, 0x79, 0x86 }, - .scroll_track = .{ 0x3d, 0x35, 0x40 }, - .scroll_thumb = .{ 0x8e, 0x66, 0x7c }, - .border = .{ 0x6d, 0x58, 0x6b }, - .sel_bg = .{ 0x65, 0x40, 0x53 }, - .sel_fg = .{ 0xff, 0xf0, 0xeb }, - .search_bg = .{ 0x65, 0x4a, 0x27 }, - .search_fg = .{ 0xff, 0xe3, 0xa2 }, - .diagnostic_error = .{ 0xff, 0xa2, 0x9b }, - .diagnostic_warning = .{ 0xfc, 0xce, 0x7b }, - .diagnostic_info = .{ 0xa2, 0xcd, 0xe4 }, - .diagnostic_hint = .{ 0xc5, 0xd4, 0x9a }, - .palette = .{ + .line_number = .{ 0x82, 0x71, 0x7e }, + .line_number_current = .{ 0x8a, 0x79, 0x86 }, + .rail = .{ 0x3d, 0x35, 0x40 }, + .rail_thumb = .{ 0x8e, 0x66, 0x7c }, + .rule = .{ 0x6d, 0x58, 0x6b }, + .selection = .{ 0x65, 0x40, 0x53 }, + .selection_text = .{ 0xff, 0xf0, 0xeb }, + .hit = .{ 0x65, 0x4a, 0x27 }, + .@"error" = .{ 0xff, 0xa2, 0x9b }, + .warning = .{ 0xfc, 0xce, 0x7b }, + .info = .{ 0xa2, 0xcd, 0xe4 }, + .hint = .{ 0xc5, 0xd4, 0x9a }, + .ansi = .{ .{ 0x39, 0x32, 0x3b }, .{ 0xf6, 0xaa, 0xa4 }, .{ 0xba, 0xc8, 0x94 }, diff --git a/core/themes/forestbones_dark.zig b/core/themes/forestbones_dark.zig index 11825525..8b759f58 100644 --- a/core/themes/forestbones_dark.zig +++ b/core/themes/forestbones_dark.zig @@ -15,63 +15,62 @@ //! StatusLine, TabLineFill to StatusLineNC. Accent is the lualine normal-mode a //! bg, a muted neutral (the theme is contrast-based, not hue-accented). //! Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #6a7781 -> #9eacb7: 1.53:1 on the focused tag, now 3.03:1 (R6: 3:1) +//! - search hit #9e5179 -> #614a2b: 2.35:1 off the page, now 1.52:1 (R8: 1.5:1, the text reading on it) pub const theme = .{ .name = "forestbones_dark", // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:33 Normal guibg - .bg = .{ 0x2c, 0x34, 0x3a }, + .page = .{ 0x2c, 0x34, 0x3a }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:33 Normal guifg - .fg = .{ 0xe7, 0xdc, 0xc4 }, + .text = .{ 0xe7, 0xdc, 0xc4 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:211 Visual guibg - .sel_bg = .{ 0x61, 0x5b, 0x51 }, + .selection = .{ 0x61, 0x5b, 0x51 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xe7, 0xdc, 0xc4 }, + .selection_text = .{ 0xe7, 0xdc, 0xc4 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:198 StatusLineNC guibg - .tag_bg = .{ 0x35, 0x3f, 0x46 }, + .tag = .{ 0x35, 0x3f, 0x46 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:198 StatusLineNC guifg - .tag_fg = .{ 0xed, 0xe5, 0xd4 }, + .tag_text = .{ 0xed, 0xe5, 0xd4 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:195 StatusLine guibg #3e4850, adjusted - .tag_active_bg = .{ 0x50, 0x5a, 0x64 }, + .tag_focus = .{ 0x50, 0x5a, 0x64 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:195 StatusLine guifg - .tag_active_fg = .{ 0xe7, 0xdc, 0xc4 }, + .tag_focus_text = .{ 0xe7, 0xdc, 0xc4 }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/forestbones_dark_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0x6a, 0x77, 0x81 }, - // derived: the grip at rest, the accent #596873 faded toward the unfocused tag #353f46 as far as 1.6:1 off it (0.76 of the way) - .box_dim = .{ 0x50, 0x5e, 0x68 }, + .accent = .{ 0x6a, 0x77, 0x81 }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/forestbones.vim:41 Changed guifg - .box_dirty = .{ 0x7f, 0xbc, 0xb4 }, + .dirty = .{ 0x7f, 0xbc, 0xb4 }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/forestbones.vim:207 Type guifg - .column_box = .{ 0x7f, 0xbc, 0xb4 }, + .column_grip = .{ 0x7f, 0xbc, 0xb4 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:192 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0xa9, 0xc1, 0x81 }, + .keyword = .{ 0xa9, 0xc1, 0x81 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:201 String guifg - .str = .{ 0xad, 0xa2, 0x8b }, + .string = .{ 0xad, 0xa2, 0x8b }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:164 Number guifg - .num = .{ 0xad, 0xa2, 0x8b }, + .number = .{ 0xad, 0xa2, 0x8b }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:47 Comment guifg .comment = .{ 0x6e, 0x7b, 0x85 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:150 LineNr guifg - .lineno = .{ 0x66, 0x77, 0x83 }, + .line_number = .{ 0x66, 0x77, 0x83 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:62 CursorLineNr guifg - .lineno_active = .{ 0xe7, 0xdc, 0xc4 }, + .line_number_current = .{ 0xe7, 0xdc, 0xc4 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:167 PmenuSbar guibg - .scroll_track = .{ 0x60, 0x6f, 0x7b }, + .rail = .{ 0x60, 0x6f, 0x7b }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:169 PmenuThumb guibg - .scroll_thumb = .{ 0x82, 0x96, 0xa5 }, + .rail_thumb = .{ 0x82, 0x96, 0xa5 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:218 WinSeparator guifg - .border = .{ 0x66, 0x77, 0x83 }, + .rule = .{ 0x66, 0x77, 0x83 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:173 Search guibg - .search_bg = .{ 0x9e, 0x51, 0x79 }, - // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:173 Search guifg - .search_fg = .{ 0xe7, 0xdc, 0xc4 }, + .hit = .{ 0x9e, 0x51, 0x79 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:113 Error guifg via DiagnosticError->Error (link :114) - .diagnostic_error = .{ 0xe6, 0x7c, 0x7f }, + .@"error" = .{ 0xe6, 0x7c, 0x7f }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:212 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :213) - .diagnostic_warning = .{ 0xdd, 0xbd, 0x7f }, + .warning = .{ 0xdd, 0xbd, 0x7f }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:72 DiagnosticInfo guifg - .diagnostic_info = .{ 0x7f, 0xbc, 0xb4 }, + .info = .{ 0x7f, 0xbc, 0xb4 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:67 DiagnosticHint guifg - .diagnostic_hint = .{ 0xd6, 0x9a, 0xb7 }, - .palette = .{ + .hint = .{ 0xd6, 0x9a, 0xb7 }, + .ansi = .{ .{ 0x2c, 0x34, 0x3a }, // 0: ~/05-genizah/zenbones.nvim/colors/forestbones.vim:17 g:terminal_color_0 .{ 0xe6, 0x7c, 0x7f }, // 1: ~/05-genizah/zenbones.nvim/colors/forestbones.vim:18 g:terminal_color_1 .{ 0xa9, 0xc1, 0x81 }, // 2: ~/05-genizah/zenbones.nvim/colors/forestbones.vim:19 g:terminal_color_2 diff --git a/core/themes/forestbones_light.zig b/core/themes/forestbones_light.zig index e227d6a9..7d6132df 100644 --- a/core/themes/forestbones_light.zig +++ b/core/themes/forestbones_light.zig @@ -17,63 +17,68 @@ //! StatusLine, TabLineFill to StatusLineNC. Accent is the lualine normal-mode a //! bg, a muted neutral (the theme is contrast-based, not hue-accented). //! Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #b1a26f -> #7e703e: 1.56:1 on the focused tag, now 3.01:1 (R6: 3:1) +//! - unsaved grip #3a94c4 -> #1378a7: 2.62:1 on the tag, now 3.81:1 (R6: 3:1 on both tags) +//! - selection #d3dfe6 -> #d7dcd1: 1.23:1 off the page, now 1.26:1 (R7) +//! - search hit #eebadb -> #f9c96b: 1.50:1 off the page, now 1.40:1 (R8: 1.5:1, the text reading on it) +//! - error #f85550 -> #d22e30: 2.96:1 on the page, now 4.55:1 (R9: 4.5:1, told from the text and the others) +//! - warning #dea000 -> #926805: 2.08:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) +//! - info #3a94c4 -> #1277a6: 3.05:1 on the page, now 4.50:1 (R9: 4.5:1, told from the text and the others) +//! - hint #df69ba -> #b54293: 2.76:1 on the page, now 4.55:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "forestbones_light", // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:267 Normal guibg - .bg = .{ 0xfa, 0xf3, 0xe1 }, + .page = .{ 0xfa, 0xf3, 0xe1 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:267 Normal guifg - .fg = .{ 0x4f, 0x5b, 0x62 }, + .text = .{ 0x4f, 0x5b, 0x62 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:445 Visual guibg - .sel_bg = .{ 0xd3, 0xdf, 0xe6 }, + .selection = .{ 0xd3, 0xdf, 0xe6 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x4f, 0x5b, 0x62 }, + .selection_text = .{ 0x4f, 0x5b, 0x62 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:432 StatusLineNC guibg - .tag_bg = .{ 0xf3, 0xe2, 0xaa }, + .tag = .{ 0xf3, 0xe2, 0xaa }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:432 StatusLineNC guifg #758690, adjusted - .tag_fg = .{ 0x59, 0x66, 0x6d }, + .tag_text = .{ 0x59, 0x66, 0x6d }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:429 StatusLine guibg #e3d191, adjusted - .tag_active_bg = .{ 0xdd, 0xca, 0x87 }, + .tag_focus = .{ 0xdd, 0xca, 0x87 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:429 StatusLine guifg #4f5b62, adjusted - .tag_active_fg = .{ 0x4c, 0x57, 0x5e }, + .tag_focus_text = .{ 0x4c, 0x57, 0x5e }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/forestbones_light_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0xb1, 0xa2, 0x6f }, - // derived: the grip at rest, the accent #c0b079 faded toward the unfocused tag #f3e2aa as far as 1.6:1 off it (0.94 of the way) - .box_dim = .{ 0xc3, 0xb3, 0x7c }, + .accent = .{ 0xb1, 0xa2, 0x6f }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/forestbones.vim:275 Changed guifg - .box_dirty = .{ 0x3a, 0x94, 0xc4 }, + .dirty = .{ 0x3a, 0x94, 0xc4 }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/forestbones.vim:441 Type guifg - .column_box = .{ 0x3a, 0x94, 0xc4 }, + .column_grip = .{ 0x3a, 0x94, 0xc4 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:426 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0x8d, 0xa2, 0x00 }, + .keyword = .{ 0x8d, 0xa2, 0x00 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:435 String guifg - .str = .{ 0x73, 0x84, 0x8d }, + .string = .{ 0x73, 0x84, 0x8d }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:398 Number guifg - .num = .{ 0x73, 0x84, 0x8d }, + .number = .{ 0x73, 0x84, 0x8d }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:281 Comment guifg .comment = .{ 0x9a, 0x90, 0x71 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:384 LineNr guifg - .lineno = .{ 0xa9, 0x9b, 0x6a }, + .line_number = .{ 0xa9, 0x9b, 0x6a }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:296 CursorLineNr guifg - .lineno_active = .{ 0x4f, 0x5b, 0x62 }, + .line_number_current = .{ 0x4f, 0x5b, 0x62 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:401 PmenuSbar guibg - .scroll_track = .{ 0xb7, 0xa8, 0x74 }, + .rail = .{ 0xb7, 0xa8, 0x74 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:403 PmenuThumb guibg - .scroll_thumb = .{ 0xfc, 0xf9, 0xf1 }, + .rail_thumb = .{ 0xfc, 0xf9, 0xf1 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:452 WinSeparator guifg - .border = .{ 0xa9, 0x9b, 0x6a }, + .rule = .{ 0xa9, 0x9b, 0x6a }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:407 Search guibg - .search_bg = .{ 0xee, 0xba, 0xdb }, - // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:407 Search guifg - .search_fg = .{ 0x4f, 0x5b, 0x62 }, + .hit = .{ 0xee, 0xba, 0xdb }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:347 Error guifg via DiagnosticError->Error (link :348) - .diagnostic_error = .{ 0xf8, 0x55, 0x50 }, + .@"error" = .{ 0xf8, 0x55, 0x50 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:446 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :447) - .diagnostic_warning = .{ 0xde, 0xa0, 0x00 }, + .warning = .{ 0xde, 0xa0, 0x00 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:306 DiagnosticInfo guifg - .diagnostic_info = .{ 0x3a, 0x94, 0xc4 }, + .info = .{ 0x3a, 0x94, 0xc4 }, // ~/05-genizah/zenbones.nvim/colors/forestbones.vim:301 DiagnosticHint guifg - .diagnostic_hint = .{ 0xdf, 0x69, 0xba }, - .palette = .{ + .hint = .{ 0xdf, 0x69, 0xba }, + .ansi = .{ .{ 0xfa, 0xf3, 0xe1 }, // 0: ~/05-genizah/zenbones.nvim/colors/forestbones.vim:251 g:terminal_color_0 .{ 0xf8, 0x55, 0x50 }, // 1: ~/05-genizah/zenbones.nvim/colors/forestbones.vim:252 g:terminal_color_1 .{ 0x8d, 0xa2, 0x00 }, // 2: ~/05-genizah/zenbones.nvim/colors/forestbones.vim:253 g:terminal_color_2 diff --git a/core/themes/forge.zig b/core/themes/forge.zig index 0effa742..6a0dab5f 100644 --- a/core/themes/forge.zig +++ b/core/themes/forge.zig @@ -4,37 +4,33 @@ //! Pardes-specific tag, search, diagnostic and ANSI roles; see docs/typ/themes.typ. pub const theme = .{ .name = "forge", - .bg = .{ 0x0c, 0x0c, 0x0e }, - .fg = .{ 0xe5, 0xe5, 0xe5 }, - .tag_bg = .{ 0x22, 0x25, 0x2b }, - .tag_fg = .{ 0xc5, 0xc9, 0xd2 }, - .tag_name_fg = .{ 0xec, 0xbf, 0x9b }, - .tag_active_name_fg = .{ 0xf8, 0xcb, 0xa7 }, - .tag_active_bg = .{ 0x2d, 0x34, 0x40 }, - .tag_active_fg = .{ 0xd1, 0xd5, 0xde }, - .box = .{ 0x9c, 0xc3, 0xf7 }, - .box_dim = .{ 0x55, 0x64, 0x7b }, - .column_box = .{ 0xb4, 0xd3, 0xa3 }, - .column_box_dim = .{ 0x6a, 0x7b, 0x67 }, - .kw = .{ 0x61, 0xb7, 0xfc }, - .str = .{ 0xdd, 0x8b, 0x69 }, - .num = .{ 0xb3, 0xd5, 0xa1 }, + .page = .{ 0x0c, 0x0c, 0x0e }, + .text = .{ 0xe5, 0xe5, 0xe5 }, + .tag = .{ 0x22, 0x25, 0x2b }, + .tag_text = .{ 0xc5, 0xc9, 0xd2 }, + .tag_name = .{ 0xec, 0xbf, 0x9b }, + .tag_focus = .{ 0x2d, 0x34, 0x40 }, + .tag_focus_text = .{ 0xd1, 0xd5, 0xde }, + .accent = .{ 0x9c, 0xc3, 0xf7 }, + .column_grip = .{ 0xb4, 0xd3, 0xa3 }, + .keyword = .{ 0x61, 0xb7, 0xfc }, + .string = .{ 0xdd, 0x8b, 0x69 }, + .number = .{ 0xb3, 0xd5, 0xa1 }, .comment = .{ 0xb3, 0xca, 0xff }, - .lineno = .{ 0x62, 0x65, 0x6c }, - .lineno_active = .{ 0x6a, 0x6d, 0x74 }, - .scroll_track = .{ 0x1a, 0x1c, 0x21 }, - .scroll_thumb = .{ 0x70, 0x80, 0x95 }, - .border = .{ 0x60, 0x6f, 0x86 }, - .sel_bg = .{ 0x1c, 0x51, 0x72 }, - .sel_fg = .{ 0xe2, 0xee, 0xf4 }, - .search_bg = .{ 0x61, 0x4d, 0x1d }, - .search_fg = .{ 0xf5, 0xdf, 0xa1 }, - .diagnostic_error = .{ 0xff, 0x7f, 0x74 }, - .diagnostic_warning = .{ 0xe4, 0xbf, 0x70 }, - .diagnostic_info = .{ 0x75, 0xbe, 0xff }, - .diagnostic_hint = .{ 0x81, 0xd8, 0xbe }, + .line_number = .{ 0x62, 0x65, 0x6c }, + .line_number_current = .{ 0x6a, 0x6d, 0x74 }, + .rail = .{ 0x1a, 0x1c, 0x21 }, + .rail_thumb = .{ 0x70, 0x80, 0x95 }, + .rule = .{ 0x60, 0x6f, 0x86 }, + .selection = .{ 0x1c, 0x51, 0x72 }, + .selection_text = .{ 0xe2, 0xee, 0xf4 }, + .hit = .{ 0x61, 0x4d, 0x1d }, + .@"error" = .{ 0xff, 0x7f, 0x74 }, + .warning = .{ 0xe4, 0xbf, 0x70 }, + .info = .{ 0x75, 0xbe, 0xff }, + .hint = .{ 0x81, 0xd8, 0xbe }, // ANSI roles are semantic colors, independent of peach string syntax. - .palette = .{ + .ansi = .{ .{ 0x0c, 0x0c, 0x0e }, .{ 0xf2, 0x8a, 0x81 }, .{ 0xb5, 0xce, 0xa8 }, diff --git a/core/themes/forge_black.zig b/core/themes/forge_black.zig index f51e8594..74401c08 100644 --- a/core/themes/forge_black.zig +++ b/core/themes/forge_black.zig @@ -4,37 +4,33 @@ //! Pardes-specific tag, search, diagnostic and ANSI roles; see docs/typ/themes.typ. pub const theme = .{ .name = "forge_black", - .bg = .{ 0x00, 0x00, 0x00 }, - .fg = .{ 0xf6, 0xf6, 0xf6 }, - .tag_bg = .{ 0x22, 0x25, 0x2b }, - .tag_fg = .{ 0xc5, 0xc9, 0xd2 }, - .tag_name_fg = .{ 0xec, 0xbf, 0x9b }, - .tag_active_name_fg = .{ 0xf8, 0xcb, 0xa7 }, - .tag_active_bg = .{ 0x2d, 0x34, 0x40 }, - .tag_active_fg = .{ 0xd1, 0xd5, 0xde }, - .box = .{ 0x9c, 0xc3, 0xf7 }, - .box_dim = .{ 0x55, 0x64, 0x7b }, - .column_box = .{ 0xb4, 0xd3, 0xa3 }, - .column_box_dim = .{ 0x6a, 0x7b, 0x67 }, - .kw = .{ 0x61, 0xb7, 0xfc }, - .str = .{ 0xdd, 0x8b, 0x69 }, - .num = .{ 0xb3, 0xd5, 0xa1 }, + .page = .{ 0x00, 0x00, 0x00 }, + .text = .{ 0xf6, 0xf6, 0xf6 }, + .tag = .{ 0x22, 0x25, 0x2b }, + .tag_text = .{ 0xc5, 0xc9, 0xd2 }, + .tag_name = .{ 0xec, 0xbf, 0x9b }, + .tag_focus = .{ 0x2d, 0x34, 0x40 }, + .tag_focus_text = .{ 0xd1, 0xd5, 0xde }, + .accent = .{ 0x9c, 0xc3, 0xf7 }, + .column_grip = .{ 0xb4, 0xd3, 0xa3 }, + .keyword = .{ 0x61, 0xb7, 0xfc }, + .string = .{ 0xdd, 0x8b, 0x69 }, + .number = .{ 0xb3, 0xd5, 0xa1 }, .comment = .{ 0xb3, 0xca, 0xff }, - .lineno = .{ 0x62, 0x65, 0x6c }, - .lineno_active = .{ 0x6a, 0x6d, 0x74 }, - .scroll_track = .{ 0x14, 0x16, 0x1a }, - .scroll_thumb = .{ 0x70, 0x80, 0x95 }, - .border = .{ 0x60, 0x6f, 0x86 }, - .sel_bg = .{ 0x1c, 0x51, 0x72 }, - .sel_fg = .{ 0xe2, 0xee, 0xf4 }, - .search_bg = .{ 0x61, 0x4d, 0x1d }, - .search_fg = .{ 0xf5, 0xdf, 0xa1 }, - .diagnostic_error = .{ 0xff, 0x7f, 0x74 }, - .diagnostic_warning = .{ 0xe4, 0xbf, 0x70 }, - .diagnostic_info = .{ 0x75, 0xbe, 0xff }, - .diagnostic_hint = .{ 0x81, 0xd8, 0xbe }, + .line_number = .{ 0x62, 0x65, 0x6c }, + .line_number_current = .{ 0x6a, 0x6d, 0x74 }, + .rail = .{ 0x14, 0x16, 0x1a }, + .rail_thumb = .{ 0x70, 0x80, 0x95 }, + .rule = .{ 0x60, 0x6f, 0x86 }, + .selection = .{ 0x1c, 0x51, 0x72 }, + .selection_text = .{ 0xe2, 0xee, 0xf4 }, + .hit = .{ 0x61, 0x4d, 0x1d }, + .@"error" = .{ 0xff, 0x7f, 0x74 }, + .warning = .{ 0xe4, 0xbf, 0x70 }, + .info = .{ 0x75, 0xbe, 0xff }, + .hint = .{ 0x81, 0xd8, 0xbe }, // ANSI roles are semantic colors, independent of peach string syntax. - .palette = .{ + .ansi = .{ .{ 0x00, 0x00, 0x00 }, .{ 0xf2, 0x8a, 0x81 }, .{ 0xb5, 0xce, 0xa8 }, diff --git a/core/themes/forge_soft.zig b/core/themes/forge_soft.zig index a0cf141b..3d9f8fe6 100644 --- a/core/themes/forge_soft.zig +++ b/core/themes/forge_soft.zig @@ -4,37 +4,33 @@ //! Pardes-specific tag, search, diagnostic and ANSI roles; see docs/typ/themes.typ. pub const theme = .{ .name = "forge_soft", - .bg = .{ 0x35, 0x38, 0x3e }, - .fg = .{ 0xbf, 0xc3, 0xcc }, - .tag_bg = .{ 0x2a, 0x2d, 0x34 }, - .tag_fg = .{ 0xc5, 0xc9, 0xd2 }, - .tag_name_fg = .{ 0xec, 0xbf, 0x9b }, - .tag_active_name_fg = .{ 0xf8, 0xcb, 0xa7 }, - .tag_active_bg = .{ 0x37, 0x3e, 0x49 }, - .tag_active_fg = .{ 0xd1, 0xd5, 0xde }, - .box = .{ 0x9c, 0xc3, 0xf7 }, - .box_dim = .{ 0x55, 0x64, 0x7b }, - .column_box = .{ 0xb4, 0xd3, 0xa3 }, - .column_box_dim = .{ 0x6d, 0x7f, 0x6c }, - .kw = .{ 0x61, 0xb7, 0xfc }, - .str = .{ 0xe7, 0xa0, 0x81 }, - .num = .{ 0xb3, 0xd5, 0xa1 }, + .page = .{ 0x35, 0x38, 0x3e }, + .text = .{ 0xbf, 0xc3, 0xcc }, + .tag = .{ 0x2a, 0x2d, 0x34 }, + .tag_text = .{ 0xc5, 0xc9, 0xd2 }, + .tag_name = .{ 0xec, 0xbf, 0x9b }, + .tag_focus = .{ 0x37, 0x3e, 0x49 }, + .tag_focus_text = .{ 0xd1, 0xd5, 0xde }, + .accent = .{ 0x9c, 0xc3, 0xf7 }, + .column_grip = .{ 0xb4, 0xd3, 0xa3 }, + .keyword = .{ 0x61, 0xb7, 0xfc }, + .string = .{ 0xe7, 0xa0, 0x81 }, + .number = .{ 0xb3, 0xd5, 0xa1 }, .comment = .{ 0xb3, 0xca, 0xff }, - .lineno = .{ 0x86, 0x89, 0x91 }, - .lineno_active = .{ 0x8e, 0x91, 0x99 }, - .scroll_track = .{ 0x3d, 0x40, 0x47 }, - .scroll_thumb = .{ 0x70, 0x80, 0x95 }, - .border = .{ 0x60, 0x6f, 0x86 }, - .sel_bg = .{ 0x1c, 0x51, 0x72 }, - .sel_fg = .{ 0xe2, 0xee, 0xf4 }, - .search_bg = .{ 0x61, 0x4d, 0x1d }, - .search_fg = .{ 0xf5, 0xdf, 0xa1 }, - .diagnostic_error = .{ 0xff, 0x7f, 0x74 }, - .diagnostic_warning = .{ 0xe4, 0xbf, 0x70 }, - .diagnostic_info = .{ 0x75, 0xbe, 0xff }, - .diagnostic_hint = .{ 0x81, 0xd8, 0xbe }, + .line_number = .{ 0x86, 0x89, 0x91 }, + .line_number_current = .{ 0x8e, 0x91, 0x99 }, + .rail = .{ 0x3d, 0x40, 0x47 }, + .rail_thumb = .{ 0x70, 0x80, 0x95 }, + .rule = .{ 0x60, 0x6f, 0x86 }, + .selection = .{ 0x1c, 0x51, 0x72 }, + .selection_text = .{ 0xe2, 0xee, 0xf4 }, + .hit = .{ 0x61, 0x4d, 0x1d }, + .@"error" = .{ 0xff, 0x7f, 0x74 }, + .warning = .{ 0xe4, 0xbf, 0x70 }, + .info = .{ 0x75, 0xbe, 0xff }, + .hint = .{ 0x81, 0xd8, 0xbe }, // ANSI roles are semantic colors, independent of peach string syntax. - .palette = .{ + .ansi = .{ .{ 0x35, 0x38, 0x3e }, .{ 0xf2, 0x8a, 0x81 }, .{ 0xb5, 0xce, 0xa8 }, diff --git a/core/themes/harvest.zig b/core/themes/harvest.zig index b0ad57c7..a0a44656 100644 --- a/core/themes/harvest.zig +++ b/core/themes/harvest.zig @@ -4,36 +4,32 @@ //! Pardes-specific tag, search, diagnostic and ANSI roles; see docs/typ/themes.typ. pub const theme = .{ .name = "harvest", - .bg = .{ 0x10, 0x0e, 0x0b }, - .fg = .{ 0xf3, 0xf2, 0xcc }, - .tag_bg = .{ 0x34, 0x3b, 0x2e }, - .tag_fg = .{ 0xd5, 0xd8, 0xb8 }, - .tag_name_fg = .{ 0xba, 0xdb, 0xeb }, - .tag_active_name_fg = .{ 0xc5, 0xe7, 0xf7 }, - .tag_active_bg = .{ 0x42, 0x4d, 0x38 }, - .tag_active_fg = .{ 0xe1, 0xe4, 0xc4 }, - .box = .{ 0xd8, 0xbd, 0x83 }, - .box_dim = .{ 0x7b, 0x7e, 0x4e }, - .column_box = .{ 0xff, 0x74, 0x54 }, - .column_box_dim = .{ 0x9b, 0x58, 0x3f }, - .kw = .{ 0xff, 0x74, 0x54 }, - .str = .{ 0x9a, 0xcc, 0x62 }, - .num = .{ 0xff, 0xd8, 0x61 }, + .page = .{ 0x10, 0x0e, 0x0b }, + .text = .{ 0xf3, 0xf2, 0xcc }, + .tag = .{ 0x34, 0x3b, 0x2e }, + .tag_text = .{ 0xd5, 0xd8, 0xb8 }, + .tag_name = .{ 0xba, 0xdb, 0xeb }, + .tag_focus = .{ 0x42, 0x4d, 0x38 }, + .tag_focus_text = .{ 0xe1, 0xe4, 0xc4 }, + .accent = .{ 0xd8, 0xbd, 0x83 }, + .column_grip = .{ 0xff, 0x74, 0x54 }, + .keyword = .{ 0xff, 0x74, 0x54 }, + .string = .{ 0x9a, 0xcc, 0x62 }, + .number = .{ 0xff, 0xd8, 0x61 }, .comment = .{ 0xff, 0xca, 0x7c }, - .lineno = .{ 0x6a, 0x64, 0x56 }, - .lineno_active = .{ 0x72, 0x6c, 0x5e }, - .scroll_track = .{ 0x20, 0x1d, 0x17 }, - .scroll_thumb = .{ 0x88, 0x8e, 0x5e }, - .border = .{ 0x78, 0x88, 0x60 }, - .sel_bg = .{ 0x4f, 0x58, 0x34 }, - .sel_fg = .{ 0xf3, 0xf2, 0xcc }, - .search_bg = .{ 0x6f, 0x44, 0x24 }, - .search_fg = .{ 0xff, 0xe2, 0xac }, - .diagnostic_error = .{ 0xff, 0x84, 0x69 }, - .diagnostic_warning = .{ 0xff, 0xd8, 0x61 }, - .diagnostic_info = .{ 0x7d, 0xca, 0xbf }, - .diagnostic_hint = .{ 0xb9, 0xcf, 0x83 }, - .palette = .{ + .line_number = .{ 0x6a, 0x64, 0x56 }, + .line_number_current = .{ 0x72, 0x6c, 0x5e }, + .rail = .{ 0x20, 0x1d, 0x17 }, + .rail_thumb = .{ 0x88, 0x8e, 0x5e }, + .rule = .{ 0x78, 0x88, 0x60 }, + .selection = .{ 0x4f, 0x58, 0x34 }, + .selection_text = .{ 0xf3, 0xf2, 0xcc }, + .hit = .{ 0x6f, 0x44, 0x24 }, + .@"error" = .{ 0xff, 0x84, 0x69 }, + .warning = .{ 0xff, 0xd8, 0x61 }, + .info = .{ 0x7d, 0xca, 0xbf }, + .hint = .{ 0xb9, 0xcf, 0x83 }, + .ansi = .{ .{ 0x10, 0x0e, 0x0b }, .{ 0xf5, 0x8a, 0x73 }, .{ 0x99, 0xbe, 0x70 }, diff --git a/core/themes/helix.zig b/core/themes/helix.zig index 61dc8e63..9ee639df 100644 --- a/core/themes/helix.zig +++ b/core/themes/helix.zig @@ -37,24 +37,23 @@ //! turns a missing field here into a compile error naming it. pub const theme = .{ .name = "helix", - .bg = .{ 0x08, 0x08, 0x08 }, - .fg = .{ 0xbd, 0xbd, 0xbd }, - .sel_bg = .{ 0x80, 0xa0, 0xff }, - .sel_fg = .{ 0x08, 0x08, 0x08 }, - .tag_bg = .{ 0x12, 0x12, 0x12 }, - .tag_fg = .{ 0x94, 0x94, 0x94 }, + .page = .{ 0x08, 0x08, 0x08 }, + .text = .{ 0xbd, 0xbd, 0xbd }, + .selection = .{ 0x80, 0xa0, 0xff }, + .selection_text = .{ 0x08, 0x08, 0x08 }, + .tag = .{ 0x12, 0x12, 0x12 }, + .tag_text = .{ 0x94, 0x94, 0x94 }, // The focused tag, still on the ramp: 237 #3a3a3a under 250 #bdbdbd // (the page's text), 1.65:1 off the plain bar. - .tag_active_bg = .{ 0x3a, 0x3a, 0x3a }, - .tag_active_fg = .{ 0xbd, 0xbd, 0xbd }, - .box = .{ 0x62, 0x62, 0x62 }, - .box_dim = .{ 0x26, 0x26, 0x26 }, - .kw = .{ 0xd7, 0x76, 0xf9 }, - .str = .{ 0xf3, 0xcd, 0x7a }, - .num = .{ 0xf3, 0xcd, 0x7a }, + .tag_focus = .{ 0x3a, 0x3a, 0x3a }, + .tag_focus_text = .{ 0xbd, 0xbd, 0xbd }, + .accent = .{ 0x62, 0x62, 0x62 }, + .keyword = .{ 0xd7, 0x76, 0xf9 }, + .string = .{ 0xf3, 0xcd, 0x7a }, + .number = .{ 0xf3, 0xcd, 0x7a }, .comment = .{ 0xff, 0xff, 0xff }, - .lineno = .{ 0x62, 0x62, 0x62 }, - .scroll_track = .{ 0x12, 0x12, 0x12 }, - .scroll_thumb = .{ 0x44, 0x44, 0x44 }, - .palette = null, + .line_number = .{ 0x62, 0x62, 0x62 }, + .rail = .{ 0x12, 0x12, 0x12 }, + .rail_thumb = .{ 0x44, 0x44, 0x44 }, + .ansi = null, }; diff --git a/core/themes/ink.zig b/core/themes/ink.zig index 4151df7a..ca718cce 100644 --- a/core/themes/ink.zig +++ b/core/themes/ink.zig @@ -3,36 +3,32 @@ //! designed together. See docs/typ/themes.typ for the shared role contract. pub const theme = .{ .name = "ink", - .bg = .{ 0x00, 0x00, 0x00 }, - .fg = .{ 0xf3, 0xf7, 0xfc }, - .tag_bg = .{ 0x15, 0x21, 0x2c }, - .tag_fg = .{ 0xd5, 0xe4, 0xf1 }, - .tag_name_fg = .{ 0xf5, 0xe0, 0xac }, - .tag_active_name_fg = .{ 0xff, 0xea, 0xb8 }, - .tag_active_bg = .{ 0x22, 0x33, 0x42 }, - .tag_active_fg = .{ 0xe1, 0xee, 0xf9 }, - .box = .{ 0x86, 0xd8, 0xff }, - .box_dim = .{ 0x5f, 0x79, 0x90 }, - .column_box = .{ 0xff, 0xd6, 0x94 }, - .column_box_dim = .{ 0x8f, 0x7d, 0x5b }, - .kw = .{ 0xd5, 0xb8, 0xff }, - .str = .{ 0xac, 0xf9, 0xa3 }, - .num = .{ 0xff, 0xd6, 0x94 }, + .page = .{ 0x00, 0x00, 0x00 }, + .text = .{ 0xf3, 0xf7, 0xfc }, + .tag = .{ 0x15, 0x21, 0x2c }, + .tag_text = .{ 0xd5, 0xe4, 0xf1 }, + .tag_name = .{ 0xf5, 0xe0, 0xac }, + .tag_focus = .{ 0x22, 0x33, 0x42 }, + .tag_focus_text = .{ 0xe1, 0xee, 0xf9 }, + .accent = .{ 0x86, 0xd8, 0xff }, + .column_grip = .{ 0xff, 0xd6, 0x94 }, + .keyword = .{ 0xd5, 0xb8, 0xff }, + .string = .{ 0xac, 0xf9, 0xa3 }, + .number = .{ 0xff, 0xd6, 0x94 }, .comment = .{ 0x9d, 0xee, 0xff }, - .lineno = .{ 0x62, 0x6b, 0x75 }, - .lineno_active = .{ 0x6a, 0x73, 0x7d }, - .scroll_track = .{ 0x15, 0x21, 0x2c }, - .scroll_thumb = .{ 0x86, 0xa8, 0xc2 }, - .border = .{ 0x80, 0x95, 0xa9 }, - .sel_bg = .{ 0x1b, 0x54, 0x7c }, - .sel_fg = .{ 0xff, 0xff, 0xff }, - .search_bg = .{ 0x7c, 0x4e, 0x0d }, - .search_fg = .{ 0xff, 0xff, 0xff }, - .diagnostic_error = .{ 0xff, 0xb1, 0xb1 }, - .diagnostic_warning = .{ 0xff, 0xe2, 0x9c }, - .diagnostic_info = .{ 0x9b, 0xde, 0xff }, - .diagnostic_hint = .{ 0xc4, 0xeb, 0xae }, - .palette = .{ + .line_number = .{ 0x62, 0x6b, 0x75 }, + .line_number_current = .{ 0x6a, 0x73, 0x7d }, + .rail = .{ 0x15, 0x21, 0x2c }, + .rail_thumb = .{ 0x86, 0xa8, 0xc2 }, + .rule = .{ 0x80, 0x95, 0xa9 }, + .selection = .{ 0x1b, 0x54, 0x7c }, + .selection_text = .{ 0xff, 0xff, 0xff }, + .hit = .{ 0x7c, 0x4e, 0x0d }, + .@"error" = .{ 0xff, 0xb1, 0xb1 }, + .warning = .{ 0xff, 0xe2, 0x9c }, + .info = .{ 0x9b, 0xde, 0xff }, + .hint = .{ 0xc4, 0xeb, 0xae }, + .ansi = .{ .{ 0x00, 0x00, 0x00 }, .{ 0xff, 0xb1, 0xb1 }, .{ 0xb5, 0xee, 0xae }, diff --git a/core/themes/kanagawabones.zig b/core/themes/kanagawabones.zig index 94e5aab0..345d6227 100644 --- a/core/themes/kanagawabones.zig +++ b/core/themes/kanagawabones.zig @@ -16,63 +16,61 @@ //! StatusLine, TabLineFill to StatusLineNC. Accent is the lualine normal-mode a //! bg, a muted neutral (the theme is contrast-based, not hue-accented). //! Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #606071 -> #9090a2: 1.54:1 on the focused tag, now 3.03:1 (R6: 3:1) pub const theme = .{ .name = "kanagawabones", // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:34 Normal guibg - .bg = .{ 0x1f, 0x1f, 0x28 }, + .page = .{ 0x1f, 0x1f, 0x28 }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:34 Normal guifg - .fg = .{ 0xdd, 0xd8, 0xbb }, + .text = .{ 0xdd, 0xd8, 0xbb }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:212 Visual guibg - .sel_bg = .{ 0x49, 0x47, 0x3e }, + .selection = .{ 0x49, 0x47, 0x3e }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xdd, 0xd8, 0xbb }, + .selection_text = .{ 0xdd, 0xd8, 0xbb }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:199 StatusLineNC guibg - .tag_bg = .{ 0x29, 0x29, 0x34 }, + .tag = .{ 0x29, 0x29, 0x34 }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:199 StatusLineNC guifg - .tag_fg = .{ 0xe9, 0xe3, 0xc5 }, + .tag_text = .{ 0xe9, 0xe3, 0xc5 }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:196 StatusLine guibg #363644, adjusted - .tag_active_bg = .{ 0x44, 0x44, 0x56 }, + .tag_focus = .{ 0x44, 0x44, 0x56 }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:196 StatusLine guifg - .tag_active_fg = .{ 0xdd, 0xd8, 0xbb }, + .tag_focus_text = .{ 0xdd, 0xd8, 0xbb }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/kanagawabones_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0x60, 0x60, 0x71 }, - // derived: the grip at rest, the accent #565668 faded toward the unfocused tag #292934 as far as 1.6:1 off it (0.70 of the way) - .box_dim = .{ 0x49, 0x49, 0x58 }, + .accent = .{ 0x60, 0x60, 0x71 }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:42 Changed guifg - .box_dirty = .{ 0x7e, 0xb3, 0xc9 }, + .dirty = .{ 0x7e, 0xb3, 0xc9 }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:208 Type guifg - .column_box = .{ 0x97, 0x97, 0xa5 }, + .column_grip = .{ 0x97, 0x97, 0xa5 }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:192 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0xdd, 0xd8, 0xbb }, + .keyword = .{ 0xdd, 0xd8, 0xbb }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:202 String guifg - .str = .{ 0xa2, 0x9e, 0x89 }, + .string = .{ 0xa2, 0x9e, 0x89 }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:165 Number guifg - .num = .{ 0xa2, 0x9e, 0x89 }, + .number = .{ 0xa2, 0x9e, 0x89 }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:48 Comment guifg .comment = .{ 0x69, 0x69, 0x77 }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:151 LineNr guifg - .lineno = .{ 0x64, 0x64, 0x76 }, + .line_number = .{ 0x64, 0x64, 0x76 }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:63 CursorLineNr guifg - .lineno_active = .{ 0xdd, 0xd8, 0xbb }, + .line_number_current = .{ 0xdd, 0xd8, 0xbb }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:168 PmenuSbar guibg - .scroll_track = .{ 0x5d, 0x5d, 0x6f }, + .rail = .{ 0x5d, 0x5d, 0x6f }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:170 PmenuThumb guibg - .scroll_thumb = .{ 0x85, 0x85, 0x94 }, + .rail_thumb = .{ 0x85, 0x85, 0x94 }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:219 WinSeparator guifg - .border = .{ 0x64, 0x64, 0x76 }, + .rule = .{ 0x64, 0x64, 0x76 }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:173 Search guibg - .search_bg = .{ 0x61, 0x4a, 0x82 }, - // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:173 Search guifg - .search_fg = .{ 0xdd, 0xd8, 0xbb }, + .hit = .{ 0x61, 0x4a, 0x82 }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:114 Error guifg via DiagnosticError->Error (link :115) - .diagnostic_error = .{ 0xe4, 0x6a, 0x78 }, + .@"error" = .{ 0xe4, 0x6a, 0x78 }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:213 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :214) - .diagnostic_warning = .{ 0xe5, 0xc2, 0x83 }, + .warning = .{ 0xe5, 0xc2, 0x83 }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:73 DiagnosticInfo guifg - .diagnostic_info = .{ 0x7e, 0xb3, 0xc9 }, + .info = .{ 0x7e, 0xb3, 0xc9 }, // ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:68 DiagnosticHint guifg - .diagnostic_hint = .{ 0x95, 0x7f, 0xb8 }, - .palette = .{ + .hint = .{ 0x95, 0x7f, 0xb8 }, + .ansi = .{ .{ 0x1f, 0x1f, 0x28 }, // 0: ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:18 g:terminal_color_0 .{ 0xe4, 0x6a, 0x78 }, // 1: ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:19 g:terminal_color_1 .{ 0x98, 0xbc, 0x6d }, // 2: ~/05-genizah/zenbones.nvim/colors/kanagawabones.vim:20 g:terminal_color_2 diff --git a/core/themes/lagoon.zig b/core/themes/lagoon.zig index 66473c46..7679f4ea 100644 --- a/core/themes/lagoon.zig +++ b/core/themes/lagoon.zig @@ -4,36 +4,32 @@ //! Pardes-specific tag, search, diagnostic and ANSI roles; see docs/typ/themes.typ. pub const theme = .{ .name = "lagoon", - .bg = .{ 0x34, 0x46, 0x4c }, - .fg = .{ 0xba, 0xc9, 0xce }, - .tag_bg = .{ 0x29, 0x44, 0x3f }, - .tag_fg = .{ 0xbb, 0xd7, 0xcb }, - .tag_name_fg = .{ 0xe4, 0xc2, 0xec }, - .tag_active_name_fg = .{ 0xf0, 0xce, 0xf8 }, - .tag_active_bg = .{ 0x34, 0x57, 0x4d }, - .tag_active_fg = .{ 0xc7, 0xe3, 0xd7 }, - .box = .{ 0x81, 0xcf, 0xb7 }, - .box_dim = .{ 0x54, 0x83, 0x72 }, - .column_box = .{ 0xff, 0xad, 0x91 }, - .column_box_dim = .{ 0x9a, 0x76, 0x62 }, - .kw = .{ 0xd9, 0x9c, 0xf9 }, - .str = .{ 0xc6, 0xf8, 0x7d }, - .num = .{ 0xff, 0xad, 0x91 }, + .page = .{ 0x34, 0x46, 0x4c }, + .text = .{ 0xba, 0xc9, 0xce }, + .tag = .{ 0x29, 0x44, 0x3f }, + .tag_text = .{ 0xbb, 0xd7, 0xcb }, + .tag_name = .{ 0xe4, 0xc2, 0xec }, + .tag_focus = .{ 0x34, 0x57, 0x4d }, + .tag_focus_text = .{ 0xc7, 0xe3, 0xd7 }, + .accent = .{ 0x81, 0xcf, 0xb7 }, + .column_grip = .{ 0xff, 0xad, 0x91 }, + .keyword = .{ 0xd9, 0x9c, 0xf9 }, + .string = .{ 0xc6, 0xf8, 0x7d }, + .number = .{ 0xff, 0xad, 0x91 }, .comment = .{ 0x84, 0xef, 0xd9 }, - .lineno = .{ 0x7b, 0x91, 0x94 }, - .lineno_active = .{ 0x83, 0x99, 0x9c }, - .scroll_track = .{ 0x3a, 0x4c, 0x50 }, - .scroll_thumb = .{ 0x6e, 0x9b, 0x8b }, - .border = .{ 0x6e, 0x9b, 0x8c }, - .sel_bg = .{ 0x32, 0x5f, 0x6c }, - .sel_fg = .{ 0xe6, 0xf2, 0xf3 }, - .search_bg = .{ 0x69, 0x58, 0x1e }, - .search_fg = .{ 0xff, 0xf0, 0xb9 }, - .diagnostic_error = .{ 0xff, 0x9d, 0xa1 }, - .diagnostic_warning = .{ 0xff, 0xcb, 0x6b }, - .diagnostic_info = .{ 0x7d, 0xca, 0xff }, - .diagnostic_hint = .{ 0x7c, 0xea, 0xd4 }, - .palette = .{ + .line_number = .{ 0x7b, 0x91, 0x94 }, + .line_number_current = .{ 0x83, 0x99, 0x9c }, + .rail = .{ 0x3a, 0x4c, 0x50 }, + .rail_thumb = .{ 0x6e, 0x9b, 0x8b }, + .rule = .{ 0x6e, 0x9b, 0x8c }, + .selection = .{ 0x32, 0x5f, 0x6c }, + .selection_text = .{ 0xe6, 0xf2, 0xf3 }, + .hit = .{ 0x69, 0x58, 0x1e }, + .@"error" = .{ 0xff, 0x9d, 0xa1 }, + .warning = .{ 0xff, 0xcb, 0x6b }, + .info = .{ 0x7d, 0xca, 0xff }, + .hint = .{ 0x7c, 0xea, 0xd4 }, + .ansi = .{ .{ 0x34, 0x46, 0x4c }, .{ 0xff, 0x9d, 0xa1 }, .{ 0xc3, 0xe8, 0x8d }, diff --git a/core/themes/lapis.zig b/core/themes/lapis.zig index 95fc86bd..a4996d59 100644 --- a/core/themes/lapis.zig +++ b/core/themes/lapis.zig @@ -5,48 +5,44 @@ pub const theme = .{ .name = "lapis", // --lapis-deep, --vellum - .bg = .{ 0x0a, 0x10, 0x30 }, - .fg = .{ 0xee, 0xe6, 0xd2 }, + .page = .{ 0x0a, 0x10, 0x30 }, + .text = .{ 0xee, 0xe6, 0xd2 }, // A gold highlight in lapis ink, as the directory's current entry. - .sel_bg = .{ 0xe8, 0xc4, 0x6a }, - .sel_fg = .{ 0x0f, 0x1a, 0x4a }, + .selection = .{ 0xe8, 0xc4, 0x6a }, + .selection_text = .{ 0x0f, 0x1a, 0x4a }, // --lapis, --vellum-dim - .tag_bg = .{ 0x0f, 0x1a, 0x4a }, - .tag_fg = .{ 0x9a, 0xa6, 0xd9 }, - .tag_name_fg = .{ 0xe8, 0xc4, 0x6a }, - .tag_active_name_fg = .{ 0xf2, 0xd2, 0x80 }, + .tag = .{ 0x0f, 0x1a, 0x4a }, + .tag_text = .{ 0x9a, 0xa6, 0xd9 }, + .tag_name = .{ 0xe8, 0xc4, 0x6a }, // The plaques' hover lapis, taken a step further: 1.5:1 off the tag. - .tag_active_bg = .{ 0x25, 0x39, 0x7d }, - .tag_active_fg = .{ 0xee, 0xe6, 0xd2 }, - .box = .{ 0xe8, 0xc4, 0x6a }, - .box_dim = .{ 0x3a, 0x4a, 0x8a }, - .box_border = .{ 0x9a, 0xa6, 0xd9 }, - .box_dirty = .{ 0xff, 0x6a, 0x4a }, - .column_box = .{ 0xff, 0x6a, 0x4a }, - .column_box_dim = .{ 0x8a, 0x3a, 0x3a }, + .tag_focus = .{ 0x25, 0x39, 0x7d }, + .tag_focus_text = .{ 0xee, 0xe6, 0xd2 }, + .accent = .{ 0xe8, 0xc4, 0x6a }, + .grip_ring = .{ 0x9a, 0xa6, 0xd9 }, + .dirty = .{ 0xff, 0x6a, 0x4a }, + .column_grip = .{ 0xff, 0x6a, 0x4a }, // Rubrics: vermilion keywords, gilded strings, the code window's green // for numbers, vellum-dim comments. - .kw = .{ 0xff, 0x6a, 0x4a }, - .str = .{ 0xe8, 0xc4, 0x6a }, - .num = .{ 0xe7, 0xff, 0xe0 }, + .keyword = .{ 0xff, 0x6a, 0x4a }, + .string = .{ 0xe8, 0xc4, 0x6a }, + .number = .{ 0xe7, 0xff, 0xe0 }, .comment = .{ 0x9a, 0xa6, 0xd9 }, - .lineno = .{ 0x5a, 0x6a, 0xa8 }, - .lineno_active = .{ 0x6a, 0x7a, 0xb8 }, + .line_number = .{ 0x5a, 0x6a, 0xa8 }, + .line_number_current = .{ 0x6a, 0x7a, 0xb8 }, // --lapis-ink under a gold thumb (the page's scrollbar-color). - .scroll_track = .{ 0x05, 0x0a, 0x24 }, - .scroll_thumb = .{ 0xe8, 0xc4, 0x6a }, + .rail = .{ 0x05, 0x0a, 0x24 }, + .rail_thumb = .{ 0xe8, 0xc4, 0x6a }, // Gold rules, a vermilion hairline between a tag and its text. - .border = .{ 0xe8, 0xc4, 0x6a }, + .rule = .{ 0xe8, 0xc4, 0x6a }, // An empty column is the page, not a slab of gold leaf. - .empty_col = .{ 0x0a, 0x10, 0x30 }, + .empty_column = .{ 0x0a, 0x10, 0x30 }, .tag_rule = .{ 0xd4, 0x41, 0x2f }, - .search_bg = .{ 0x6a, 0x2a, 0x1c }, - .search_fg = .{ 0xff, 0xd0, 0xb0 }, - .diagnostic_error = .{ 0xff, 0x6a, 0x4a }, - .diagnostic_warning = .{ 0xe8, 0xc4, 0x6a }, - .diagnostic_info = .{ 0x9a, 0xc6, 0xff }, - .diagnostic_hint = .{ 0xa8, 0xe0, 0xc0 }, - .palette = .{ + .hit = .{ 0x6a, 0x2a, 0x1c }, + .@"error" = .{ 0xff, 0x6a, 0x4a }, + .warning = .{ 0xe8, 0xc4, 0x6a }, + .info = .{ 0x9a, 0xc6, 0xff }, + .hint = .{ 0xa8, 0xe0, 0xc0 }, + .ansi = .{ .{ 0x0a, 0x10, 0x30 }, .{ 0xff, 0x6a, 0x4a }, .{ 0xa8, 0xe0, 0xc0 }, diff --git a/core/themes/light.zig b/core/themes/light.zig new file mode 100644 index 00000000..681c000a --- /dev/null +++ b/core/themes/light.zig @@ -0,0 +1,30 @@ +//! pardes light: dark's daylight sibling (DESIGN.md part D). White paper, +//! the comments the darkest ink as dark's are the brightest, violet keywords +//! and grip, a lilac-grey tag, a pale violet selection. For dark's users at a +//! sunny desk, or a phone outdoors. +pub const theme = .{ + .name = "light", + .page = .{ 0xfb, 0xfb, 0xfd }, + .text = .{ 0x34, 0x32, 0x3f }, + .tag = .{ 0xe9, 0xe7, 0xf3 }, + .tag_text = .{ 0x4b, 0x48, 0x62 }, + .accent = .{ 0x6a, 0x3f, 0xd8 }, + .selection = .{ 0xdd, 0xd3, 0xfb }, + .selection_text = .{ 0x1c, 0x1a, 0x24 }, + .keyword = .{ 0x8b, 0x2a, 0xb8 }, + .string = .{ 0x2f, 0x6e, 0x1f }, + .number = .{ 0x8a, 0x57, 0x00 }, + .comment = .{ 0x0d, 0x0c, 0x12 }, + .line_number = .{ 0xa3, 0xa1, 0xb0 }, + .line_number_current = .{ 0x6e, 0x6b, 0x80 }, + .@"error" = .{ 0xc0, 0x23, 0x3a }, + .warning = .{ 0x9a, 0x5a, 0x00 }, + .info = .{ 0x24, 0x57, 0xc5 }, + .hint = .{ 0x0f, 0x76, 0x6e }, + .ansi = .{ + .{ 0xe9, 0xe7, 0xf3 }, .{ 0xc0, 0x23, 0x3a }, .{ 0x2f, 0x6e, 0x1f }, .{ 0x8a, 0x57, 0x00 }, + .{ 0x24, 0x57, 0xc5 }, .{ 0x8b, 0x2a, 0xb8 }, .{ 0x0f, 0x76, 0x6e }, .{ 0x55, 0x53, 0x6a }, + .{ 0x73, 0x71, 0x84 }, .{ 0xd2, 0x36, 0x4d }, .{ 0x35, 0x82, 0x21 }, .{ 0xa0, 0x67, 0x00 }, + .{ 0x39, 0x6c, 0xde }, .{ 0xa4, 0x3f, 0xd4 }, .{ 0x04, 0x81, 0x77 }, .{ 0x0d, 0x0c, 0x12 }, + }, +}; diff --git a/core/themes/mono.zig b/core/themes/mono.zig new file mode 100644 index 00000000..f0dd109a --- /dev/null +++ b/core/themes/mono.zig @@ -0,0 +1,31 @@ +//! pardes mono: acme at night (DESIGN.md part D). Syntax by lightness +//! alone: keywords the brightest, strings a warm off-white, numbers the +//! text's, comments a step down (5.6:1). Hue only where pardes says a state: +//! the selection, hits, severities, added and deleted. For acme and Plan 9 +//! users, anyone who finds syntax colour noise, and screen sharing. +pub const theme = .{ + .name = "mono", + .page = .{ 0x11, 0x11, 0x13 }, + .text = .{ 0xbf, 0xc0, 0xc6 }, + .tag = .{ 0x1e, 0x1f, 0x24 }, + .tag_text = .{ 0xa2, 0xa4, 0xad }, + .accent = .{ 0xe6, 0xe7, 0xec }, + .selection = .{ 0x3b, 0x3d, 0x47 }, + .selection_text = .{ 0xf2, 0xf2, 0xf5 }, + .keyword = .{ 0xf2, 0xf2, 0xf5 }, + .string = .{ 0xd4, 0xd0, 0xc4 }, + .number = .{ 0xbf, 0xc0, 0xc6 }, + .comment = .{ 0x8a, 0x8b, 0x94 }, + .line_number = .{ 0x55, 0x56, 0x5e }, + .line_number_current = .{ 0x80, 0x81, 0x8b }, + .@"error" = .{ 0xff, 0x7b, 0x72 }, + .warning = .{ 0xe3, 0xb3, 0x41 }, + .info = .{ 0x79, 0xc0, 0xff }, + .hint = .{ 0xa5, 0xd6, 0xa7 }, + .ansi = .{ + .{ 0x1e, 0x1f, 0x24 }, .{ 0xff, 0x7b, 0x72 }, .{ 0x7e, 0xe7, 0x87 }, .{ 0xe3, 0xb3, 0x41 }, + .{ 0x79, 0xc0, 0xff }, .{ 0xd2, 0xa8, 0xff }, .{ 0x76, 0xe3, 0xea }, .{ 0xbf, 0xc0, 0xc6 }, + .{ 0x7b, 0x7d, 0x86 }, .{ 0xff, 0xa1, 0x98 }, .{ 0xa5, 0xf0, 0xb0 }, .{ 0xf2, 0xcc, 0x60 }, + .{ 0xa5, 0xd6, 0xff }, .{ 0xe2, 0xc5, 0xff }, .{ 0xb3, 0xf0, 0xff }, .{ 0xf2, 0xf2, 0xf5 }, + }, +}; diff --git a/core/themes/monokai.zig b/core/themes/monokai.zig index 13e72336..db43b764 100644 --- a/core/themes/monokai.zig +++ b/core/themes/monokai.zig @@ -7,63 +7,64 @@ //! Adjusted to meet pardes's floors (chrome only; text, syntax and ANSI are untouched): //! - focused tag ground #49483e -> #59584f: 1.19:1 off the unfocused #3e3d32, pardes needs 1.5:1 on a dark page //! - rules between panes #3b3a32 -> #4a4941: 1.30:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #f92672 -> #ff809c: 1.89:1 on the focused tag, now 3.01:1 (R6: 3:1) +//! - search hit #ffe792 -> #5f3c0c: 12.10:1 off the page, now 1.51:1 (R8: 1.5:1, the text reading on it) +//! - error #f92672 -> #fe457d: 3.93:1 on the page, now 4.50:1 (R9: 4.5:1, told from the text and the others) +//! - hint #75715e -> #928e7a: 3.03:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "monokai", // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:13 background - .bg = .{ 0x27, 0x28, 0x22 }, + .page = .{ 0x27, 0x28, 0x22 }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:17 foreground - .fg = .{ 0xf8, 0xf8, 0xf2 }, + .text = .{ 0xf8, 0xf8, 0xf2 }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:23 selection - .sel_bg = .{ 0x49, 0x48, 0x3e }, + .selection = .{ 0x49, 0x48, 0x3e }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xf8, 0xf8, 0xf2 }, + .selection_text = .{ 0xf8, 0xf8, 0xf2 }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:21 lineHighlight — derived: no UI colours in a tmTheme; unfocused tag = lineHighlight - .tag_bg = .{ 0x3e, 0x3d, 0x32 }, + .tag = .{ 0x3e, 0x3d, 0x32 }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:17 foreground — derived: foreground - .tag_fg = .{ 0xf8, 0xf8, 0xf2 }, + .tag_text = .{ 0xf8, 0xf8, 0xf2 }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:23 selection — derived: focused tag = selection #49483e, adjusted - .tag_active_bg = .{ 0x59, 0x58, 0x4f }, + .tag_focus = .{ 0x59, 0x58, 0x4f }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:17 foreground — derived: foreground - .tag_active_fg = .{ 0xf8, 0xf8, 0xf2 }, + .tag_focus_text = .{ 0xf8, 0xf8, 0xf2 }, // the focused grip: ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:122 "Keyword" foreground — derived: Keyword pink - .box = .{ 0xf9, 0x26, 0x72 }, - // derived: the grip at rest, the accent #f92672 faded toward the unfocused tag #3e3d32 as far as 1.6:1 off it (0.54 of the way) - .box_dim = .{ 0xa3, 0x31, 0x55 }, + .accent = .{ 0xf9, 0x26, 0x72 }, // an unsaved grip: the original's modified colour, ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:66 "String" foreground — derived: diff.changed #E6DB74 - .box_dirty = .{ 0xe6, 0xdb, 0x74 }, + .dirty = .{ 0xe6, 0xdb, 0x74 }, // derived: the column grip, the original's type colour, ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:148 "Storage type" foreground - .column_box = .{ 0x66, 0xd9, 0xef }, + .column_grip = .{ 0x66, 0xd9, 0xef }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:122 "Keyword" foreground - .kw = .{ 0xf9, 0x26, 0x72 }, + .keyword = .{ 0xf9, 0x26, 0x72 }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:66 "String" foreground - .str = .{ 0xe6, 0xdb, 0x74 }, + .string = .{ 0xe6, 0xdb, 0x74 }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:77 "Number" foreground - .num = .{ 0xae, 0x81, 0xff }, + .number = .{ 0xae, 0x81, 0xff }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:55 "Comment" foreground .comment = .{ 0x75, 0x71, 0x5e }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:55 "Comment" foreground — derived: the tmTheme has no gutter colour; Comment - .lineno = .{ 0x75, 0x71, 0x5e }, + .line_number = .{ 0x75, 0x71, 0x5e }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:17 foreground — derived: foreground - .lineno_active = .{ 0xf8, 0xf8, 0xf2 }, + .line_number_current = .{ 0xf8, 0xf8, 0xf2 }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:13 background — derived: page - .scroll_track = .{ 0x27, 0x28, 0x22 }, + .rail = .{ 0x27, 0x28, 0x22 }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:23 selection — derived: selection - .scroll_thumb = .{ 0x49, 0x48, 0x3e }, + .rail_thumb = .{ 0x49, 0x48, 0x3e }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:19 invisibles — derived: invisibles #3b3a32, adjusted - .border = .{ 0x4a, 0x49, 0x41 }, + .rule = .{ 0x4a, 0x49, 0x41 }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:25 findHighlight - .search_bg = .{ 0xff, 0xe7, 0x92 }, - // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:27 findHighlightForeground - .search_fg = .{ 0x00, 0x00, 0x00 }, + .hit = .{ 0xff, 0xe7, 0x92 }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:122 "Keyword" foreground — derived: Invalid is drawn on #F92672, the Keyword colour - .diagnostic_error = .{ 0xf9, 0x26, 0x72 }, + .@"error" = .{ 0xf9, 0x26, 0x72 }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:200 "Function argument" foreground — derived: Function argument orange - .diagnostic_warning = .{ 0xfd, 0x97, 0x1f }, + .warning = .{ 0xfd, 0x97, 0x1f }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:148 "Storage type" foreground — derived: Storage type cyan - .diagnostic_info = .{ 0x66, 0xd9, 0xef }, + .info = .{ 0x66, 0xd9, 0xef }, // ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:55 "Comment" foreground — derived: Comment - .diagnostic_hint = .{ 0x75, 0x71, 0x5e }, - .palette = .{ + .hint = .{ 0x75, 0x71, 0x5e }, + .ansi = .{ .{ 0x27, 0x28, 0x22 }, // 0: ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:13 background — derived: ANSI 0: a tmTheme has no terminal colours; its own palette in ANSI order (black=page, red=Keyword, green=Function name, yellow=String, blue and cyan=Storage type, magenta=Number, white=foreground, bright black=Comment, brights repeat) .{ 0xf9, 0x26, 0x72 }, // 1: ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:122 "Keyword" foreground — derived: ANSI 1: a tmTheme has no terminal colours; its own palette in ANSI order (black=page, red=Keyword, green=Function name, yellow=String, blue and cyan=Storage type, magenta=Number, white=foreground, bright black=Comment, brights repeat) .{ 0xa6, 0xe2, 0x2e }, // 2: ~/05-genizah/sublime-text-2-color-schemes/Monokai.tmTheme:187 "Function name" foreground — derived: ANSI 2: a tmTheme has no terminal colours; its own palette in ANSI order (black=page, red=Keyword, green=Function name, yellow=String, blue and cyan=Storage type, magenta=Number, white=foreground, bright black=Comment, brights repeat) diff --git a/core/themes/monokai_pro.zig b/core/themes/monokai_pro.zig index 46a5d58b..34510e01 100644 --- a/core/themes/monokai_pro.zig +++ b/core/themes/monokai_pro.zig @@ -8,63 +8,63 @@ //! - focused tag ground #2d2a2e -> #4f4637: 1.00:1 off the unfocused #2d2a2e, pardes needs 1.5:1 on a dark page //! - rules between panes #221f22 -> #4e4b4d: 1.15:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) //! - scroll thumb #434044 -> #4a484b: 1.39:1 on its track #2d2a2e +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #2d2a2e -> #343135: 1.00:1 off the page, now 1.10:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - focused tag ground #4f4637 -> #4f4c50: 1.38:1 off the tag, now 1.52:1 (R4, H: a focus step off the tag, and the loudest) +//! - selection #434044 -> #464048: 1.39:1 off the page, now 1.41:1 (R7) pub const theme = .{ .name = "monokai_pro", // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."editor.background" - .bg = .{ 0x2d, 0x2a, 0x2e }, + .page = .{ 0x2d, 0x2a, 0x2e }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."editor.foreground" - .fg = .{ 0xfc, 0xfc, 0xfa }, + .text = .{ 0xfc, 0xfc, 0xfa }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."editor.selectionBackground" #c1c0c026 over #2d2a2e - .sel_bg = .{ 0x43, 0x40, 0x44 }, + .selection = .{ 0x43, 0x40, 0x44 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xfc, 0xfc, 0xfa }, + .selection_text = .{ 0xfc, 0xfc, 0xfa }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."tab.inactiveBackground" - .tag_bg = .{ 0x2d, 0x2a, 0x2e }, + .tag = .{ 0x2d, 0x2a, 0x2e }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."tab.inactiveForeground" - .tag_fg = .{ 0x93, 0x92, 0x93 }, + .tag_text = .{ 0x93, 0x92, 0x93 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."tab.activeBackground" #2d2a2e, adjusted - .tag_active_bg = .{ 0x4f, 0x46, 0x37 }, + .tag_focus = .{ 0x4f, 0x46, 0x37 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."tab.activeForeground" - .tag_active_fg = .{ 0xff, 0xd8, 0x66 }, + .tag_focus_text = .{ 0xff, 0xd8, 0x66 }, // the focused grip: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."tab.activeBorder" - .box = .{ 0xff, 0xd8, 0x66 }, - // derived: the grip at rest, the accent #ffd866 faded toward the unfocused tag #2d2a2e as far as 1.6:1 off it (0.20 of the way) - .box_dim = .{ 0x57, 0x4d, 0x39 }, + .accent = .{ 0xff, 0xd8, 0x66 }, // an unsaved grip: the original's modified colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."editorGutter.modifiedBackground" - .box_dirty = .{ 0xfc, 0x98, 0x67 }, + .dirty = .{ 0xfc, 0x98, 0x67 }, // derived: the column grip, the original's type colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 tokenColors[42] "entity.name.type" - .column_box = .{ 0x78, 0xdc, 0xe8 }, + .column_grip = .{ 0x78, 0xdc, 0xe8 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 tokenColors[57] "keyword" - .kw = .{ 0xff, 0x61, 0x88 }, + .keyword = .{ 0xff, 0x61, 0x88 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 tokenColors[132] "string" - .str = .{ 0xff, 0xd8, 0x66 }, + .string = .{ 0xff, 0xd8, 0x66 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 tokenColors[22] "constant.numeric" - .num = .{ 0xab, 0x9d, 0xf2 }, + .number = .{ 0xab, 0x9d, 0xf2 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 tokenColors[0] "comment" .comment = .{ 0x72, 0x70, 0x72 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."editorLineNumber.foreground" - .lineno = .{ 0x5b, 0x59, 0x5c }, + .line_number = .{ 0x5b, 0x59, 0x5c }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."editorLineNumber.activeForeground" - .lineno_active = .{ 0xc1, 0xc0, 0xc0 }, + .line_number_current = .{ 0xc1, 0xc0, 0xc0 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 no scrollbar.background: the editor shows through - .scroll_track = .{ 0x2d, 0x2a, 0x2e }, + .rail = .{ 0x2d, 0x2a, 0x2e }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."scrollbarSlider.background" #c1c0c026 over #2d2a2e #434044, adjusted - .scroll_thumb = .{ 0x4a, 0x48, 0x4b }, + .rail_thumb = .{ 0x4a, 0x48, 0x4b }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."editorGroup.border" #221f22, adjusted - .border = .{ 0x4e, 0x4b, 0x4d }, + .rule = .{ 0x4e, 0x4b, 0x4d }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."editor.findMatchBackground" #fcfcfa26 over #2d2a2e - .search_bg = .{ 0x4c, 0x49, 0x4c }, - // derived: the original keeps text colours over a match; the page's text, whichever reads better on it - .search_fg = .{ 0xfc, 0xfc, 0xfa }, + .hit = .{ 0x4c, 0x49, 0x4c }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."editorError.foreground" - .diagnostic_error = .{ 0xff, 0x61, 0x88 }, + .@"error" = .{ 0xff, 0x61, 0x88 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."editorWarning.foreground" - .diagnostic_warning = .{ 0xfc, 0x98, 0x67 }, + .warning = .{ 0xfc, 0x98, 0x67 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."editorInfo.foreground" - .diagnostic_info = .{ 0x78, 0xdc, 0xe8 }, + .info = .{ 0x78, 0xdc, 0xe8 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."editorHint.foreground" - .diagnostic_hint = .{ 0xab, 0x9d, 0xf2 }, - .palette = .{ + .hint = .{ 0xab, 0x9d, 0xf2 }, + .ansi = .{ .{ 0x40, 0x3e, 0x41 }, // 0: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."terminal.ansiBlack" .{ 0xff, 0x61, 0x88 }, // 1: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."terminal.ansiRed" .{ 0xa9, 0xdc, 0x76 }, // 2: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro.json:1 colors."terminal.ansiGreen" diff --git a/core/themes/monokai_pro_classic.zig b/core/themes/monokai_pro_classic.zig index 69f26327..ed1f8092 100644 --- a/core/themes/monokai_pro_classic.zig +++ b/core/themes/monokai_pro_classic.zig @@ -8,63 +8,63 @@ //! - focused tag ground #272822 -> #46452f: 1.00:1 off the unfocused #272822, pardes needs 1.5:1 on a dark page //! - rules between panes #1d1e19 -> #4a4b44: 1.13:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) //! - scroll thumb #3e3f38 -> #46473f: 1.40:1 on its track #272822 +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #272822 -> #2e2f29: 1.00:1 off the page, now 1.10:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - focused tag ground #46452f -> #494a43: 1.38:1 off the tag, now 1.51:1 (R4, H: a focus step off the tag, and the loudest) +//! - error #f92672 -> #fe457d: 3.93:1 on the page, now 4.50:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "monokai_pro_classic", // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."editor.background" - .bg = .{ 0x27, 0x28, 0x22 }, + .page = .{ 0x27, 0x28, 0x22 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."editor.foreground" - .fg = .{ 0xfd, 0xff, 0xf1 }, + .text = .{ 0xfd, 0xff, 0xf1 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."editor.selectionBackground" #c0c1b526 over #272822 - .sel_bg = .{ 0x3e, 0x3f, 0x38 }, + .selection = .{ 0x3e, 0x3f, 0x38 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xfd, 0xff, 0xf1 }, + .selection_text = .{ 0xfd, 0xff, 0xf1 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."tab.inactiveBackground" - .tag_bg = .{ 0x27, 0x28, 0x22 }, + .tag = .{ 0x27, 0x28, 0x22 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."tab.inactiveForeground" - .tag_fg = .{ 0x91, 0x92, 0x88 }, + .tag_text = .{ 0x91, 0x92, 0x88 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."tab.activeBackground" #272822, adjusted - .tag_active_bg = .{ 0x46, 0x45, 0x2f }, + .tag_focus = .{ 0x46, 0x45, 0x2f }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."tab.activeForeground" - .tag_active_fg = .{ 0xe6, 0xdb, 0x74 }, + .tag_focus_text = .{ 0xe6, 0xdb, 0x74 }, // the focused grip: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."tab.activeBorder" - .box = .{ 0xe6, 0xdb, 0x74 }, - // derived: the grip at rest, the accent #e6db74 faded toward the unfocused tag #272822 as far as 1.6:1 off it (0.20 of the way) - .box_dim = .{ 0x4d, 0x4c, 0x32 }, + .accent = .{ 0xe6, 0xdb, 0x74 }, // an unsaved grip: the original's modified colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."editorGutter.modifiedBackground" - .box_dirty = .{ 0xfd, 0x97, 0x1f }, + .dirty = .{ 0xfd, 0x97, 0x1f }, // derived: the column grip, the original's type colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 tokenColors[42] "entity.name.type" - .column_box = .{ 0x66, 0xd9, 0xef }, + .column_grip = .{ 0x66, 0xd9, 0xef }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 tokenColors[57] "keyword" - .kw = .{ 0xf9, 0x26, 0x72 }, + .keyword = .{ 0xf9, 0x26, 0x72 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 tokenColors[132] "string" - .str = .{ 0xe6, 0xdb, 0x74 }, + .string = .{ 0xe6, 0xdb, 0x74 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 tokenColors[22] "constant.numeric" - .num = .{ 0xae, 0x81, 0xff }, + .number = .{ 0xae, 0x81, 0xff }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 tokenColors[0] "comment" .comment = .{ 0x6e, 0x70, 0x66 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."editorLineNumber.foreground" - .lineno = .{ 0x57, 0x58, 0x4f }, + .line_number = .{ 0x57, 0x58, 0x4f }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."editorLineNumber.activeForeground" - .lineno_active = .{ 0xc0, 0xc1, 0xb5 }, + .line_number_current = .{ 0xc0, 0xc1, 0xb5 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 no scrollbar.background: the editor shows through - .scroll_track = .{ 0x27, 0x28, 0x22 }, + .rail = .{ 0x27, 0x28, 0x22 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."scrollbarSlider.background" #c0c1b526 over #272822 #3e3f38, adjusted - .scroll_thumb = .{ 0x46, 0x47, 0x3f }, + .rail_thumb = .{ 0x46, 0x47, 0x3f }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."editorGroup.border" #1d1e19, adjusted - .border = .{ 0x4a, 0x4b, 0x44 }, + .rule = .{ 0x4a, 0x4b, 0x44 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."editor.findMatchBackground" #fdfff126 over #272822 - .search_bg = .{ 0x47, 0x48, 0x41 }, - // derived: the original keeps text colours over a match; the page's text, whichever reads better on it - .search_fg = .{ 0xfd, 0xff, 0xf1 }, + .hit = .{ 0x47, 0x48, 0x41 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."editorError.foreground" - .diagnostic_error = .{ 0xf9, 0x26, 0x72 }, + .@"error" = .{ 0xf9, 0x26, 0x72 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."editorWarning.foreground" - .diagnostic_warning = .{ 0xfd, 0x97, 0x1f }, + .warning = .{ 0xfd, 0x97, 0x1f }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."editorInfo.foreground" - .diagnostic_info = .{ 0x66, 0xd9, 0xef }, + .info = .{ 0x66, 0xd9, 0xef }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."editorHint.foreground" - .diagnostic_hint = .{ 0xae, 0x81, 0xff }, - .palette = .{ + .hint = .{ 0xae, 0x81, 0xff }, + .ansi = .{ .{ 0x3b, 0x3c, 0x35 }, // 0: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."terminal.ansiBlack" .{ 0xf9, 0x26, 0x72 }, // 1: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."terminal.ansiRed" .{ 0xa6, 0xe2, 0x2e }, // 2: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Classic.json:1 colors."terminal.ansiGreen" diff --git a/core/themes/monokai_pro_light.zig b/core/themes/monokai_pro_light.zig index ef638731..2e75d5c2 100644 --- a/core/themes/monokai_pro_light.zig +++ b/core/themes/monokai_pro_light.zig @@ -10,63 +10,69 @@ //! - focused tag text #e14775 -> #a73557: 2.80:1 on #f5d1d9, tag text needs 4.5:1 //! - rules between panes #ede7e5 -> #c6c0c0: 1.12:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) //! - scroll thumb #e5e0de -> #cec9c8: 1.20:1 on its track #faf4f2 +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #faf4f2 -> #efe9e7: 1.00:1 off the page, now 1.10:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - focused tag ground #f5d1d9 -> #d7d1cf: 1.16:1 off the tag, now 1.26:1 (R4, H: a focus step off the tag, and the loudest) +//! - focused grip #e14775 -> #d43a6a: 2.60:1 on the focused tag, now 3.02:1 (R6: 3:1) +//! - unsaved grip #e16032 -> #cc4c1b: 2.95:1 on the tag, now 3.79:1 (R6: 3:1 on both tags) +//! - selection #e5e0de -> #e5dad6: 1.20:1 off the page, now 1.26:1 (R7) +//! - search hit #dbd5d4 -> #febaa3: 1.33:1 off the page, now 1.51:1 (R8: 1.5:1, the text reading on it) +//! - error #e14775 -> #cd3365: 3.60:1 on the page, now 4.53:1 (R9: 4.5:1, told from the text and the others) +//! - warning #e16032 -> #c54611: 3.26:1 on the page, now 4.53:1 (R9: 4.5:1, told from the text and the others) +//! - info #1c8ca8 -> #077b95: 3.59:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "monokai_pro_light", // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."editor.background" - .bg = .{ 0xfa, 0xf4, 0xf2 }, + .page = .{ 0xfa, 0xf4, 0xf2 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."editor.foreground" - .fg = .{ 0x29, 0x24, 0x2a }, + .text = .{ 0x29, 0x24, 0x2a }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."editor.selectionBackground" #706b6e26 over #faf4f2 - .sel_bg = .{ 0xe5, 0xe0, 0xde }, + .selection = .{ 0xe5, 0xe0, 0xde }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x29, 0x24, 0x2a }, + .selection_text = .{ 0x29, 0x24, 0x2a }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."tab.inactiveBackground" - .tag_bg = .{ 0xfa, 0xf4, 0xf2 }, + .tag = .{ 0xfa, 0xf4, 0xf2 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."tab.inactiveForeground" #918c8e, adjusted - .tag_fg = .{ 0x71, 0x6d, 0x6f }, + .tag_text = .{ 0x71, 0x6d, 0x6f }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."tab.activeBackground" #faf4f2, adjusted - .tag_active_bg = .{ 0xf5, 0xd1, 0xd9 }, + .tag_focus = .{ 0xf5, 0xd1, 0xd9 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."tab.activeForeground" #e14775, adjusted - .tag_active_fg = .{ 0xa7, 0x35, 0x57 }, + .tag_focus_text = .{ 0xa7, 0x35, 0x57 }, // the focused grip: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."tab.activeBorder" - .box = .{ 0xe1, 0x47, 0x75 }, - // derived: the grip at rest, the accent #e14775 faded toward the unfocused tag #faf4f2 as far as 1.6:1 off it (0.38 of the way) - .box_dim = .{ 0xf1, 0xb2, 0xc3 }, + .accent = .{ 0xe1, 0x47, 0x75 }, // an unsaved grip: the original's modified colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."editorGutter.modifiedBackground" - .box_dirty = .{ 0xe1, 0x60, 0x32 }, + .dirty = .{ 0xe1, 0x60, 0x32 }, // derived: the column grip, the original's type colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 tokenColors[42] "entity.name.type" - .column_box = .{ 0x1c, 0x8c, 0xa8 }, + .column_grip = .{ 0x1c, 0x8c, 0xa8 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 tokenColors[57] "keyword" - .kw = .{ 0xe1, 0x47, 0x75 }, + .keyword = .{ 0xe1, 0x47, 0x75 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 tokenColors[132] "string" - .str = .{ 0xcc, 0x7a, 0x0a }, + .string = .{ 0xcc, 0x7a, 0x0a }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 tokenColors[22] "constant.numeric" - .num = .{ 0x70, 0x58, 0xbe }, + .number = .{ 0x70, 0x58, 0xbe }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 tokenColors[0] "comment" .comment = .{ 0xa5, 0x9f, 0xa0 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."editorLineNumber.foreground" - .lineno = .{ 0xbf, 0xb9, 0xba }, + .line_number = .{ 0xbf, 0xb9, 0xba }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."editorLineNumber.activeForeground" - .lineno_active = .{ 0x70, 0x6b, 0x6e }, + .line_number_current = .{ 0x70, 0x6b, 0x6e }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 no scrollbar.background: the editor shows through - .scroll_track = .{ 0xfa, 0xf4, 0xf2 }, + .rail = .{ 0xfa, 0xf4, 0xf2 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."scrollbarSlider.background" #706b6e26 over #faf4f2 #e5e0de, adjusted - .scroll_thumb = .{ 0xce, 0xc9, 0xc8 }, + .rail_thumb = .{ 0xce, 0xc9, 0xc8 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."editorGroup.border" #ede7e5, adjusted - .border = .{ 0xc6, 0xc0, 0xc0 }, + .rule = .{ 0xc6, 0xc0, 0xc0 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."editor.findMatchBackground" #29242a26 over #faf4f2 - .search_bg = .{ 0xdb, 0xd5, 0xd4 }, - // derived: the original keeps text colours over a match; the page's text, whichever reads better on it - .search_fg = .{ 0x29, 0x24, 0x2a }, + .hit = .{ 0xdb, 0xd5, 0xd4 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."editorError.foreground" - .diagnostic_error = .{ 0xe1, 0x47, 0x75 }, + .@"error" = .{ 0xe1, 0x47, 0x75 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."editorWarning.foreground" - .diagnostic_warning = .{ 0xe1, 0x60, 0x32 }, + .warning = .{ 0xe1, 0x60, 0x32 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."editorInfo.foreground" - .diagnostic_info = .{ 0x1c, 0x8c, 0xa8 }, + .info = .{ 0x1c, 0x8c, 0xa8 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."editorHint.foreground" - .diagnostic_hint = .{ 0x70, 0x58, 0xbe }, - .palette = .{ + .hint = .{ 0x70, 0x58, 0xbe }, + .ansi = .{ .{ 0xd3, 0xcd, 0xcc }, // 0: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."terminal.ansiBlack" .{ 0xe1, 0x47, 0x75 }, // 1: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."terminal.ansiRed" .{ 0x26, 0x9d, 0x69 }, // 2: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light.json:1 colors."terminal.ansiGreen" diff --git a/core/themes/monokai_pro_light_sun.zig b/core/themes/monokai_pro_light_sun.zig index 2d023deb..f74ee446 100644 --- a/core/themes/monokai_pro_light_sun.zig +++ b/core/themes/monokai_pro_light_sun.zig @@ -10,63 +10,69 @@ //! - focused tag text #ce4770 -> #9d3655: 3.01:1 on #f0cdcf, tag text needs 4.5:1 //! - rules between panes #eee5de -> #c7bebb: 1.09:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) //! - scroll thumb #e4dbd5 -> #cac1be: 1.20:1 on its track #f8efe7 +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #f8efe7 -> #ede4dc: 1.00:1 off the page, now 1.11:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - focused tag ground #f0cdcf -> #d5ccc4: 1.17:1 off the tag, now 1.26:1 (R4, H: a focus step off the tag, and the loudest) +//! - focused grip #ce4770 -> #c7416b: 2.79:1 on the focused tag, now 3.02:1 (R6: 3:1) +//! - unsaved grip #d4572b -> #c64a1b: 3.22:1 on the tag, now 3.81:1 (R6: 3:1 on both tags) +//! - selection #e4dbd5 -> #e7d5c7: 1.20:1 off the page, now 1.25:1 (R7) +//! - search hit #dad1cb -> #feb599: 1.32:1 off the page, now 1.51:1 (R8: 1.5:1, the text reading on it) +//! - error #ce4770 -> #c13b65: 3.89:1 on the page, now 4.53:1 (R9: 4.5:1, told from the text and the others) +//! - warning #d4572b -> #c04414: 3.56:1 on the page, now 4.53:1 (R9: 4.5:1, told from the text and the others) +//! - info #2473b6 -> #2271b4: 4.40:1 on the page, now 4.52:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "monokai_pro_light_sun", // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."editor.background" - .bg = .{ 0xf8, 0xef, 0xe7 }, + .page = .{ 0xf8, 0xef, 0xe7 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."editor.foreground" - .fg = .{ 0x2c, 0x23, 0x2e }, + .text = .{ 0x2c, 0x23, 0x2e }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."editor.selectionBackground" #72696d26 over #f8efe7 - .sel_bg = .{ 0xe4, 0xdb, 0xd5 }, + .selection = .{ 0xe4, 0xdb, 0xd5 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x2c, 0x23, 0x2e }, + .selection_text = .{ 0x2c, 0x23, 0x2e }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."tab.inactiveBackground" - .tag_bg = .{ 0xf8, 0xef, 0xe7 }, + .tag = .{ 0xf8, 0xef, 0xe7 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."tab.inactiveForeground" #92898a, adjusted - .tag_fg = .{ 0x72, 0x6b, 0x6c }, + .tag_text = .{ 0x72, 0x6b, 0x6c }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."tab.activeBackground" #f8efe7, adjusted - .tag_active_bg = .{ 0xf0, 0xcd, 0xcf }, + .tag_focus = .{ 0xf0, 0xcd, 0xcf }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."tab.activeForeground" #ce4770, adjusted - .tag_active_fg = .{ 0x9d, 0x36, 0x55 }, + .tag_focus_text = .{ 0x9d, 0x36, 0x55 }, // the focused grip: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."tab.activeBorder" - .box = .{ 0xce, 0x47, 0x70 }, - // derived: the grip at rest, the accent #ce4770 faded toward the unfocused tag #f8efe7 as far as 1.6:1 off it (0.38 of the way) - .box_dim = .{ 0xe8, 0xaf, 0xba }, + .accent = .{ 0xce, 0x47, 0x70 }, // an unsaved grip: the original's modified colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."editorGutter.modifiedBackground" - .box_dirty = .{ 0xd4, 0x57, 0x2b }, + .dirty = .{ 0xd4, 0x57, 0x2b }, // derived: the column grip, the original's type colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 tokenColors[42] "entity.name.type" - .column_box = .{ 0x24, 0x73, 0xb6 }, + .column_grip = .{ 0x24, 0x73, 0xb6 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 tokenColors[57] "keyword" - .kw = .{ 0xce, 0x47, 0x70 }, + .keyword = .{ 0xce, 0x47, 0x70 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 tokenColors[132] "string" - .str = .{ 0xb1, 0x68, 0x03 }, + .string = .{ 0xb1, 0x68, 0x03 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 tokenColors[22] "constant.numeric" - .num = .{ 0x68, 0x51, 0xa2 }, + .number = .{ 0x68, 0x51, 0xa2 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 tokenColors[0] "comment" .comment = .{ 0xa5, 0x9c, 0x9c }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."editorLineNumber.foreground" - .lineno = .{ 0xbe, 0xb5, 0xb3 }, + .line_number = .{ 0xbe, 0xb5, 0xb3 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."editorLineNumber.activeForeground" - .lineno_active = .{ 0x72, 0x69, 0x6d }, + .line_number_current = .{ 0x72, 0x69, 0x6d }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 no scrollbar.background: the editor shows through - .scroll_track = .{ 0xf8, 0xef, 0xe7 }, + .rail = .{ 0xf8, 0xef, 0xe7 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."scrollbarSlider.background" #72696d26 over #f8efe7 #e4dbd5, adjusted - .scroll_thumb = .{ 0xca, 0xc1, 0xbe }, + .rail_thumb = .{ 0xca, 0xc1, 0xbe }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."editorGroup.border" #eee5de, adjusted - .border = .{ 0xc7, 0xbe, 0xbb }, + .rule = .{ 0xc7, 0xbe, 0xbb }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."editor.findMatchBackground" #2c232e26 over #f8efe7 - .search_bg = .{ 0xda, 0xd1, 0xcb }, - // derived: the original keeps text colours over a match; the page's text, whichever reads better on it - .search_fg = .{ 0x2c, 0x23, 0x2e }, + .hit = .{ 0xda, 0xd1, 0xcb }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."editorError.foreground" - .diagnostic_error = .{ 0xce, 0x47, 0x70 }, + .@"error" = .{ 0xce, 0x47, 0x70 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."editorWarning.foreground" - .diagnostic_warning = .{ 0xd4, 0x57, 0x2b }, + .warning = .{ 0xd4, 0x57, 0x2b }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."editorInfo.foreground" - .diagnostic_info = .{ 0x24, 0x73, 0xb6 }, + .info = .{ 0x24, 0x73, 0xb6 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."editorHint.foreground" - .diagnostic_hint = .{ 0x68, 0x51, 0xa2 }, - .palette = .{ + .hint = .{ 0x68, 0x51, 0xa2 }, + .ansi = .{ .{ 0xd2, 0xc9, 0xc4 }, // 0: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."terminal.ansiBlack" .{ 0xce, 0x47, 0x70 }, // 1: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."terminal.ansiRed" .{ 0x21, 0x88, 0x71 }, // 2: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro Light (Filter Sun).json:1 colors."terminal.ansiGreen" diff --git a/core/themes/monokai_pro_machine.zig b/core/themes/monokai_pro_machine.zig index 5e4c6885..60f3f26f 100644 --- a/core/themes/monokai_pro_machine.zig +++ b/core/themes/monokai_pro_machine.zig @@ -9,63 +9,63 @@ //! - unfocused tag text #8b9798 -> #8d999a: 4.42:1 on #273136, tag text needs 4.5:1 to be read and run //! - rules between panes #1d2528 -> #485152: 1.17:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) //! - scroll thumb #3d474b -> #444e52: 1.39:1 on its track #273136 +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #273136 -> #2e383d: 1.00:1 off the page, now 1.11:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - focused tag ground #4a4f40 -> #485358: 1.42:1 off the tag, now 1.52:1 (R4, H: a focus step off the tag, and the loudest) +//! - selection #3d474b -> #334952: 1.39:1 off the page, now 1.40:1 (R7) pub const theme = .{ .name = "monokai_pro_machine", // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."editor.background" - .bg = .{ 0x27, 0x31, 0x36 }, + .page = .{ 0x27, 0x31, 0x36 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."editor.foreground" - .fg = .{ 0xf2, 0xff, 0xfc }, + .text = .{ 0xf2, 0xff, 0xfc }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."editor.selectionBackground" #b8c4c326 over #273136 - .sel_bg = .{ 0x3d, 0x47, 0x4b }, + .selection = .{ 0x3d, 0x47, 0x4b }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xf2, 0xff, 0xfc }, + .selection_text = .{ 0xf2, 0xff, 0xfc }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."tab.inactiveBackground" - .tag_bg = .{ 0x27, 0x31, 0x36 }, + .tag = .{ 0x27, 0x31, 0x36 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."tab.inactiveForeground" #8b9798, adjusted - .tag_fg = .{ 0x8d, 0x99, 0x9a }, + .tag_text = .{ 0x8d, 0x99, 0x9a }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."tab.activeBackground" #273136, adjusted - .tag_active_bg = .{ 0x4a, 0x4f, 0x40 }, + .tag_focus = .{ 0x4a, 0x4f, 0x40 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."tab.activeForeground" - .tag_active_fg = .{ 0xff, 0xed, 0x72 }, + .tag_focus_text = .{ 0xff, 0xed, 0x72 }, // the focused grip: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."tab.activeBorder" - .box = .{ 0xff, 0xed, 0x72 }, - // derived: the grip at rest, the accent #ffed72 faded toward the unfocused tag #273136 as far as 1.6:1 off it (0.18 of the way) - .box_dim = .{ 0x4e, 0x53, 0x41 }, + .accent = .{ 0xff, 0xed, 0x72 }, // an unsaved grip: the original's modified colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."editorGutter.modifiedBackground" - .box_dirty = .{ 0xff, 0xb2, 0x70 }, + .dirty = .{ 0xff, 0xb2, 0x70 }, // derived: the column grip, the original's type colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 tokenColors[42] "entity.name.type" - .column_box = .{ 0x7c, 0xd5, 0xf1 }, + .column_grip = .{ 0x7c, 0xd5, 0xf1 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 tokenColors[57] "keyword" - .kw = .{ 0xff, 0x6d, 0x7e }, + .keyword = .{ 0xff, 0x6d, 0x7e }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 tokenColors[132] "string" - .str = .{ 0xff, 0xed, 0x72 }, + .string = .{ 0xff, 0xed, 0x72 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 tokenColors[22] "constant.numeric" - .num = .{ 0xba, 0xa0, 0xf8 }, + .number = .{ 0xba, 0xa0, 0xf8 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 tokenColors[0] "comment" .comment = .{ 0x6b, 0x76, 0x78 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."editorLineNumber.foreground" - .lineno = .{ 0x54, 0x5f, 0x62 }, + .line_number = .{ 0x54, 0x5f, 0x62 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."editorLineNumber.activeForeground" - .lineno_active = .{ 0xb8, 0xc4, 0xc3 }, + .line_number_current = .{ 0xb8, 0xc4, 0xc3 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 no scrollbar.background: the editor shows through - .scroll_track = .{ 0x27, 0x31, 0x36 }, + .rail = .{ 0x27, 0x31, 0x36 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."scrollbarSlider.background" #b8c4c326 over #273136 #3d474b, adjusted - .scroll_thumb = .{ 0x44, 0x4e, 0x52 }, + .rail_thumb = .{ 0x44, 0x4e, 0x52 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."editorGroup.border" #1d2528, adjusted - .border = .{ 0x48, 0x51, 0x52 }, + .rule = .{ 0x48, 0x51, 0x52 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."editor.findMatchBackground" #f2fffc26 over #273136 - .search_bg = .{ 0x45, 0x50, 0x54 }, - // derived: the original keeps text colours over a match; the page's text, whichever reads better on it - .search_fg = .{ 0xf2, 0xff, 0xfc }, + .hit = .{ 0x45, 0x50, 0x54 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."editorError.foreground" - .diagnostic_error = .{ 0xff, 0x6d, 0x7e }, + .@"error" = .{ 0xff, 0x6d, 0x7e }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."editorWarning.foreground" - .diagnostic_warning = .{ 0xff, 0xb2, 0x70 }, + .warning = .{ 0xff, 0xb2, 0x70 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."editorInfo.foreground" - .diagnostic_info = .{ 0x7c, 0xd5, 0xf1 }, + .info = .{ 0x7c, 0xd5, 0xf1 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."editorHint.foreground" - .diagnostic_hint = .{ 0xba, 0xa0, 0xf8 }, - .palette = .{ + .hint = .{ 0xba, 0xa0, 0xf8 }, + .ansi = .{ .{ 0x3a, 0x44, 0x49 }, // 0: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."terminal.ansiBlack" .{ 0xff, 0x6d, 0x7e }, // 1: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."terminal.ansiRed" .{ 0xa2, 0xe5, 0x7b }, // 2: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Machine).json:1 colors."terminal.ansiGreen" diff --git a/core/themes/monokai_pro_octagon.zig b/core/themes/monokai_pro_octagon.zig index 62bb8c15..5d9db83b 100644 --- a/core/themes/monokai_pro_octagon.zig +++ b/core/themes/monokai_pro_octagon.zig @@ -9,63 +9,63 @@ //! - unfocused tag text #888d94 -> #8d9298: 4.24:1 on #282a3a, tag text needs 4.5:1 to be read and run //! - rules between panes #1e1f2b -> #4b4d57: 1.15:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) //! - scroll thumb #3d3f4e -> #444655: 1.36:1 on its track #282a3a +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #282a3a -> #2e3141: 1.00:1 off the page, now 1.10:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - focused tag ground #4a4642 -> #494c5d: 1.38:1 off the tag, now 1.52:1 (R4, H: a focus step off the tag, and the loudest) +//! - selection #3d3f4e -> #3c4060: 1.36:1 off the page, now 1.41:1 (R7) pub const theme = .{ .name = "monokai_pro_octagon", // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."editor.background" - .bg = .{ 0x28, 0x2a, 0x3a }, + .page = .{ 0x28, 0x2a, 0x3a }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."editor.foreground" - .fg = .{ 0xea, 0xf2, 0xf1 }, + .text = .{ 0xea, 0xf2, 0xf1 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."editor.selectionBackground" #b2b9bd26 over #282a3a - .sel_bg = .{ 0x3d, 0x3f, 0x4e }, + .selection = .{ 0x3d, 0x3f, 0x4e }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xea, 0xf2, 0xf1 }, + .selection_text = .{ 0xea, 0xf2, 0xf1 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."tab.inactiveBackground" - .tag_bg = .{ 0x28, 0x2a, 0x3a }, + .tag = .{ 0x28, 0x2a, 0x3a }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."tab.inactiveForeground" #888d94, adjusted - .tag_fg = .{ 0x8d, 0x92, 0x98 }, + .tag_text = .{ 0x8d, 0x92, 0x98 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."tab.activeBackground" #282a3a, adjusted - .tag_active_bg = .{ 0x4a, 0x46, 0x42 }, + .tag_focus = .{ 0x4a, 0x46, 0x42 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."tab.activeForeground" - .tag_active_fg = .{ 0xff, 0xd7, 0x6d }, + .tag_focus_text = .{ 0xff, 0xd7, 0x6d }, // the focused grip: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."tab.activeBorder" - .box = .{ 0xff, 0xd7, 0x6d }, - // derived: the grip at rest, the accent #ffd76d faded toward the unfocused tag #282a3a as far as 1.6:1 off it (0.20 of the way) - .box_dim = .{ 0x53, 0x4d, 0x44 }, + .accent = .{ 0xff, 0xd7, 0x6d }, // an unsaved grip: the original's modified colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."editorGutter.modifiedBackground" - .box_dirty = .{ 0xff, 0x9b, 0x5e }, + .dirty = .{ 0xff, 0x9b, 0x5e }, // derived: the column grip, the original's type colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 tokenColors[42] "entity.name.type" - .column_box = .{ 0x9c, 0xd1, 0xbb }, + .column_grip = .{ 0x9c, 0xd1, 0xbb }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 tokenColors[57] "keyword" - .kw = .{ 0xff, 0x65, 0x7a }, + .keyword = .{ 0xff, 0x65, 0x7a }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 tokenColors[132] "string" - .str = .{ 0xff, 0xd7, 0x6d }, + .string = .{ 0xff, 0xd7, 0x6d }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 tokenColors[22] "constant.numeric" - .num = .{ 0xc3, 0x9a, 0xc9 }, + .number = .{ 0xc3, 0x9a, 0xc9 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 tokenColors[0] "comment" .comment = .{ 0x69, 0x6d, 0x77 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."editorLineNumber.foreground" - .lineno = .{ 0x53, 0x57, 0x63 }, + .line_number = .{ 0x53, 0x57, 0x63 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."editorLineNumber.activeForeground" - .lineno_active = .{ 0xb2, 0xb9, 0xbd }, + .line_number_current = .{ 0xb2, 0xb9, 0xbd }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 no scrollbar.background: the editor shows through - .scroll_track = .{ 0x28, 0x2a, 0x3a }, + .rail = .{ 0x28, 0x2a, 0x3a }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."scrollbarSlider.background" #b2b9bd26 over #282a3a #3d3f4e, adjusted - .scroll_thumb = .{ 0x44, 0x46, 0x55 }, + .rail_thumb = .{ 0x44, 0x46, 0x55 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."editorGroup.border" #1e1f2b, adjusted - .border = .{ 0x4b, 0x4d, 0x57 }, + .rule = .{ 0x4b, 0x4d, 0x57 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."editor.findMatchBackground" #eaf2f126 over #282a3a - .search_bg = .{ 0x45, 0x48, 0x55 }, - // derived: the original keeps text colours over a match; the page's text, whichever reads better on it - .search_fg = .{ 0xea, 0xf2, 0xf1 }, + .hit = .{ 0x45, 0x48, 0x55 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."editorError.foreground" - .diagnostic_error = .{ 0xff, 0x65, 0x7a }, + .@"error" = .{ 0xff, 0x65, 0x7a }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."editorWarning.foreground" - .diagnostic_warning = .{ 0xff, 0x9b, 0x5e }, + .warning = .{ 0xff, 0x9b, 0x5e }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."editorInfo.foreground" - .diagnostic_info = .{ 0x9c, 0xd1, 0xbb }, + .info = .{ 0x9c, 0xd1, 0xbb }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."editorHint.foreground" - .diagnostic_hint = .{ 0xc3, 0x9a, 0xc9 }, - .palette = .{ + .hint = .{ 0xc3, 0x9a, 0xc9 }, + .ansi = .{ .{ 0x3a, 0x3d, 0x4b }, // 0: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."terminal.ansiBlack" .{ 0xff, 0x65, 0x7a }, // 1: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."terminal.ansiRed" .{ 0xba, 0xd7, 0x61 }, // 2: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Octagon).json:1 colors."terminal.ansiGreen" diff --git a/core/themes/monokai_pro_ristretto.zig b/core/themes/monokai_pro_ristretto.zig index 88b1788c..3eaa11b3 100644 --- a/core/themes/monokai_pro_ristretto.zig +++ b/core/themes/monokai_pro_ristretto.zig @@ -9,63 +9,63 @@ //! - unfocused tag text #948a8b -> #968c8d: 4.48:1 on #2c2525, tag text needs 4.5:1 to be read and run //! - rules between panes #211c1c -> #4d4747: 1.12:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) //! - scroll thumb #433b3b -> #4b4242: 1.38:1 on its track #2c2525 +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #2c2525 -> #342d2d: 1.00:1 off the page, now 1.12:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - focused tag ground #514332 -> #504848: 1.41:1 off the tag, now 1.51:1 (R4, H: a focus step off the tag, and the loudest) +//! - selection #433b3b -> #4a3b3b: 1.38:1 off the page, now 1.42:1 (R7) pub const theme = .{ .name = "monokai_pro_ristretto", // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."editor.background" - .bg = .{ 0x2c, 0x25, 0x25 }, + .page = .{ 0x2c, 0x25, 0x25 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."editor.foreground" - .fg = .{ 0xff, 0xf1, 0xf3 }, + .text = .{ 0xff, 0xf1, 0xf3 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."editor.selectionBackground" #c3b7b826 over #2c2525 - .sel_bg = .{ 0x43, 0x3b, 0x3b }, + .selection = .{ 0x43, 0x3b, 0x3b }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xff, 0xf1, 0xf3 }, + .selection_text = .{ 0xff, 0xf1, 0xf3 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."tab.inactiveBackground" - .tag_bg = .{ 0x2c, 0x25, 0x25 }, + .tag = .{ 0x2c, 0x25, 0x25 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."tab.inactiveForeground" #948a8b, adjusted - .tag_fg = .{ 0x96, 0x8c, 0x8d }, + .tag_text = .{ 0x96, 0x8c, 0x8d }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."tab.activeBackground" #2c2525, adjusted - .tag_active_bg = .{ 0x51, 0x43, 0x32 }, + .tag_focus = .{ 0x51, 0x43, 0x32 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."tab.activeForeground" - .tag_active_fg = .{ 0xf9, 0xcc, 0x6c }, + .tag_focus_text = .{ 0xf9, 0xcc, 0x6c }, // the focused grip: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."tab.activeBorder" - .box = .{ 0xf9, 0xcc, 0x6c }, - // derived: the grip at rest, the accent #f9cc6c faded toward the unfocused tag #2c2525 as far as 1.6:1 off it (0.20 of the way) - .box_dim = .{ 0x55, 0x46, 0x33 }, + .accent = .{ 0xf9, 0xcc, 0x6c }, // an unsaved grip: the original's modified colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."editorGutter.modifiedBackground" - .box_dirty = .{ 0xf3, 0x8d, 0x70 }, + .dirty = .{ 0xf3, 0x8d, 0x70 }, // derived: the column grip, the original's type colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 tokenColors[42] "entity.name.type" - .column_box = .{ 0x85, 0xda, 0xcc }, + .column_grip = .{ 0x85, 0xda, 0xcc }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 tokenColors[57] "keyword" - .kw = .{ 0xfd, 0x68, 0x83 }, + .keyword = .{ 0xfd, 0x68, 0x83 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 tokenColors[132] "string" - .str = .{ 0xf9, 0xcc, 0x6c }, + .string = .{ 0xf9, 0xcc, 0x6c }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 tokenColors[22] "constant.numeric" - .num = .{ 0xa8, 0xa9, 0xeb }, + .number = .{ 0xa8, 0xa9, 0xeb }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 tokenColors[0] "comment" .comment = .{ 0x72, 0x69, 0x6a }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."editorLineNumber.foreground" - .lineno = .{ 0x5b, 0x53, 0x53 }, + .line_number = .{ 0x5b, 0x53, 0x53 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."editorLineNumber.activeForeground" - .lineno_active = .{ 0xc3, 0xb7, 0xb8 }, + .line_number_current = .{ 0xc3, 0xb7, 0xb8 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 no scrollbar.background: the editor shows through - .scroll_track = .{ 0x2c, 0x25, 0x25 }, + .rail = .{ 0x2c, 0x25, 0x25 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."scrollbarSlider.background" #c3b7b826 over #2c2525 #433b3b, adjusted - .scroll_thumb = .{ 0x4b, 0x42, 0x42 }, + .rail_thumb = .{ 0x4b, 0x42, 0x42 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."editorGroup.border" #211c1c, adjusted - .border = .{ 0x4d, 0x47, 0x47 }, + .rule = .{ 0x4d, 0x47, 0x47 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."editor.findMatchBackground" #fff1f326 over #2c2525 - .search_bg = .{ 0x4b, 0x43, 0x44 }, - // derived: the original keeps text colours over a match; the page's text, whichever reads better on it - .search_fg = .{ 0xff, 0xf1, 0xf3 }, + .hit = .{ 0x4b, 0x43, 0x44 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."editorError.foreground" - .diagnostic_error = .{ 0xfd, 0x68, 0x83 }, + .@"error" = .{ 0xfd, 0x68, 0x83 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."editorWarning.foreground" - .diagnostic_warning = .{ 0xf3, 0x8d, 0x70 }, + .warning = .{ 0xf3, 0x8d, 0x70 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."editorInfo.foreground" - .diagnostic_info = .{ 0x85, 0xda, 0xcc }, + .info = .{ 0x85, 0xda, 0xcc }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."editorHint.foreground" - .diagnostic_hint = .{ 0xa8, 0xa9, 0xeb }, - .palette = .{ + .hint = .{ 0xa8, 0xa9, 0xeb }, + .ansi = .{ .{ 0x40, 0x38, 0x38 }, // 0: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."terminal.ansiBlack" .{ 0xfd, 0x68, 0x83 }, // 1: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."terminal.ansiRed" .{ 0xad, 0xda, 0x78 }, // 2: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Ristretto).json:1 colors."terminal.ansiGreen" diff --git a/core/themes/monokai_pro_spectrum.zig b/core/themes/monokai_pro_spectrum.zig index 3abd67ee..da7f4f4a 100644 --- a/core/themes/monokai_pro_spectrum.zig +++ b/core/themes/monokai_pro_spectrum.zig @@ -8,63 +8,63 @@ //! - focused tag ground #222222 -> #45412d: 1.00:1 off the unfocused #222222, pardes needs 1.5:1 on a dark page //! - rules between panes #191919 -> #454447: 1.11:1 off the page, lifted toward the text to 1.6:1 (as colors.zig separatorOf does) //! - scroll thumb #39383a -> #413f42: 1.36:1 on its track #222222 +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #222222 -> #2a2a2a: 1.00:1 off the page, now 1.11:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - focused tag ground #45412d -> #464646: 1.40:1 off the tag, now 1.52:1 (R4, H: a focus step off the tag, and the loudest) +//! - selection #39383a -> #3b3a3c: 1.36:1 off the page, now 1.41:1 (R7) pub const theme = .{ .name = "monokai_pro_spectrum", // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."editor.background" - .bg = .{ 0x22, 0x22, 0x22 }, + .page = .{ 0x22, 0x22, 0x22 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."editor.foreground" - .fg = .{ 0xf7, 0xf1, 0xff }, + .text = .{ 0xf7, 0xf1, 0xff }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."editor.selectionBackground" #bab6c026 over #222222 - .sel_bg = .{ 0x39, 0x38, 0x3a }, + .selection = .{ 0x39, 0x38, 0x3a }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xf7, 0xf1, 0xff }, + .selection_text = .{ 0xf7, 0xf1, 0xff }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."tab.inactiveBackground" - .tag_bg = .{ 0x22, 0x22, 0x22 }, + .tag = .{ 0x22, 0x22, 0x22 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."tab.inactiveForeground" - .tag_fg = .{ 0x8b, 0x88, 0x8f }, + .tag_text = .{ 0x8b, 0x88, 0x8f }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."tab.activeBackground" #222222, adjusted - .tag_active_bg = .{ 0x45, 0x41, 0x2d }, + .tag_focus = .{ 0x45, 0x41, 0x2d }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."tab.activeForeground" - .tag_active_fg = .{ 0xfc, 0xe5, 0x66 }, + .tag_focus_text = .{ 0xfc, 0xe5, 0x66 }, // the focused grip: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."tab.activeBorder" - .box = .{ 0xfc, 0xe5, 0x66 }, - // derived: the grip at rest, the accent #fce566 faded toward the unfocused tag #222222 as far as 1.6:1 off it (0.18 of the way) - .box_dim = .{ 0x49, 0x45, 0x2e }, + .accent = .{ 0xfc, 0xe5, 0x66 }, // an unsaved grip: the original's modified colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."editorGutter.modifiedBackground" - .box_dirty = .{ 0xfd, 0x93, 0x53 }, + .dirty = .{ 0xfd, 0x93, 0x53 }, // derived: the column grip, the original's type colour, ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 tokenColors[42] "entity.name.type" - .column_box = .{ 0x5a, 0xd4, 0xe6 }, + .column_grip = .{ 0x5a, 0xd4, 0xe6 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 tokenColors[57] "keyword" - .kw = .{ 0xfc, 0x61, 0x8d }, + .keyword = .{ 0xfc, 0x61, 0x8d }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 tokenColors[132] "string" - .str = .{ 0xfc, 0xe5, 0x66 }, + .string = .{ 0xfc, 0xe5, 0x66 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 tokenColors[22] "constant.numeric" - .num = .{ 0x94, 0x8a, 0xe3 }, + .number = .{ 0x94, 0x8a, 0xe3 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 tokenColors[0] "comment" .comment = .{ 0x69, 0x67, 0x6c }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."editorLineNumber.foreground" - .lineno = .{ 0x52, 0x50, 0x53 }, + .line_number = .{ 0x52, 0x50, 0x53 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."editorLineNumber.activeForeground" - .lineno_active = .{ 0xba, 0xb6, 0xc0 }, + .line_number_current = .{ 0xba, 0xb6, 0xc0 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 no scrollbar.background: the editor shows through - .scroll_track = .{ 0x22, 0x22, 0x22 }, + .rail = .{ 0x22, 0x22, 0x22 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."scrollbarSlider.background" #bab6c026 over #222222 #39383a, adjusted - .scroll_thumb = .{ 0x41, 0x3f, 0x42 }, + .rail_thumb = .{ 0x41, 0x3f, 0x42 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."editorGroup.border" #191919, adjusted - .border = .{ 0x45, 0x44, 0x47 }, + .rule = .{ 0x45, 0x44, 0x47 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."editor.findMatchBackground" #f7f1ff26 over #222222 - .search_bg = .{ 0x42, 0x41, 0x43 }, - // derived: the original keeps text colours over a match; the page's text, whichever reads better on it - .search_fg = .{ 0xf7, 0xf1, 0xff }, + .hit = .{ 0x42, 0x41, 0x43 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."editorError.foreground" - .diagnostic_error = .{ 0xfc, 0x61, 0x8d }, + .@"error" = .{ 0xfc, 0x61, 0x8d }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."editorWarning.foreground" - .diagnostic_warning = .{ 0xfd, 0x93, 0x53 }, + .warning = .{ 0xfd, 0x93, 0x53 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."editorInfo.foreground" - .diagnostic_info = .{ 0x5a, 0xd4, 0xe6 }, + .info = .{ 0x5a, 0xd4, 0xe6 }, // ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."editorHint.foreground" - .diagnostic_hint = .{ 0x94, 0x8a, 0xe3 }, - .palette = .{ + .hint = .{ 0x94, 0x8a, 0xe3 }, + .ansi = .{ .{ 0x36, 0x35, 0x37 }, // 0: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."terminal.ansiBlack" .{ 0xfc, 0x61, 0x8d }, // 1: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."terminal.ansiRed" .{ 0x7b, 0xd8, 0x8f }, // 2: ~/05-genizah/monokai-pro-vscode/vsix/extension/themes/Monokai Pro (Filter Spectrum).json:1 colors."terminal.ansiGreen" diff --git a/core/themes/neobones_dark.zig b/core/themes/neobones_dark.zig index b0167da2..25aaf8b9 100644 --- a/core/themes/neobones_dark.zig +++ b/core/themes/neobones_dark.zig @@ -15,63 +15,61 @@ //! StatusLine, TabLineFill to StatusLineNC. Accent is the lualine normal-mode a //! bg, a muted neutral (the theme is contrast-based, not hue-accented). //! Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #4b616f -> #768e9d: 1.59:1 on the focused tag, now 3.01:1 (R6: 3:1) pub const theme = .{ .name = "neobones_dark", // ~/05-genizah/zenbones.nvim/colors/neobones.vim:33 Normal guibg - .bg = .{ 0x0f, 0x19, 0x1f }, + .page = .{ 0x0f, 0x19, 0x1f }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:33 Normal guifg - .fg = .{ 0xc6, 0xd5, 0xcf }, + .text = .{ 0xc6, 0xd5, 0xcf }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:209 Visual guibg - .sel_bg = .{ 0x3a, 0x3e, 0x3d }, + .selection = .{ 0x3a, 0x3e, 0x3d }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xc6, 0xd5, 0xcf }, + .selection_text = .{ 0xc6, 0xd5, 0xcf }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:196 StatusLineNC guibg - .tag_bg = .{ 0x18, 0x25, 0x2d }, + .tag = .{ 0x18, 0x25, 0x2d }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:196 StatusLineNC guifg - .tag_fg = .{ 0xd1, 0xe0, 0xda }, + .tag_text = .{ 0xd1, 0xe0, 0xda }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:193 StatusLine guibg #20303a, adjusted - .tag_active_bg = .{ 0x2e, 0x43, 0x50 }, + .tag_focus = .{ 0x2e, 0x43, 0x50 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:193 StatusLine guifg - .tag_active_fg = .{ 0xc6, 0xd5, 0xcf }, + .tag_focus_text = .{ 0xc6, 0xd5, 0xcf }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/neobones_dark_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0x4b, 0x61, 0x6f }, - // derived: the grip at rest, the accent #3b5362 faded toward the unfocused tag #18252d as far as 1.6:1 off it (0.74 of the way) - .box_dim = .{ 0x32, 0x47, 0x54 }, + .accent = .{ 0x4b, 0x61, 0x6f }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/neobones.vim:41 Changed guifg - .box_dirty = .{ 0x81, 0x90, 0xd4 }, + .dirty = .{ 0x81, 0x90, 0xd4 }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/neobones.vim:205 Type guifg - .column_box = .{ 0x6e, 0x99, 0xb2 }, + .column_grip = .{ 0x6e, 0x99, 0xb2 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:189 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0xc6, 0xd5, 0xcf }, + .keyword = .{ 0xc6, 0xd5, 0xcf }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:199 String guifg - .str = .{ 0x93, 0x9e, 0x99 }, + .string = .{ 0x93, 0x9e, 0x99 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:163 Number guifg - .num = .{ 0x93, 0x9e, 0x99 }, + .number = .{ 0x93, 0x9e, 0x99 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:47 Comment guifg .comment = .{ 0x53, 0x69, 0x77 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:149 LineNr guifg - .lineno = .{ 0x46, 0x62, 0x73 }, + .line_number = .{ 0x46, 0x62, 0x73 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:61 CursorLineNr guifg - .lineno_active = .{ 0xc6, 0xd5, 0xcf }, + .line_number_current = .{ 0xc6, 0xd5, 0xcf }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:166 PmenuSbar guibg - .scroll_track = .{ 0x40, 0x5a, 0x6b }, + .rail = .{ 0x40, 0x5a, 0x6b }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:168 PmenuThumb guibg - .scroll_thumb = .{ 0x60, 0x86, 0x9d }, + .rail_thumb = .{ 0x60, 0x86, 0x9d }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:216 WinSeparator guifg - .border = .{ 0x46, 0x62, 0x73 }, + .rule = .{ 0x46, 0x62, 0x73 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:171 Search guibg - .search_bg = .{ 0x62, 0x41, 0x5b }, - // ~/05-genizah/zenbones.nvim/colors/neobones.vim:171 Search guifg - .search_fg = .{ 0xc6, 0xd5, 0xcf }, + .hit = .{ 0x62, 0x41, 0x5b }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:112 Error guifg via DiagnosticError->Error (link :113) - .diagnostic_error = .{ 0xde, 0x6e, 0x7c }, + .@"error" = .{ 0xde, 0x6e, 0x7c }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:210 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :211) - .diagnostic_warning = .{ 0xb7, 0x7e, 0x64 }, + .warning = .{ 0xb7, 0x7e, 0x64 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:71 DiagnosticInfo guifg - .diagnostic_info = .{ 0x81, 0x90, 0xd4 }, + .info = .{ 0x81, 0x90, 0xd4 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:66 DiagnosticHint guifg - .diagnostic_hint = .{ 0xb2, 0x79, 0xa7 }, - .palette = .{ + .hint = .{ 0xb2, 0x79, 0xa7 }, + .ansi = .{ .{ 0x0f, 0x19, 0x1f }, // 0: ~/05-genizah/zenbones.nvim/colors/neobones.vim:17 g:terminal_color_0 .{ 0xde, 0x6e, 0x7c }, // 1: ~/05-genizah/zenbones.nvim/colors/neobones.vim:18 g:terminal_color_1 .{ 0x90, 0xff, 0x6b }, // 2: ~/05-genizah/zenbones.nvim/colors/neobones.vim:19 g:terminal_color_2 diff --git a/core/themes/neobones_light.zig b/core/themes/neobones_light.zig index b24fcef5..3a5997aa 100644 --- a/core/themes/neobones_light.zig +++ b/core/themes/neobones_light.zig @@ -15,63 +15,62 @@ //! StatusLine, TabLineFill to StatusLineNC. Accent is the lualine normal-mode a //! bg, a muted neutral (the theme is contrast-based, not hue-accented). //! Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #96a097 -> #646e65: 1.53:1 on the focused tag, now 3.00:1 (R6: 3:1) +//! - selection #ade48c -> #a5e484: 1.23:1 off the page, now 1.25:1 (R7) pub const theme = .{ .name = "neobones_light", // ~/05-genizah/zenbones.nvim/colors/neobones.vim:266 Normal guibg - .bg = .{ 0xe5, 0xed, 0xe6 }, + .page = .{ 0xe5, 0xed, 0xe6 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:266 Normal guifg - .fg = .{ 0x20, 0x2e, 0x18 }, + .text = .{ 0x20, 0x2e, 0x18 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:442 Visual guibg - .sel_bg = .{ 0xad, 0xe4, 0x8c }, + .selection = .{ 0xad, 0xe4, 0x8c }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x20, 0x2e, 0x18 }, + .selection_text = .{ 0x20, 0x2e, 0x18 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:429 StatusLineNC guibg - .tag_bg = .{ 0xd0, 0xde, 0xd2 }, + .tag = .{ 0xd0, 0xde, 0xd2 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:429 StatusLineNC guifg - .tag_fg = .{ 0x4b, 0x66, 0x3c }, + .tag_text = .{ 0x4b, 0x66, 0x3c }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:426 StatusLine guibg #c2cfc4, adjusted - .tag_active_bg = .{ 0xba, 0xc6, 0xbc }, + .tag_focus = .{ 0xba, 0xc6, 0xbc }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:426 StatusLine guifg - .tag_active_fg = .{ 0x20, 0x2e, 0x18 }, + .tag_focus_text = .{ 0x20, 0x2e, 0x18 }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/neobones_light_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0x96, 0xa0, 0x97 }, - // derived: the grip at rest, the accent #a3aea4 faded toward the unfocused tag #d0ded2 as far as 1.6:1 off it (0.98 of the way) - .box_dim = .{ 0xa4, 0xaf, 0xa5 }, + .accent = .{ 0x96, 0xa0, 0x97 }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/neobones.vim:274 Changed guifg - .box_dirty = .{ 0x28, 0x64, 0x86 }, + .dirty = .{ 0x28, 0x64, 0x86 }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/neobones.vim:438 Type guifg - .column_box = .{ 0x49, 0x5c, 0x4c }, + .column_grip = .{ 0x49, 0x5c, 0x4c }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:422 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0x20, 0x2e, 0x18 }, + .keyword = .{ 0x20, 0x2e, 0x18 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:432 String guifg - .str = .{ 0x47, 0x60, 0x38 }, + .string = .{ 0x47, 0x60, 0x38 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:396 Number guifg - .num = .{ 0x47, 0x60, 0x38 }, + .number = .{ 0x47, 0x60, 0x38 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:280 Comment guifg .comment = .{ 0x87, 0x8d, 0x88 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:382 LineNr guifg - .lineno = .{ 0x8f, 0x98, 0x90 }, + .line_number = .{ 0x8f, 0x98, 0x90 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:294 CursorLineNr guifg - .lineno_active = .{ 0x20, 0x2e, 0x18 }, + .line_number_current = .{ 0x20, 0x2e, 0x18 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:399 PmenuSbar guibg - .scroll_track = .{ 0x9b, 0xa6, 0x9d }, + .rail = .{ 0x9b, 0xa6, 0x9d }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:401 PmenuThumb guibg - .scroll_thumb = .{ 0xf4, 0xf7, 0xf5 }, + .rail_thumb = .{ 0xf4, 0xf7, 0xf5 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:449 WinSeparator guifg - .border = .{ 0x8f, 0x98, 0x90 }, + .rule = .{ 0x8f, 0x98, 0x90 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:404 Search guibg - .search_bg = .{ 0xdc, 0xb5, 0xd4 }, - // ~/05-genizah/zenbones.nvim/colors/neobones.vim:404 Search guifg - .search_fg = .{ 0x20, 0x2e, 0x18 }, + .hit = .{ 0xdc, 0xb5, 0xd4 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:345 Error guifg via DiagnosticError->Error (link :346) - .diagnostic_error = .{ 0xa8, 0x33, 0x4c }, + .@"error" = .{ 0xa8, 0x33, 0x4c }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:443 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :444) - .diagnostic_warning = .{ 0x94, 0x49, 0x27 }, + .warning = .{ 0x94, 0x49, 0x27 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:304 DiagnosticInfo guifg - .diagnostic_info = .{ 0x28, 0x64, 0x86 }, + .info = .{ 0x28, 0x64, 0x86 }, // ~/05-genizah/zenbones.nvim/colors/neobones.vim:299 DiagnosticHint guifg - .diagnostic_hint = .{ 0x88, 0x50, 0x7d }, - .palette = .{ + .hint = .{ 0x88, 0x50, 0x7d }, + .ansi = .{ .{ 0xe5, 0xed, 0xe6 }, // 0: ~/05-genizah/zenbones.nvim/colors/neobones.vim:250 g:terminal_color_0 .{ 0xa8, 0x33, 0x4c }, // 1: ~/05-genizah/zenbones.nvim/colors/neobones.vim:251 g:terminal_color_1 .{ 0x56, 0x7a, 0x30 }, // 2: ~/05-genizah/zenbones.nvim/colors/neobones.vim:252 g:terminal_color_2 diff --git a/core/themes/nord.zig b/core/themes/nord.zig index f74785b3..284b59e6 100644 --- a/core/themes/nord.zig +++ b/core/themes/nord.zig @@ -47,63 +47,63 @@ //! Constant fg is nord4 (plain text), so constant uses Boolean (nord9). //! scroll_track/thumb are the popup-menu scrollbar (PmenuSbar/PmenuThumb); vim //! has no window scrollbar. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - search hit #88c0d0 -> #634a34: 6.24:1 off the page, now 1.52:1 (R8: 1.5:1, the text reading on it) +//! - error #bf616a -> #e17f87: 3.05:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) +//! - hint #5e81ac -> #7a9ecb: 3.10:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "nord", // ~/05-genizah/nord-vim/colors/nord.vim:139 Normal guibg (s:nord0_gui = #2E3440 at :15) - .bg = .{ 0x2e, 0x34, 0x40 }, + .page = .{ 0x2e, 0x34, 0x40 }, // ~/05-genizah/nord-vim/colors/nord.vim:139 Normal guifg (s:nord4_gui = #D8DEE9 at :20) - .fg = .{ 0xd8, 0xde, 0xe9 }, + .text = .{ 0xd8, 0xde, 0xe9 }, // ~/05-genizah/nord-vim/colors/nord.vim:149 Visual guibg (s:nord2_gui = #434C5E at :17) - .sel_bg = .{ 0x43, 0x4c, 0x5e }, + .selection = .{ 0x43, 0x4c, 0x5e }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xd8, 0xde, 0xe9 }, + .selection_text = .{ 0xd8, 0xde, 0xe9 }, // ~/05-genizah/nord-vim/colors/nord.vim:223 StatusLineNC guibg (s:nord1_gui = #3B4252 at :16) [default g:nord_uniform_status_lines=0, :83] - .tag_bg = .{ 0x3b, 0x42, 0x52 }, + .tag = .{ 0x3b, 0x42, 0x52 }, // ~/05-genizah/nord-vim/colors/nord.vim:223 StatusLineNC guifg (s:nord4_gui = #D8DEE9 at :20) [default g:nord_uniform_status_lines=0, :83] - .tag_fg = .{ 0xd8, 0xde, 0xe9 }, + .tag_text = .{ 0xd8, 0xde, 0xe9 }, // ~/05-genizah/nord-vim/colors/nord.vim:222 StatusLine guibg (s:nord3_gui = #4C566A at :18) [default g:nord_uniform_status_lines=0, :83] #4c566a, adjusted - .tag_active_bg = .{ 0x52, 0x5d, 0x72 }, + .tag_focus = .{ 0x52, 0x5d, 0x72 }, // ~/05-genizah/nord-vim/colors/nord.vim:222 StatusLine guifg (s:nord8_gui = #88C0D0 at :24) [default g:nord_uniform_status_lines=0, :83] #88c0d0, adjusted - .tag_active_fg = .{ 0xbc, 0xdc, 0xe5 }, + .tag_focus_text = .{ 0xbc, 0xdc, 0xe5 }, // the focused grip: ~/05-genizah/nord-vim/autoload/lightline/colorscheme/nord.vim:24 s:p.normal.left section a bg s:nord8 (#88C0D0 at :15); same in ~/05-genizah/nord-vim/autoload/airline/themes/nord.vim:41 s:NMain bg s:nord8_gui - .box = .{ 0x88, 0xc0, 0xd0 }, - // derived: the grip at rest, the accent #88c0d0 faded toward the unfocused tag #3b4252 as far as 1.6:1 off it (0.26 of the way) - .box_dim = .{ 0x4f, 0x63, 0x73 }, + .accent = .{ 0x88, 0xc0, 0xd0 }, // an unsaved grip: the original's modified colour, ~/05-genizah/nord-vim/colors/nord.vim:589 GitGutterChange guifg (s:nord13_gui = #EBCB8B at :29); also DiffChange fg (inverse) at :371, SignifySignChange at :596, VS Code editorGutter.modifiedBackground #ebcb8b at ~/05-genizah/nord-visual-studio-code/themes/nord-color-theme.json:98 - .box_dirty = .{ 0xeb, 0xcb, 0x8b }, + .dirty = .{ 0xeb, 0xcb, 0x8b }, // derived: the column grip, the original's string colour, ~/05-genizah/nord-vim/colors/nord.vim:281 String guifg (s:nord14_gui = #A3BE8C at :30) - .column_box = .{ 0xa3, 0xbe, 0x8c }, + .column_grip = .{ 0xa3, 0xbe, 0x8c }, // ~/05-genizah/nord-vim/colors/nord.vim:270 Keyword guifg (s:nord9_gui = #81A1C1 at :25) - .kw = .{ 0x81, 0xa1, 0xc1 }, + .keyword = .{ 0x81, 0xa1, 0xc1 }, // ~/05-genizah/nord-vim/colors/nord.vim:281 String guifg (s:nord14_gui = #A3BE8C at :30) - .str = .{ 0xa3, 0xbe, 0x8c }, + .string = .{ 0xa3, 0xbe, 0x8c }, // ~/05-genizah/nord-vim/colors/nord.vim:272 Number guifg (s:nord15_gui = #B48EAD at :31) - .num = .{ 0xb4, 0x8e, 0xad }, + .number = .{ 0xb4, 0x8e, 0xad }, // ~/05-genizah/nord-vim/colors/nord.vim:258 Comment guifg (s:nord3_gui_bright = #616E88 at :19) .comment = .{ 0x61, 0x6e, 0x88 }, // ~/05-genizah/nord-vim/colors/nord.vim:136 LineNr guifg (s:nord3_gui = #4C566A at :18) - .lineno = .{ 0x4c, 0x56, 0x6a }, + .line_number = .{ 0x4c, 0x56, 0x6a }, // ~/05-genizah/nord-vim/colors/nord.vim:204 CursorLineNr guifg (s:nord4_gui = #D8DEE9 at :20) [default g:nord_cursor_line_number_background=0, :94] - .lineno_active = .{ 0xd8, 0xde, 0xe9 }, + .line_number_current = .{ 0xd8, 0xde, 0xe9 }, // ~/05-genizah/nord-vim/colors/nord.vim:141 PmenuSbar guibg (s:nord2_gui = #434C5E at :17) - .scroll_track = .{ 0x43, 0x4c, 0x5e }, + .rail = .{ 0x43, 0x4c, 0x5e }, // ~/05-genizah/nord-vim/colors/nord.vim:143 PmenuThumb guibg (s:nord3_gui = #4C566A at :18) #4c566a, adjusted - .scroll_thumb = .{ 0x60, 0x69, 0x7c }, + .rail_thumb = .{ 0x60, 0x69, 0x7c }, // ~/05-genizah/nord-vim/colors/nord.vim:248 VertSplit guifg (s:nord2_gui = #434C5E at :17) [no WinSeparator group; default g:nord_bold_vertical_split_line=0, :85] #434c5e, adjusted - .border = .{ 0x4c, 0x55, 0x66 }, + .rule = .{ 0x4c, 0x55, 0x66 }, // ~/05-genizah/nord-vim/colors/nord.vim:237 Search guibg (s:nord8_gui = #88C0D0 at :24) - .search_bg = .{ 0x88, 0xc0, 0xd0 }, - // ~/05-genizah/nord-vim/colors/nord.vim:237 Search guifg (s:nord1_gui = #3B4252 at :16) - .search_fg = .{ 0x3b, 0x42, 0x52 }, + .hit = .{ 0x88, 0xc0, 0xd0 }, // ~/05-genizah/nord-vim/colors/nord.vim:184 DiagnosticError guifg (s:nord11_gui = #BF616A at :27) - .diagnostic_error = .{ 0xbf, 0x61, 0x6a }, + .@"error" = .{ 0xbf, 0x61, 0x6a }, // ~/05-genizah/nord-vim/colors/nord.vim:183 DiagnosticWarn guifg (s:nord13_gui = #EBCB8B at :29) - .diagnostic_warning = .{ 0xeb, 0xcb, 0x8b }, + .warning = .{ 0xeb, 0xcb, 0x8b }, // ~/05-genizah/nord-vim/colors/nord.vim:185 DiagnosticInfo guifg (s:nord8_gui = #88C0D0 at :24) - .diagnostic_info = .{ 0x88, 0xc0, 0xd0 }, + .info = .{ 0x88, 0xc0, 0xd0 }, // ~/05-genizah/nord-vim/colors/nord.vim:186 DiagnosticHint guifg (s:nord10_gui = #5E81AC at :26) - .diagnostic_hint = .{ 0x5e, 0x81, 0xac }, - .palette = .{ + .hint = .{ 0x5e, 0x81, 0xac }, + .ansi = .{ .{ 0x3b, 0x42, 0x52 }, // 0: ~/05-genizah/nord-vim/colors/nord.vim:159 g:terminal_color_0 (s:nord1_gui = #3B4252 at :16) .{ 0xbf, 0x61, 0x6a }, // 1: ~/05-genizah/nord-vim/colors/nord.vim:160 g:terminal_color_1 (s:nord11_gui = #BF616A at :27) .{ 0xa3, 0xbe, 0x8c }, // 2: ~/05-genizah/nord-vim/colors/nord.vim:161 g:terminal_color_2 (s:nord14_gui = #A3BE8C at :30) diff --git a/core/themes/nordbones.zig b/core/themes/nordbones.zig index e7ec64b3..947164b3 100644 --- a/core/themes/nordbones.zig +++ b/core/themes/nordbones.zig @@ -18,63 +18,65 @@ //! only), so it inherits Normal. TabLine links to StatusLine, TabLineFill to //! StatusLineNC. Accent is the lualine normal-mode a bg, a muted neutral (the //! theme is contrast-based, not hue-accented). Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #6e778b -> #a2acc2: 1.52:1 on the focused tag, now 3.00:1 (R6: 3:1) +//! - search hit #84637e -> #634b34: 2.38:1 off the page, now 1.52:1 (R8: 1.5:1, the text reading on it) +//! - error #c1616a -> #e38088: 3.04:1 on the page, now 4.52:1 (R9: 4.5:1, told from the text and the others) +//! - warning #cf866f -> #e5c95e: 4.27:1 on the page, now 7.53:1 (R9: 4.5:1, told from the text and the others) +//! - hint #b38dac -> #b791b0: 4.29:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "nordbones", // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:34 Normal guibg - .bg = .{ 0x2f, 0x35, 0x41 }, + .page = .{ 0x2f, 0x35, 0x41 }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:34 Normal guifg - .fg = .{ 0xeb, 0xee, 0xf3 }, + .text = .{ 0xeb, 0xee, 0xf3 }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:212 Visual guibg - .sel_bg = .{ 0x54, 0x5f, 0x70 }, + .selection = .{ 0x54, 0x5f, 0x70 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xeb, 0xee, 0xf3 }, + .selection_text = .{ 0xeb, 0xee, 0xf3 }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:199 StatusLineNC guibg - .tag_bg = .{ 0x39, 0x40, 0x4e }, + .tag = .{ 0x39, 0x40, 0x4e }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:199 StatusLineNC guifg - .tag_fg = .{ 0xf2, 0xf4, 0xf7 }, + .tag_text = .{ 0xf2, 0xf4, 0xf7 }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:196 StatusLine guibg #414959, adjusted - .tag_active_bg = .{ 0x51, 0x5b, 0x6e }, + .tag_focus = .{ 0x51, 0x5b, 0x6e }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:196 StatusLine guifg - .tag_active_fg = .{ 0xeb, 0xee, 0xf3 }, + .tag_focus_text = .{ 0xeb, 0xee, 0xf3 }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/nordbones_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0x6e, 0x77, 0x8b }, - // derived: the grip at rest, the accent #5e687e faded toward the unfocused tag #39404e as far as 1.6:1 off it (0.78 of the way) - .box_dim = .{ 0x56, 0x5f, 0x73 }, + .accent = .{ 0x6e, 0x77, 0x8b }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/nordbones.vim:42 Changed guifg - .box_dirty = .{ 0x8f, 0xbc, 0xba }, + .dirty = .{ 0x8f, 0xbc, 0xba }, // derived: the column grip, the original's function colour, ~/05-genizah/zenbones.nvim/colors/nordbones.vim:123 Function guifg - .column_box = .{ 0x87, 0xbf, 0xce }, + .column_grip = .{ 0x87, 0xbf, 0xce }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:192 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0x81, 0xa1, 0xc1 }, + .keyword = .{ 0x81, 0xa1, 0xc1 }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:202 String guifg - .str = .{ 0x9e, 0xaf, 0xc9 }, + .string = .{ 0x9e, 0xaf, 0xc9 }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:165 Number guifg - .num = .{ 0x8f, 0xbc, 0xba }, + .number = .{ 0x8f, 0xbc, 0xba }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:48 Comment guifg .comment = .{ 0x73, 0x7c, 0x90 }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:151 LineNr guifg - .lineno = .{ 0x69, 0x75, 0x8c }, + .line_number = .{ 0x69, 0x75, 0x8c }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:63 CursorLineNr guifg - .lineno_active = .{ 0xeb, 0xee, 0xf3 }, + .line_number_current = .{ 0xeb, 0xee, 0xf3 }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:168 PmenuSbar guibg - .scroll_track = .{ 0x65, 0x70, 0x87 }, + .rail = .{ 0x65, 0x70, 0x87 }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:170 PmenuThumb guibg - .scroll_thumb = .{ 0x86, 0x94, 0xb0 }, + .rail_thumb = .{ 0x86, 0x94, 0xb0 }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:219 WinSeparator guifg - .border = .{ 0x69, 0x75, 0x8c }, + .rule = .{ 0x69, 0x75, 0x8c }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:173 Search guibg - .search_bg = .{ 0x84, 0x63, 0x7e }, - // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:173 Search guifg - .search_fg = .{ 0xeb, 0xee, 0xf3 }, + .hit = .{ 0x84, 0x63, 0x7e }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:114 Error guifg via DiagnosticError->Error (link :115) - .diagnostic_error = .{ 0xc1, 0x61, 0x6a }, + .@"error" = .{ 0xc1, 0x61, 0x6a }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:213 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :214) - .diagnostic_warning = .{ 0xcf, 0x86, 0x6f }, + .warning = .{ 0xcf, 0x86, 0x6f }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:73 DiagnosticInfo guifg - .diagnostic_info = .{ 0x8f, 0xbc, 0xba }, + .info = .{ 0x8f, 0xbc, 0xba }, // ~/05-genizah/zenbones.nvim/colors/nordbones.vim:68 DiagnosticHint guifg - .diagnostic_hint = .{ 0xb3, 0x8d, 0xac }, - .palette = .{ + .hint = .{ 0xb3, 0x8d, 0xac }, + .ansi = .{ .{ 0x2f, 0x35, 0x41 }, // 0: ~/05-genizah/zenbones.nvim/colors/nordbones.vim:18 g:terminal_color_0 .{ 0xc1, 0x61, 0x6a }, // 1: ~/05-genizah/zenbones.nvim/colors/nordbones.vim:19 g:terminal_color_1 .{ 0xa4, 0xbe, 0x8d }, // 2: ~/05-genizah/zenbones.nvim/colors/nordbones.vim:20 g:terminal_color_2 diff --git a/core/themes/okabe.zig b/core/themes/okabe.zig new file mode 100644 index 00000000..ba8b1888 --- /dev/null +++ b/core/themes/okabe.zig @@ -0,0 +1,32 @@ +//! pardes okabe: colour-blind safe (DESIGN.md part D): Okabe and Ito's +//! eight hues, lightened for a dark page. Added is blue, deleted vermilion, +//! errors vermilion and warnings yellow: nothing says red against green. For +//! the 8 % of men with a colour vision deficiency, and anyone reading diffs. +pub const theme = .{ + .name = "okabe", + .page = .{ 0x0e, 0x12, 0x18 }, + .text = .{ 0xd8, 0xde, 0xe8 }, + .tag = .{ 0x1b, 0x22, 0x2c }, + .tag_text = .{ 0xa9, 0xb4, 0xc4 }, + .accent = .{ 0x56, 0xb4, 0xe9 }, + .selection = .{ 0x27, 0x41, 0x5e }, + .selection_text = .{ 0xee, 0xf3, 0xfa }, + .keyword = .{ 0x6c, 0xc0, 0xf0 }, + .string = .{ 0x3c, 0xcf, 0xa4 }, + .number = .{ 0xf0, 0xa8, 0x30 }, + .comment = .{ 0xd7, 0xcf, 0x7a }, + .line_number = .{ 0x4e, 0x58, 0x66 }, + .line_number_current = .{ 0x7d, 0x88, 0x98 }, + .@"error" = .{ 0xff, 0x8a, 0x4c }, + .warning = .{ 0xf0, 0xe4, 0x42 }, + .info = .{ 0x8c, 0xc8, 0xf0 }, + .hint = .{ 0xe5, 0x94, 0xc8 }, + .added = .{ 0x56, 0xb4, 0xe9 }, + .deleted = .{ 0xff, 0x8a, 0x4c }, + .ansi = .{ + .{ 0x1b, 0x22, 0x2c }, .{ 0xff, 0x8a, 0x4c }, .{ 0x3c, 0xcf, 0xa4 }, .{ 0xf0, 0xe4, 0x42 }, + .{ 0x56, 0xb4, 0xe9 }, .{ 0xe5, 0x94, 0xc8 }, .{ 0x8f, 0xd8, 0xf0 }, .{ 0xc4, 0xcc, 0xd8 }, + .{ 0x73, 0x7e, 0x8e }, .{ 0xff, 0xab, 0x7c }, .{ 0x6f, 0xe0, 0xbd }, .{ 0xf6, 0xee, 0x80 }, + .{ 0x86, 0xcc, 0xf2 }, .{ 0xf0, 0xb4, 0xda }, .{ 0xb4, 0xe6, 0xf6 }, .{ 0xee, 0xf3, 0xfa }, + }, +}; diff --git a/core/themes/orchard.zig b/core/themes/orchard.zig index b4a35c1f..8559119d 100644 --- a/core/themes/orchard.zig +++ b/core/themes/orchard.zig @@ -3,36 +3,32 @@ //! designed together. See docs/typ/themes.typ for the shared role contract. pub const theme = .{ .name = "orchard", - .bg = .{ 0x0d, 0x14, 0x10 }, - .fg = .{ 0xe5, 0xee, 0xe5 }, - .tag_bg = .{ 0x1d, 0x28, 0x24 }, - .tag_fg = .{ 0xb2, 0xc3, 0xb8 }, - .tag_name_fg = .{ 0xd3, 0xb0, 0xd9 }, - .tag_active_name_fg = .{ 0xdf, 0xbc, 0xe5 }, - .tag_active_bg = .{ 0x26, 0x36, 0x2d }, - .tag_active_fg = .{ 0xbe, 0xcf, 0xc4 }, - .box = .{ 0xad, 0xd3, 0x8a }, - .box_dim = .{ 0x49, 0x66, 0x56 }, - .column_box = .{ 0xf4, 0xc0, 0x86 }, - .column_box_dim = .{ 0x88, 0x74, 0x55 }, - .kw = .{ 0xc9, 0xa7, 0xed }, - .str = .{ 0xb8, 0xd8, 0x8a }, - .num = .{ 0xf8, 0xc0, 0x82 }, + .page = .{ 0x0d, 0x14, 0x10 }, + .text = .{ 0xe5, 0xee, 0xe5 }, + .tag = .{ 0x1d, 0x28, 0x24 }, + .tag_text = .{ 0xb2, 0xc3, 0xb8 }, + .tag_name = .{ 0xd3, 0xb0, 0xd9 }, + .tag_focus = .{ 0x26, 0x36, 0x2d }, + .tag_focus_text = .{ 0xbe, 0xcf, 0xc4 }, + .accent = .{ 0xad, 0xd3, 0x8a }, + .column_grip = .{ 0xf4, 0xc0, 0x86 }, + .keyword = .{ 0xc9, 0xa7, 0xed }, + .string = .{ 0xb8, 0xd8, 0x8a }, + .number = .{ 0xf8, 0xc0, 0x82 }, .comment = .{ 0xb9, 0xf4, 0x80 }, - .lineno = .{ 0x59, 0x67, 0x5c }, - .lineno_active = .{ 0x61, 0x6f, 0x64 }, - .scroll_track = .{ 0x15, 0x20, 0x19 }, - .scroll_thumb = .{ 0x60, 0x82, 0x69 }, - .border = .{ 0x48, 0x61, 0x52 }, - .sel_bg = .{ 0x3c, 0x61, 0x4a }, - .sel_fg = .{ 0xf5, 0xf7, 0xee }, - .search_bg = .{ 0x5e, 0x49, 0x23 }, - .search_fg = .{ 0xf7, 0xe4, 0xa5 }, - .diagnostic_error = .{ 0xfe, 0x98, 0x8e }, - .diagnostic_warning = .{ 0xf9, 0xcb, 0x70 }, - .diagnostic_info = .{ 0x92, 0xd1, 0xde }, - .diagnostic_hint = .{ 0xb7, 0xcb, 0x98 }, - .palette = .{ + .line_number = .{ 0x59, 0x67, 0x5c }, + .line_number_current = .{ 0x61, 0x6f, 0x64 }, + .rail = .{ 0x15, 0x20, 0x19 }, + .rail_thumb = .{ 0x60, 0x82, 0x69 }, + .rule = .{ 0x48, 0x61, 0x52 }, + .selection = .{ 0x3c, 0x61, 0x4a }, + .selection_text = .{ 0xf5, 0xf7, 0xee }, + .hit = .{ 0x5e, 0x49, 0x23 }, + .@"error" = .{ 0xfe, 0x98, 0x8e }, + .warning = .{ 0xf9, 0xcb, 0x70 }, + .info = .{ 0x92, 0xd1, 0xde }, + .hint = .{ 0xb7, 0xcb, 0x98 }, + .ansi = .{ .{ 0x0d, 0x14, 0x10 }, .{ 0xf1, 0xa3, 0x9b }, .{ 0xb6, 0xce, 0x94 }, diff --git a/core/themes/orchard_black.zig b/core/themes/orchard_black.zig index d9e026bd..86e39627 100644 --- a/core/themes/orchard_black.zig +++ b/core/themes/orchard_black.zig @@ -3,36 +3,32 @@ //! designed together. See docs/typ/themes.typ for the shared role contract. pub const theme = .{ .name = "orchard_black", - .bg = .{ 0x00, 0x00, 0x00 }, - .fg = .{ 0xf2, 0xf8, 0xef }, - .tag_bg = .{ 0x1d, 0x28, 0x24 }, - .tag_fg = .{ 0xb2, 0xc3, 0xb8 }, - .tag_name_fg = .{ 0xd3, 0xb0, 0xd9 }, - .tag_active_name_fg = .{ 0xdf, 0xbc, 0xe5 }, - .tag_active_bg = .{ 0x26, 0x36, 0x2d }, - .tag_active_fg = .{ 0xbe, 0xcf, 0xc4 }, - .box = .{ 0xad, 0xd3, 0x8a }, - .box_dim = .{ 0x49, 0x66, 0x56 }, - .column_box = .{ 0xf4, 0xc0, 0x86 }, - .column_box_dim = .{ 0x88, 0x74, 0x55 }, - .kw = .{ 0xc9, 0xa7, 0xed }, - .str = .{ 0xb8, 0xd8, 0x8a }, - .num = .{ 0xf8, 0xc0, 0x82 }, + .page = .{ 0x00, 0x00, 0x00 }, + .text = .{ 0xf2, 0xf8, 0xef }, + .tag = .{ 0x1d, 0x28, 0x24 }, + .tag_text = .{ 0xb2, 0xc3, 0xb8 }, + .tag_name = .{ 0xd3, 0xb0, 0xd9 }, + .tag_focus = .{ 0x26, 0x36, 0x2d }, + .tag_focus_text = .{ 0xbe, 0xcf, 0xc4 }, + .accent = .{ 0xad, 0xd3, 0x8a }, + .column_grip = .{ 0xf4, 0xc0, 0x86 }, + .keyword = .{ 0xc9, 0xa7, 0xed }, + .string = .{ 0xb8, 0xd8, 0x8a }, + .number = .{ 0xf8, 0xc0, 0x82 }, .comment = .{ 0xb9, 0xf4, 0x80 }, - .lineno = .{ 0x59, 0x67, 0x5c }, - .lineno_active = .{ 0x61, 0x6f, 0x64 }, - .scroll_track = .{ 0x11, 0x18, 0x13 }, - .scroll_thumb = .{ 0x60, 0x82, 0x69 }, - .border = .{ 0x48, 0x61, 0x52 }, - .sel_bg = .{ 0x3c, 0x61, 0x4a }, - .sel_fg = .{ 0xf5, 0xf7, 0xee }, - .search_bg = .{ 0x5e, 0x49, 0x23 }, - .search_fg = .{ 0xf7, 0xe4, 0xa5 }, - .diagnostic_error = .{ 0xfe, 0x98, 0x8e }, - .diagnostic_warning = .{ 0xf9, 0xcb, 0x70 }, - .diagnostic_info = .{ 0x92, 0xd1, 0xde }, - .diagnostic_hint = .{ 0xb7, 0xcb, 0x98 }, - .palette = .{ + .line_number = .{ 0x59, 0x67, 0x5c }, + .line_number_current = .{ 0x61, 0x6f, 0x64 }, + .rail = .{ 0x11, 0x18, 0x13 }, + .rail_thumb = .{ 0x60, 0x82, 0x69 }, + .rule = .{ 0x48, 0x61, 0x52 }, + .selection = .{ 0x3c, 0x61, 0x4a }, + .selection_text = .{ 0xf5, 0xf7, 0xee }, + .hit = .{ 0x5e, 0x49, 0x23 }, + .@"error" = .{ 0xfe, 0x98, 0x8e }, + .warning = .{ 0xf9, 0xcb, 0x70 }, + .info = .{ 0x92, 0xd1, 0xde }, + .hint = .{ 0xb7, 0xcb, 0x98 }, + .ansi = .{ .{ 0x00, 0x00, 0x00 }, .{ 0xf1, 0xa3, 0x9b }, .{ 0xb6, 0xce, 0x94 }, diff --git a/core/themes/paper.zig b/core/themes/paper.zig index c86482f7..a9ace49a 100644 --- a/core/themes/paper.zig +++ b/core/themes/paper.zig @@ -3,36 +3,32 @@ //! designed together. See docs/typ/themes.typ for the shared role contract. pub const theme = .{ .name = "paper", - .bg = .{ 0xf5, 0xf3, 0xed }, - .fg = .{ 0x30, 0x3b, 0x3b }, - .tag_bg = .{ 0xe8, 0xea, 0xe3 }, - .tag_fg = .{ 0x52, 0x62, 0x5a }, - .tag_name_fg = .{ 0x72, 0x4c, 0x83 }, - .tag_active_name_fg = .{ 0x69, 0x44, 0x7a }, - .tag_active_bg = .{ 0xdc, 0xe5, 0xdc }, - .tag_active_fg = .{ 0x4a, 0x5a, 0x52 }, - .box = .{ 0x36, 0x71, 0x57 }, - .box_dim = .{ 0x8f, 0xa5, 0x94 }, - .column_box = .{ 0x93, 0x58, 0x1a }, - .column_box_dim = .{ 0xbd, 0xa2, 0x7e }, - .kw = .{ 0x74, 0x46, 0x9b }, - .str = .{ 0x3a, 0x6f, 0x44 }, - .num = .{ 0x98, 0x59, 0x15 }, + .page = .{ 0xf5, 0xf3, 0xed }, + .text = .{ 0x30, 0x3b, 0x3b }, + .tag = .{ 0xe8, 0xea, 0xe3 }, + .tag_text = .{ 0x52, 0x62, 0x5a }, + .tag_name = .{ 0x72, 0x4c, 0x83 }, + .tag_focus = .{ 0xdc, 0xe5, 0xdc }, + .tag_focus_text = .{ 0x4a, 0x5a, 0x52 }, + .accent = .{ 0x36, 0x71, 0x57 }, + .column_grip = .{ 0x93, 0x58, 0x1a }, + .keyword = .{ 0x74, 0x46, 0x9b }, + .string = .{ 0x3a, 0x6f, 0x44 }, + .number = .{ 0x98, 0x59, 0x15 }, .comment = .{ 0x20, 0x75, 0x56 }, - .lineno = .{ 0x8b, 0x91, 0x85 }, - .lineno_active = .{ 0x83, 0x89, 0x7d }, - .scroll_track = .{ 0xe5, 0xe8, 0xdf }, - .scroll_thumb = .{ 0x86, 0x9d, 0x8a }, - .border = .{ 0xfb, 0xfb, 0xfb }, - .sel_bg = .{ 0xc5, 0xe2, 0xd0 }, - .sel_fg = .{ 0x20, 0x3e, 0x31 }, - .search_bg = .{ 0xfb, 0xe2, 0x9d }, - .search_fg = .{ 0x61, 0x46, 0x1c }, - .diagnostic_error = .{ 0xb3, 0x29, 0x28 }, - .diagnostic_warning = .{ 0x8c, 0x5b, 0x00 }, - .diagnostic_info = .{ 0x26, 0x6b, 0x7f }, - .diagnostic_hint = .{ 0x51, 0x74, 0x37 }, - .palette = .{ + .line_number = .{ 0x8b, 0x91, 0x85 }, + .line_number_current = .{ 0x83, 0x89, 0x7d }, + .rail = .{ 0xe5, 0xe8, 0xdf }, + .rail_thumb = .{ 0x86, 0x9d, 0x8a }, + .rule = .{ 0xfb, 0xfb, 0xfb }, + .selection = .{ 0xc5, 0xe2, 0xd0 }, + .selection_text = .{ 0x20, 0x3e, 0x31 }, + .hit = .{ 0xfb, 0xe2, 0x9d }, + .@"error" = .{ 0xb3, 0x29, 0x28 }, + .warning = .{ 0x8c, 0x5b, 0x00 }, + .info = .{ 0x26, 0x6b, 0x7f }, + .hint = .{ 0x51, 0x74, 0x37 }, + .ansi = .{ .{ 0x30, 0x3b, 0x3b }, .{ 0xa3, 0x39, 0x38 }, .{ 0x41, 0x68, 0x48 }, diff --git a/core/themes/rose_pine.zig b/core/themes/rose_pine.zig index 8409af9b..168cc9a5 100644 --- a/core/themes/rose_pine.zig +++ b/core/themes/rose_pine.zig @@ -27,63 +27,61 @@ //! git 'changed' colour (also GitSignsChange/SignChange). keyword: Keyword = //! pine exists directly (Statement is also pine). constant: Constant gold; //! Boolean differs (rose). +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - selection #332d41 -> #372e51: 1.34:1 off the page, now 1.41:1 (R7) pub const theme = .{ .name = "rose_pine", // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:111 Normal bg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:5 main.base - .bg = .{ 0x19, 0x17, 0x24 }, + .page = .{ 0x19, 0x17, 0x24 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:111 Normal fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:10 main.text - .fg = .{ 0xe0, 0xde, 0xf4 }, + .text = .{ 0xe0, 0xde, 0xf4 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:146 Visual bg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:16 main.iris, blend = 15 -> composited over palette.base #191724 at alpha 0.15 by utilities.blend (~/05-genizah/rose-pine-neovim/lua/rose-pine/utilities.lua:55, called at ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1176) = #332d41 - .sel_bg = .{ 0x33, 0x2d, 0x41 }, + .selection = .{ 0x33, 0x2d, 0x41 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xe0, 0xde, 0xf4 }, + .selection_text = .{ 0xe0, 0xde, 0xf4 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:137 StatusLineNC bg = groups.panel = "surface" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:45) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:6 main.surface, blend = 60 -> composited over palette.base #191724 at alpha 0.60 by utilities.blend (~/05-genizah/rose-pine-neovim/lua/rose-pine/utilities.lua:55, called at ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1176) = #1d1b2a - .tag_bg = .{ 0x1d, 0x1b, 0x2a }, + .tag = .{ 0x1d, 0x1b, 0x2a }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:137 StatusLineNC fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:8 main.muted #6e6a86, adjusted - .tag_fg = .{ 0x85, 0x82, 0x99 }, + .tag_text = .{ 0x85, 0x82, 0x99 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:136 StatusLine bg = groups.panel = "surface" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:45) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:6 main.surface #1f1d2e, adjusted - .tag_active_bg = .{ 0x3c, 0x3a, 0x4e }, + .tag_focus = .{ 0x3c, 0x3a, 0x4e }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:136 StatusLine fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:9 main.subtle #908caa, adjusted - .tag_active_fg = .{ 0xa8, 0xa5, 0xbd }, + .tag_focus_text = .{ 0xa8, 0xa5, 0xbd }, // the focused grip: ~/05-genizah/rose-pine-neovim/lua/lualine/themes/rose-pine.lua:11 lualine theme normal.a bg = p.rose -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:13 main.rose - .box = .{ 0xeb, 0xbc, 0xba }, - // derived: the grip at rest, the accent #ebbcba faded toward the unfocused tag #1d1b2a as far as 1.6:1 off it (0.22 of the way) - .box_dim = .{ 0x4a, 0x3e, 0x4a }, + .accent = .{ 0xeb, 0xbc, 0xba }, // an unsaved grip: the original's warning colour, ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:159 DiagnosticWarn fg = groups.warn = "gold" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:51) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:12 main.gold - .box_dirty = .{ 0xf6, 0xc1, 0x77 }, + .dirty = .{ 0xf6, 0xc1, 0x77 }, // derived: the column grip, the original's type colour, ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:223 Type fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:15 main.foam - .column_box = .{ 0x9c, 0xcf, 0xd8 }, + .column_grip = .{ 0x9c, 0xcf, 0xd8 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:200 Keyword fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:14 main.pine - .kw = .{ 0x31, 0x74, 0x8f }, + .keyword = .{ 0x31, 0x74, 0x8f }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:219 String fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:12 main.gold - .str = .{ 0xf6, 0xc1, 0x77 }, + .string = .{ 0xf6, 0xc1, 0x77 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:209 Number fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:12 main.gold - .num = .{ 0xf6, 0xc1, 0x77 }, + .number = .{ 0xf6, 0xc1, 0x77 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:188 Comment fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:9 main.subtle .comment = .{ 0x90, 0x8c, 0xaa }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:106 LineNr fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:8 main.muted - .lineno = .{ 0x6e, 0x6a, 0x86 }, + .line_number = .{ 0x6e, 0x6a, 0x86 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:88 CursorLineNr fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:10 main.text - .lineno_active = .{ 0xe0, 0xde, 0xf4 }, + .line_number_current = .{ 0xe0, 0xde, 0xf4 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:120 PmenuSbar bg = groups.panel = "surface" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:45) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:6 main.surface - .scroll_track = .{ 0x1f, 0x1d, 0x2e }, + .rail = .{ 0x1f, 0x1d, 0x2e }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:122 PmenuThumb bg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:8 main.muted - .scroll_thumb = .{ 0x6e, 0x6a, 0x86 }, + .rail_thumb = .{ 0x6e, 0x6a, 0x86 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:153 WinSeparator fg = groups.border = "muted" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:43) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:8 main.muted - .border = .{ 0x6e, 0x6a, 0x86 }, + .rule = .{ 0x6e, 0x6a, 0x86 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:129 Search bg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:12 main.gold, blend = 20 -> composited over palette.base #191724 at alpha 0.20 by utilities.blend (~/05-genizah/rose-pine-neovim/lua/rose-pine/utilities.lua:55, called at ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1176) = #453935 - .search_bg = .{ 0x45, 0x39, 0x35 }, - // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:129 Search fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:10 main.text - .search_fg = .{ 0xe0, 0xde, 0xf4 }, + .hit = .{ 0x45, 0x39, 0x35 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:155 DiagnosticError fg = groups.error = "love" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:47) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:11 main.love - .diagnostic_error = .{ 0xeb, 0x6f, 0x92 }, + .@"error" = .{ 0xeb, 0x6f, 0x92 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:159 DiagnosticWarn fg = groups.warn = "gold" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:51) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:12 main.gold - .diagnostic_warning = .{ 0xf6, 0xc1, 0x77 }, + .warning = .{ 0xf6, 0xc1, 0x77 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:157 DiagnosticInfo fg = groups.info = "foam" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:49) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:15 main.foam - .diagnostic_info = .{ 0x9c, 0xcf, 0xd8 }, + .info = .{ 0x9c, 0xcf, 0xd8 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:156 DiagnosticHint fg = groups.hint = "iris" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:48) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:16 main.iris - .diagnostic_hint = .{ 0xc4, 0xa7, 0xe7 }, - .palette = .{ + .hint = .{ 0xc4, 0xa7, 0xe7 }, + .ansi = .{ .{ 0x26, 0x23, 0x3a }, // 0: ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1191 vim.g.terminal_color_0 = palette.overlay -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:7 main.overlay .{ 0xeb, 0x6f, 0x92 }, // 1: ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1193 vim.g.terminal_color_1 = palette.love -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:11 main.love .{ 0x31, 0x74, 0x8f }, // 2: ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1195 vim.g.terminal_color_2 = palette.pine -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:14 main.pine diff --git a/core/themes/rose_pine_dawn.zig b/core/themes/rose_pine_dawn.zig index 304df52b..04bc7828 100644 --- a/core/themes/rose_pine_dawn.zig +++ b/core/themes/rose_pine_dawn.zig @@ -27,63 +27,70 @@ //! git 'changed' colour (also GitSignsChange/SignChange). keyword: Keyword = //! pine exists directly (Statement is also pine). constant: Constant gold; //! Boolean differs (rose). +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #fdf8f1 -> #eee9e2: 1.03:1 off the page, now 1.11:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - focused tag ground #e2ddde -> #d6d1ca: 1.11:1 off the tag, now 1.26:1 (R4, H: a focus step off the tag, and the loudest) +//! - focused grip #d7827e -> #af5e5b: 1.87:1 on the focused tag, now 3.02:1 (R6: 3:1) +//! - unsaved grip #ea9d34 -> #a56800: 1.86:1 on the tag, now 3.80:1 (R6: 3:1 on both tags) +//! - selection #eae2e3 -> #e7d9d3: 1.17:1 off the page, now 1.26:1 (R7) +//! - search hit #f7e3c8 -> #fabe78: 1.15:1 off the page, now 1.51:1 (R8: 1.5:1, the text reading on it) +//! - error #b4637a -> #a7576e: 3.84:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) +//! - warning #ea9d34 -> #9e6300: 2.05:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) +//! - info #56949f -> #3b7984: 3.14:1 on the page, now 4.52:1 (R9: 4.5:1, told from the text and the others) +//! - hint #907aa9 -> #7d6795: 3.47:1 on the page, now 4.53:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "rose_pine_dawn", // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:111 Normal bg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:45 dawn.base - .bg = .{ 0xfa, 0xf4, 0xed }, + .page = .{ 0xfa, 0xf4, 0xed }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:111 Normal fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:50 dawn.text - .fg = .{ 0x46, 0x42, 0x61 }, + .text = .{ 0x46, 0x42, 0x61 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:146 Visual bg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:56 dawn.iris, blend = 15 -> composited over palette.base #faf4ed at alpha 0.15 by utilities.blend (~/05-genizah/rose-pine-neovim/lua/rose-pine/utilities.lua:55, called at ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1176) = #eae2e3 - .sel_bg = .{ 0xea, 0xe2, 0xe3 }, + .selection = .{ 0xea, 0xe2, 0xe3 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x46, 0x42, 0x61 }, + .selection_text = .{ 0x46, 0x42, 0x61 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:137 StatusLineNC bg = groups.panel = "surface" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:45) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:46 dawn.surface, blend = 60 -> composited over palette.base #faf4ed at alpha 0.60 by utilities.blend (~/05-genizah/rose-pine-neovim/lua/rose-pine/utilities.lua:55, called at ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1176) = #fdf8f1 - .tag_bg = .{ 0xfd, 0xf8, 0xf1 }, + .tag = .{ 0xfd, 0xf8, 0xf1 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:137 StatusLineNC fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:48 dawn.muted #9893a5, adjusted - .tag_fg = .{ 0x74, 0x70, 0x7d }, + .tag_text = .{ 0x74, 0x70, 0x7d }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:136 StatusLine bg = groups.panel = "surface" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:45) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:46 dawn.surface #fffaf3, adjusted - .tag_active_bg = .{ 0xe2, 0xdd, 0xde }, + .tag_focus = .{ 0xe2, 0xdd, 0xde }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:136 StatusLine fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:49 dawn.subtle #797593, adjusted - .tag_active_fg = .{ 0x61, 0x5e, 0x76 }, + .tag_focus_text = .{ 0x61, 0x5e, 0x76 }, // the focused grip: ~/05-genizah/rose-pine-neovim/lua/lualine/themes/rose-pine.lua:11 lualine theme normal.a bg = p.rose -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:53 dawn.rose - .box = .{ 0xd7, 0x82, 0x7e }, - // derived: the grip at rest, the accent #d7827e faded toward the unfocused tag #fdf8f1 as far as 1.6:1 off it (0.52 of the way) - .box_dim = .{ 0xe9, 0xbb, 0xb5 }, + .accent = .{ 0xd7, 0x82, 0x7e }, // an unsaved grip: the original's warning colour, ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:159 DiagnosticWarn fg = groups.warn = "gold" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:51) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:52 dawn.gold - .box_dirty = .{ 0xea, 0x9d, 0x34 }, + .dirty = .{ 0xea, 0x9d, 0x34 }, // derived: the column grip, the original's type colour, ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:223 Type fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:55 dawn.foam - .column_box = .{ 0x56, 0x94, 0x9f }, + .column_grip = .{ 0x56, 0x94, 0x9f }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:200 Keyword fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:54 dawn.pine - .kw = .{ 0x28, 0x69, 0x83 }, + .keyword = .{ 0x28, 0x69, 0x83 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:219 String fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:52 dawn.gold - .str = .{ 0xea, 0x9d, 0x34 }, + .string = .{ 0xea, 0x9d, 0x34 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:209 Number fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:52 dawn.gold - .num = .{ 0xea, 0x9d, 0x34 }, + .number = .{ 0xea, 0x9d, 0x34 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:188 Comment fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:49 dawn.subtle .comment = .{ 0x79, 0x75, 0x93 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:106 LineNr fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:48 dawn.muted - .lineno = .{ 0x98, 0x93, 0xa5 }, + .line_number = .{ 0x98, 0x93, 0xa5 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:88 CursorLineNr fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:50 dawn.text - .lineno_active = .{ 0x46, 0x42, 0x61 }, + .line_number_current = .{ 0x46, 0x42, 0x61 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:120 PmenuSbar bg = groups.panel = "surface" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:45) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:46 dawn.surface - .scroll_track = .{ 0xff, 0xfa, 0xf3 }, + .rail = .{ 0xff, 0xfa, 0xf3 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:122 PmenuThumb bg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:48 dawn.muted - .scroll_thumb = .{ 0x98, 0x93, 0xa5 }, + .rail_thumb = .{ 0x98, 0x93, 0xa5 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:153 WinSeparator fg = groups.border = "muted" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:43) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:48 dawn.muted - .border = .{ 0x98, 0x93, 0xa5 }, + .rule = .{ 0x98, 0x93, 0xa5 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:129 Search bg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:52 dawn.gold, blend = 20 -> composited over palette.base #faf4ed at alpha 0.20 by utilities.blend (~/05-genizah/rose-pine-neovim/lua/rose-pine/utilities.lua:55, called at ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1176) = #f7e3c8 - .search_bg = .{ 0xf7, 0xe3, 0xc8 }, - // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:129 Search fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:50 dawn.text - .search_fg = .{ 0x46, 0x42, 0x61 }, + .hit = .{ 0xf7, 0xe3, 0xc8 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:155 DiagnosticError fg = groups.error = "love" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:47) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:51 dawn.love - .diagnostic_error = .{ 0xb4, 0x63, 0x7a }, + .@"error" = .{ 0xb4, 0x63, 0x7a }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:159 DiagnosticWarn fg = groups.warn = "gold" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:51) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:52 dawn.gold - .diagnostic_warning = .{ 0xea, 0x9d, 0x34 }, + .warning = .{ 0xea, 0x9d, 0x34 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:157 DiagnosticInfo fg = groups.info = "foam" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:49) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:55 dawn.foam - .diagnostic_info = .{ 0x56, 0x94, 0x9f }, + .info = .{ 0x56, 0x94, 0x9f }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:156 DiagnosticHint fg = groups.hint = "iris" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:48) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:56 dawn.iris - .diagnostic_hint = .{ 0x90, 0x7a, 0xa9 }, - .palette = .{ + .hint = .{ 0x90, 0x7a, 0xa9 }, + .ansi = .{ .{ 0xf2, 0xe9, 0xe1 }, // 0: ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1191 vim.g.terminal_color_0 = palette.overlay -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:47 dawn.overlay .{ 0xb4, 0x63, 0x7a }, // 1: ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1193 vim.g.terminal_color_1 = palette.love -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:51 dawn.love .{ 0x28, 0x69, 0x83 }, // 2: ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1195 vim.g.terminal_color_2 = palette.pine -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:54 dawn.pine diff --git a/core/themes/rose_pine_moon.zig b/core/themes/rose_pine_moon.zig index f90975f1..a730284e 100644 --- a/core/themes/rose_pine_moon.zig +++ b/core/themes/rose_pine_moon.zig @@ -27,63 +27,61 @@ //! git 'changed' colour (also GitSignsChange/SignChange). keyword: Keyword = //! pine exists directly (Statement is also pine). constant: Constant gold; //! Boolean differs (rose). +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - selection #3b3551 -> #3f3468: 1.35:1 off the page, now 1.42:1 (R7) pub const theme = .{ .name = "rose_pine_moon", // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:111 Normal bg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:25 moon.base - .bg = .{ 0x23, 0x21, 0x36 }, + .page = .{ 0x23, 0x21, 0x36 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:111 Normal fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:30 moon.text - .fg = .{ 0xe0, 0xde, 0xf4 }, + .text = .{ 0xe0, 0xde, 0xf4 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:146 Visual bg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:36 moon.iris, blend = 15 -> composited over palette.base #232136 at alpha 0.15 by utilities.blend (~/05-genizah/rose-pine-neovim/lua/rose-pine/utilities.lua:55, called at ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1176) = #3b3551 - .sel_bg = .{ 0x3b, 0x35, 0x51 }, + .selection = .{ 0x3b, 0x35, 0x51 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xe0, 0xde, 0xf4 }, + .selection_text = .{ 0xe0, 0xde, 0xf4 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:137 StatusLineNC bg = groups.panel = "surface" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:45) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:26 moon.surface, blend = 60 -> composited over palette.base #232136 at alpha 0.60 by utilities.blend (~/05-genizah/rose-pine-neovim/lua/rose-pine/utilities.lua:55, called at ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1176) = #27253b - .tag_bg = .{ 0x27, 0x25, 0x3b }, + .tag = .{ 0x27, 0x25, 0x3b }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:137 StatusLineNC fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:28 moon.muted #6e6a86, adjusted - .tag_fg = .{ 0x91, 0x8e, 0xa3 }, + .tag_text = .{ 0x91, 0x8e, 0xa3 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:136 StatusLine bg = groups.panel = "surface" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:45) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:26 moon.surface #2a273f, adjusted - .tag_active_bg = .{ 0x45, 0x41, 0x5b }, + .tag_focus = .{ 0x45, 0x41, 0x5b }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:136 StatusLine fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:29 moon.subtle #908caa, adjusted - .tag_active_fg = .{ 0xb1, 0xaf, 0xc4 }, + .tag_focus_text = .{ 0xb1, 0xaf, 0xc4 }, // the focused grip: ~/05-genizah/rose-pine-neovim/lua/lualine/themes/rose-pine.lua:11 lualine theme normal.a bg = p.rose -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:33 moon.rose - .box = .{ 0xea, 0x9a, 0x97 }, - // derived: the grip at rest, the accent #ea9a97 faded toward the unfocused tag #27253b as far as 1.6:1 off it (0.26 of the way) - .box_dim = .{ 0x5a, 0x43, 0x53 }, + .accent = .{ 0xea, 0x9a, 0x97 }, // an unsaved grip: the original's warning colour, ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:159 DiagnosticWarn fg = groups.warn = "gold" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:51) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:32 moon.gold - .box_dirty = .{ 0xf6, 0xc1, 0x77 }, + .dirty = .{ 0xf6, 0xc1, 0x77 }, // derived: the column grip, the original's type colour, ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:223 Type fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:35 moon.foam - .column_box = .{ 0x9c, 0xcf, 0xd8 }, + .column_grip = .{ 0x9c, 0xcf, 0xd8 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:200 Keyword fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:34 moon.pine - .kw = .{ 0x3e, 0x8f, 0xb0 }, + .keyword = .{ 0x3e, 0x8f, 0xb0 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:219 String fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:32 moon.gold - .str = .{ 0xf6, 0xc1, 0x77 }, + .string = .{ 0xf6, 0xc1, 0x77 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:209 Number fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:32 moon.gold - .num = .{ 0xf6, 0xc1, 0x77 }, + .number = .{ 0xf6, 0xc1, 0x77 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:188 Comment fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:29 moon.subtle .comment = .{ 0x90, 0x8c, 0xaa }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:106 LineNr fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:28 moon.muted - .lineno = .{ 0x6e, 0x6a, 0x86 }, + .line_number = .{ 0x6e, 0x6a, 0x86 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:88 CursorLineNr fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:30 moon.text - .lineno_active = .{ 0xe0, 0xde, 0xf4 }, + .line_number_current = .{ 0xe0, 0xde, 0xf4 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:120 PmenuSbar bg = groups.panel = "surface" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:45) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:26 moon.surface - .scroll_track = .{ 0x2a, 0x27, 0x3f }, + .rail = .{ 0x2a, 0x27, 0x3f }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:122 PmenuThumb bg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:28 moon.muted - .scroll_thumb = .{ 0x6e, 0x6a, 0x86 }, + .rail_thumb = .{ 0x6e, 0x6a, 0x86 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:153 WinSeparator fg = groups.border = "muted" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:43) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:28 moon.muted - .border = .{ 0x6e, 0x6a, 0x86 }, + .rule = .{ 0x6e, 0x6a, 0x86 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:129 Search bg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:32 moon.gold, blend = 20 -> composited over palette.base #232136 at alpha 0.20 by utilities.blend (~/05-genizah/rose-pine-neovim/lua/rose-pine/utilities.lua:55, called at ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1176) = #4d4143 - .search_bg = .{ 0x4d, 0x41, 0x43 }, - // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:129 Search fg = ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:30 moon.text - .search_fg = .{ 0xe0, 0xde, 0xf4 }, + .hit = .{ 0x4d, 0x41, 0x43 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:155 DiagnosticError fg = groups.error = "love" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:47) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:31 moon.love - .diagnostic_error = .{ 0xeb, 0x6f, 0x92 }, + .@"error" = .{ 0xeb, 0x6f, 0x92 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:159 DiagnosticWarn fg = groups.warn = "gold" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:51) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:32 moon.gold - .diagnostic_warning = .{ 0xf6, 0xc1, 0x77 }, + .warning = .{ 0xf6, 0xc1, 0x77 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:157 DiagnosticInfo fg = groups.info = "foam" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:49) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:35 moon.foam - .diagnostic_info = .{ 0x9c, 0xcf, 0xd8 }, + .info = .{ 0x9c, 0xcf, 0xd8 }, // ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:156 DiagnosticHint fg = groups.hint = "iris" (~/05-genizah/rose-pine-neovim/lua/rose-pine/config.lua:48) -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:36 moon.iris - .diagnostic_hint = .{ 0xc4, 0xa7, 0xe7 }, - .palette = .{ + .hint = .{ 0xc4, 0xa7, 0xe7 }, + .ansi = .{ .{ 0x39, 0x35, 0x52 }, // 0: ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1191 vim.g.terminal_color_0 = palette.overlay -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:27 moon.overlay .{ 0xeb, 0x6f, 0x92 }, // 1: ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1193 vim.g.terminal_color_1 = palette.love -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:31 moon.love .{ 0x3e, 0x8f, 0xb0 }, // 2: ~/05-genizah/rose-pine-neovim/lua/rose-pine.lua:1195 vim.g.terminal_color_2 = palette.pine -> ~/05-genizah/rose-pine-neovim/lua/rose-pine/palette.lua:34 moon.pine diff --git a/core/themes/rosebones_dark.zig b/core/themes/rosebones_dark.zig index bd3ae169..0954e615 100644 --- a/core/themes/rosebones_dark.zig +++ b/core/themes/rosebones_dark.zig @@ -16,63 +16,61 @@ //! only), so it inherits Normal. TabLine links to StatusLine, TabLineFill to //! StatusLineNC. Accent is the lualine normal-mode a bg, a muted neutral (the //! theme is contrast-based, not hue-accented). Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #5d5978 -> #8c88aa: 1.53:1 on the focused tag, now 3.01:1 (R6: 3:1) pub const theme = .{ .name = "rosebones_dark", // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:33 Normal guibg - .bg = .{ 0x1a, 0x18, 0x25 }, + .page = .{ 0x1a, 0x18, 0x25 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:33 Normal guifg - .fg = .{ 0xe1, 0xd4, 0xd4 }, + .text = .{ 0xe1, 0xd4, 0xd4 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:211 Visual guibg - .sel_bg = .{ 0x52, 0x3a, 0x39 }, + .selection = .{ 0x52, 0x3a, 0x39 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xe1, 0xd4, 0xd4 }, + .selection_text = .{ 0xe1, 0xd4, 0xd4 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:198 StatusLineNC guibg - .tag_bg = .{ 0x24, 0x22, 0x32 }, + .tag = .{ 0x24, 0x22, 0x32 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:198 StatusLineNC guifg - .tag_fg = .{ 0xe9, 0xe0, 0xe0 }, + .tag_text = .{ 0xe9, 0xe0, 0xe0 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:195 StatusLine guibg #312e43, adjusted - .tag_active_bg = .{ 0x42, 0x3e, 0x59 }, + .tag_focus = .{ 0x42, 0x3e, 0x59 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:195 StatusLine guifg - .tag_active_fg = .{ 0xe1, 0xd4, 0xd4 }, + .tag_focus_text = .{ 0xe1, 0xd4, 0xd4 }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/rosebones_dark_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0x5d, 0x59, 0x78 }, - // derived: the grip at rest, the accent #534e6f faded toward the unfocused tag #242232 as far as 1.6:1 off it (0.72 of the way) - .box_dim = .{ 0x46, 0x42, 0x5e }, + .accent = .{ 0x5d, 0x59, 0x78 }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/rosebones.vim:41 Changed guifg - .box_dirty = .{ 0x9c, 0xcf, 0xd8 }, + .dirty = .{ 0x9c, 0xcf, 0xd8 }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/rosebones.vim:207 Type guifg - .column_box = .{ 0xdf, 0xde, 0xf1 }, + .column_grip = .{ 0xdf, 0xde, 0xf1 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:191 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0x31, 0x74, 0x90 }, + .keyword = .{ 0x31, 0x74, 0x90 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:201 String guifg - .str = .{ 0xbc, 0x94, 0x93 }, + .string = .{ 0xbc, 0x94, 0x93 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:164 Number guifg - .num = .{ 0xbc, 0x94, 0x93 }, + .number = .{ 0xbc, 0x94, 0x93 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:47 Comment guifg .comment = .{ 0x69, 0x65, 0x7e }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:150 LineNr guifg - .lineno = .{ 0x62, 0x5d, 0x7f }, + .line_number = .{ 0x62, 0x5d, 0x7f }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:62 CursorLineNr guifg - .lineno_active = .{ 0xe1, 0xd4, 0xd4 }, + .line_number_current = .{ 0xe1, 0xd4, 0xd4 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:167 PmenuSbar guibg - .scroll_track = .{ 0x5a, 0x55, 0x78 }, + .rail = .{ 0x5a, 0x55, 0x78 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:169 PmenuThumb guibg - .scroll_thumb = .{ 0x84, 0x80, 0x9d }, + .rail_thumb = .{ 0x84, 0x80, 0x9d }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:218 WinSeparator guifg - .border = .{ 0x62, 0x5d, 0x7f }, + .rule = .{ 0x62, 0x5d, 0x7f }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:172 Search guibg - .search_bg = .{ 0x67, 0x35, 0x92 }, - // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:172 Search guifg - .search_fg = .{ 0xe1, 0xd4, 0xd4 }, + .hit = .{ 0x67, 0x35, 0x92 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:113 Error guifg via DiagnosticError->Error (link :114) - .diagnostic_error = .{ 0xeb, 0x71, 0x93 }, + .@"error" = .{ 0xeb, 0x71, 0x93 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:212 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :213) - .diagnostic_warning = .{ 0xf6, 0xc0, 0x74 }, + .warning = .{ 0xf6, 0xc0, 0x74 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:72 DiagnosticInfo guifg - .diagnostic_info = .{ 0x9c, 0xcf, 0xd8 }, + .info = .{ 0x9c, 0xcf, 0xd8 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:67 DiagnosticHint guifg - .diagnostic_hint = .{ 0xc4, 0xa7, 0xe7 }, - .palette = .{ + .hint = .{ 0xc4, 0xa7, 0xe7 }, + .ansi = .{ .{ 0x1a, 0x18, 0x25 }, // 0: ~/05-genizah/zenbones.nvim/colors/rosebones.vim:17 g:terminal_color_0 .{ 0xeb, 0x71, 0x93 }, // 1: ~/05-genizah/zenbones.nvim/colors/rosebones.vim:18 g:terminal_color_1 .{ 0x31, 0x74, 0x90 }, // 2: ~/05-genizah/zenbones.nvim/colors/rosebones.vim:19 g:terminal_color_2 diff --git a/core/themes/rosebones_light.zig b/core/themes/rosebones_light.zig index 314424a6..0d8b4fa0 100644 --- a/core/themes/rosebones_light.zig +++ b/core/themes/rosebones_light.zig @@ -17,63 +17,67 @@ //! only), so it inherits Normal. TabLine links to StatusLine, TabLineFill to //! StatusLineNC. Accent is the lualine normal-mode a bg, a muted neutral (the //! theme is contrast-based, not hue-accented). Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #bea174 -> #896e42: 1.54:1 on the focused tag, now 3.02:1 (R6: 3:1) +//! - unsaved grip #5795a0 -> #3d7b86: 2.69:1 on the tag, now 3.82:1 (R6: 3:1 on both tags) +//! - selection #eadddc -> #ecdad3: 1.23:1 off the page, now 1.26:1 (R7) +//! - error #b5637a -> #a9586f: 3.88:1 on the page, now 4.53:1 (R9: 4.5:1, told from the text and the others) +//! - warning #ec9d33 -> #a16400: 2.07:1 on the page, now 4.50:1 (R9: 4.5:1, told from the text and the others) +//! - info #5795a0 -> #3c7a85: 3.15:1 on the page, now 4.53:1 (R9: 4.5:1, told from the text and the others) +//! - hint #917ba9 -> #7e6995: 3.48:1 on the page, now 4.50:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "rosebones_light", // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:267 Normal guibg - .bg = .{ 0xfb, 0xf6, 0xf0 }, + .page = .{ 0xfb, 0xf6, 0xf0 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:267 Normal guifg - .fg = .{ 0x72, 0x43, 0x41 }, + .text = .{ 0x72, 0x43, 0x41 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:445 Visual guibg - .sel_bg = .{ 0xea, 0xdd, 0xdc }, + .selection = .{ 0xea, 0xdd, 0xdc }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x72, 0x43, 0x41 }, + .selection_text = .{ 0x72, 0x43, 0x41 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:432 StatusLineNC guibg - .tag_bg = .{ 0xf3, 0xe3, 0xcf }, + .tag = .{ 0xf3, 0xe3, 0xcf }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:432 StatusLineNC guifg #ae6966, adjusted - .tag_fg = .{ 0x8f, 0x56, 0x54 }, + .tag_text = .{ 0x8f, 0x56, 0x54 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:429 StatusLine guibg #ecd0a9, adjusted - .tag_active_bg = .{ 0xe9, 0xc8, 0x9a }, + .tag_focus = .{ 0xe9, 0xc8, 0x9a }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:429 StatusLine guifg - .tag_active_fg = .{ 0x72, 0x43, 0x41 }, + .tag_focus_text = .{ 0x72, 0x43, 0x41 }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/rosebones_light_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0xbe, 0xa1, 0x74 }, - // derived: the grip at rest, the accent #ceaf7e faded toward the unfocused tag #f3e3cf as far as 1.6:1 off it (0.96 of the way) - .box_dim = .{ 0xcf, 0xb1, 0x81 }, + .accent = .{ 0xbe, 0xa1, 0x74 }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/rosebones.vim:275 Changed guifg - .box_dirty = .{ 0x57, 0x95, 0xa0 }, + .dirty = .{ 0x57, 0x95, 0xa0 }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/rosebones.vim:441 Type guifg - .column_box = .{ 0x57, 0x52, 0x7a }, + .column_grip = .{ 0x57, 0x52, 0x7a }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:425 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0x28, 0x6a, 0x84 }, + .keyword = .{ 0x28, 0x6a, 0x84 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:435 String guifg - .str = .{ 0xab, 0x67, 0x63 }, + .string = .{ 0xab, 0x67, 0x63 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:398 Number guifg - .num = .{ 0xab, 0x67, 0x63 }, + .number = .{ 0xab, 0x67, 0x63 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:281 Comment guifg .comment = .{ 0xa1, 0x8e, 0x72 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:384 LineNr guifg - .lineno = .{ 0xb6, 0x9a, 0x6e }, + .line_number = .{ 0xb6, 0x9a, 0x6e }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:296 CursorLineNr guifg - .lineno_active = .{ 0x72, 0x43, 0x41 }, + .line_number_current = .{ 0x72, 0x43, 0x41 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:401 PmenuSbar guibg - .scroll_track = .{ 0xc5, 0xa7, 0x78 }, + .rail = .{ 0xc5, 0xa7, 0x78 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:403 PmenuThumb guibg - .scroll_thumb = .{ 0xfe, 0xfc, 0xfa }, + .rail_thumb = .{ 0xfe, 0xfc, 0xfa }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:452 WinSeparator guifg - .border = .{ 0xb6, 0x9a, 0x6e }, + .rule = .{ 0xb6, 0x9a, 0x6e }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:406 Search guibg - .search_bg = .{ 0xd1, 0xc9, 0xdc }, - // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:406 Search guifg - .search_fg = .{ 0x72, 0x43, 0x41 }, + .hit = .{ 0xd1, 0xc9, 0xdc }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:347 Error guifg via DiagnosticError->Error (link :348) - .diagnostic_error = .{ 0xb5, 0x63, 0x7a }, + .@"error" = .{ 0xb5, 0x63, 0x7a }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:446 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :447) - .diagnostic_warning = .{ 0xec, 0x9d, 0x33 }, + .warning = .{ 0xec, 0x9d, 0x33 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:306 DiagnosticInfo guifg - .diagnostic_info = .{ 0x57, 0x95, 0xa0 }, + .info = .{ 0x57, 0x95, 0xa0 }, // ~/05-genizah/zenbones.nvim/colors/rosebones.vim:301 DiagnosticHint guifg - .diagnostic_hint = .{ 0x91, 0x7b, 0xa9 }, - .palette = .{ + .hint = .{ 0x91, 0x7b, 0xa9 }, + .ansi = .{ .{ 0xfb, 0xf6, 0xf0 }, // 0: ~/05-genizah/zenbones.nvim/colors/rosebones.vim:251 g:terminal_color_0 .{ 0xb5, 0x63, 0x7a }, // 1: ~/05-genizah/zenbones.nvim/colors/rosebones.vim:252 g:terminal_color_1 .{ 0x28, 0x6a, 0x84 }, // 2: ~/05-genizah/zenbones.nvim/colors/rosebones.vim:253 g:terminal_color_2 diff --git a/core/themes/seoul256.zig b/core/themes/seoul256.zig index d51ec310..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_<style>_<level>). Every value is the original's own, +//! can draw it: its dark style at each of its backgrounds 233 to 237 and its +//! light one at 254 to 256, a theme each (`dark`, `light`; colors.zig rings +//! them as seoul256_<style>_<level>; 238, 239, 252 and 253 retired, DESIGN.md +//! E: their text leaves the hits no room). Every value is the original's own, //! cited on its line (path:line key), once for the family: a value every //! level shares where it is set below, one a level changes in that level's //! row of `dark_levels` or `light_levels`, with what pardes adjusted there. @@ -35,164 +36,151 @@ //! 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) +//! - 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_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 - // 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 - // 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 = 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 } }, }; /// 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 - // 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 - // 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 + // 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 +192,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 +271,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 diff --git a/core/themes/seoulbones_dark.zig b/core/themes/seoulbones_dark.zig index 74cdf1ff..8b2c40ce 100644 --- a/core/themes/seoulbones_dark.zig +++ b/core/themes/seoulbones_dark.zig @@ -18,63 +18,67 @@ //! it inherits Normal. TabLine links to StatusLine, TabLineFill to //! StatusLineNC. Accent is the lualine normal-mode a bg, a muted neutral (the //! theme is contrast-based, not hue-accented). Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #919191 -> #cdcdcd: 1.53:1 on the focused tag, now 3.03:1 (R6: 3:1) +//! - unsaved grip #97bdde -> #aad1f2: 3.78:1 on the tag, now 4.65:1 (R6: 3:1 on both tags) +//! - selection text #dddddd -> #060606: 3.30:1 on the selection, now 4.52:1 (R7: 4.5:1) +//! - search hit #8283ad -> #7c5b34: 2.41:1 off the page, now 1.41:1 (R8: 1.5:1, the text reading on it) +//! - error #e388a3 -> #fd9fba: 3.45:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) +//! - info #97bdde -> #99bfe0: 4.42:1 on the page, now 4.52:1 (R9: 4.5:1, told from the text and the others) +//! - hint #a5a6c5 -> #9ec49f: 3.68:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "seoulbones_dark", // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:33 Normal guibg - .bg = .{ 0x4b, 0x4b, 0x4b }, + .page = .{ 0x4b, 0x4b, 0x4b }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:33 Normal guifg - .fg = .{ 0xdd, 0xdd, 0xdd }, + .text = .{ 0xdd, 0xdd, 0xdd }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:213 Visual guibg - .sel_bg = .{ 0x77, 0x77, 0x77 }, + .selection = .{ 0x77, 0x77, 0x77 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xdd, 0xdd, 0xdd }, + .selection_text = .{ 0xdd, 0xdd, 0xdd }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:200 StatusLineNC guibg - .tag_bg = .{ 0x55, 0x55, 0x55 }, + .tag = .{ 0x55, 0x55, 0x55 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:200 StatusLineNC guifg - .tag_fg = .{ 0xe5, 0xe5, 0xe5 }, + .tag_text = .{ 0xe5, 0xe5, 0xe5 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:197 StatusLine guibg #5e5e5e, adjusted - .tag_active_bg = .{ 0x72, 0x72, 0x72 }, + .tag_focus = .{ 0x72, 0x72, 0x72 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:197 StatusLine guifg #dddddd, adjusted - .tag_active_fg = .{ 0xf8, 0xf8, 0xf8 }, + .tag_focus_text = .{ 0xf8, 0xf8, 0xf8 }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/seoulbones_dark_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0x91, 0x91, 0x91 }, - // derived: the grip at rest, the accent #797979 faded toward the unfocused tag #555555 as far as 1.6:1 off it (0.88 of the way) - .box_dim = .{ 0x75, 0x75, 0x75 }, + .accent = .{ 0x91, 0x91, 0x91 }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:41 Changed guifg - .box_dirty = .{ 0x97, 0xbd, 0xde }, + .dirty = .{ 0x97, 0xbd, 0xde }, // derived: the column grip, the original's function colour, ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:122 Function guifg - .column_box = .{ 0xdf, 0xdf, 0xc1 }, + .column_grip = .{ 0xdf, 0xdf, 0xc1 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:150 Keyword guifg - .kw = .{ 0xdc, 0x8c, 0xa3 }, + .keyword = .{ 0xdc, 0x8c, 0xa3 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:203 String guifg - .str = .{ 0xab, 0xc4, 0xdb }, + .string = .{ 0xab, 0xc4, 0xdb }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:166 Number guifg - .num = .{ 0xf7, 0xe0, 0xb3 }, + .number = .{ 0xf7, 0xe0, 0xb3 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:47 Comment guifg .comment = .{ 0x71, 0x98, 0x71 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:152 LineNr guifg - .lineno = .{ 0x86, 0x86, 0x86 }, + .line_number = .{ 0x86, 0x86, 0x86 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:62 CursorLineNr guifg - .lineno_active = .{ 0xdd, 0xdd, 0xdd }, + .line_number_current = .{ 0xdd, 0xdd, 0xdd }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:169 PmenuSbar guibg - .scroll_track = .{ 0x81, 0x81, 0x81 }, + .rail = .{ 0x81, 0x81, 0x81 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:171 PmenuThumb guibg #a0a0a0, adjusted - .scroll_thumb = .{ 0xa1, 0xa1, 0xa1 }, + .rail_thumb = .{ 0xa1, 0xa1, 0xa1 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:220 WinSeparator guifg - .border = .{ 0x86, 0x86, 0x86 }, + .rule = .{ 0x86, 0x86, 0x86 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:175 Search guibg - .search_bg = .{ 0x82, 0x83, 0xad }, - // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:175 Search guifg - .search_fg = .{ 0xdd, 0xdd, 0xdd }, + .hit = .{ 0x82, 0x83, 0xad }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:113 Error guifg via DiagnosticError->Error (link :114) - .diagnostic_error = .{ 0xe3, 0x88, 0xa3 }, + .@"error" = .{ 0xe3, 0x88, 0xa3 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:214 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :215) - .diagnostic_warning = .{ 0xff, 0xdf, 0x9b }, + .warning = .{ 0xff, 0xdf, 0x9b }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:72 DiagnosticInfo guifg - .diagnostic_info = .{ 0x97, 0xbd, 0xde }, + .info = .{ 0x97, 0xbd, 0xde }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:67 DiagnosticHint guifg - .diagnostic_hint = .{ 0xa5, 0xa6, 0xc5 }, - .palette = .{ + .hint = .{ 0xa5, 0xa6, 0xc5 }, + .ansi = .{ .{ 0x4b, 0x4b, 0x4b }, // 0: ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:17 g:terminal_color_0 .{ 0xe3, 0x88, 0xa3 }, // 1: ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:18 g:terminal_color_1 .{ 0x98, 0xbd, 0x99 }, // 2: ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:19 g:terminal_color_2 diff --git a/core/themes/seoulbones_light.zig b/core/themes/seoulbones_light.zig index 7b897be5..b509996c 100644 --- a/core/themes/seoulbones_light.zig +++ b/core/themes/seoulbones_light.zig @@ -18,63 +18,68 @@ //! it inherits Normal. TabLine links to StatusLine, TabLineFill to //! StatusLineNC. Accent is the lualine normal-mode a bg, a muted neutral (the //! theme is contrast-based, not hue-accented). Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #999999 -> #676767: 1.52:1 on the focused tag, now 3.01:1 (R6: 3:1) +//! - unsaved grip #0084a3 -> #07708a: 2.93:1 on the tag, now 3.84:1 (R6: 3:1 on both tags) +//! - selection #cccccc -> #cbcbcb: 1.24:1 off the page, now 1.25:1 (R7) +//! - search hit #cbb1ca -> #ffba94: 1.52:1 off the page, now 1.28:1 (R8: 1.5:1, the text reading on it) +//! - error #dc5284 -> #b72e65: 2.90:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) +//! - warning #c48562 -> #915634: 2.36:1 on the page, now 4.52:1 (R9: 4.5:1, told from the text and the others) +//! - info #0084a3 -> #026e88: 3.36:1 on the page, now 4.52:1 (R9: 4.5:1, told from the text and the others) +//! - hint #896788 -> #7b5a7a: 3.72:1 on the page, now 4.52:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "seoulbones_light", // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:269 Normal guibg - .bg = .{ 0xe2, 0xe2, 0xe2 }, + .page = .{ 0xe2, 0xe2, 0xe2 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:269 Normal guifg - .fg = .{ 0x55, 0x55, 0x55 }, + .text = .{ 0x55, 0x55, 0x55 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:449 Visual guibg - .sel_bg = .{ 0xcc, 0xcc, 0xcc }, + .selection = .{ 0xcc, 0xcc, 0xcc }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x55, 0x55, 0x55 }, + .selection_text = .{ 0x55, 0x55, 0x55 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:436 StatusLineNC guibg - .tag_bg = .{ 0xd4, 0xd4, 0xd4 }, + .tag = .{ 0xd4, 0xd4, 0xd4 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:436 StatusLineNC guifg #818181, adjusted - .tag_fg = .{ 0x5a, 0x5a, 0x5a }, + .tag_text = .{ 0x5a, 0x5a, 0x5a }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:433 StatusLine guibg #c4c4c4, adjusted - .tag_active_bg = .{ 0xbd, 0xbd, 0xbd }, + .tag_focus = .{ 0xbd, 0xbd, 0xbd }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:433 StatusLine guifg #555555, adjusted - .tag_active_fg = .{ 0x4b, 0x4b, 0x4b }, + .tag_focus_text = .{ 0x4b, 0x4b, 0x4b }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/seoulbones_light_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0x99, 0x99, 0x99 }, - // derived: the grip at rest, the accent #a6a6a6 faded toward the unfocused tag #d4d4d4 as far as 1.6:1 off it (0.98 of the way) - .box_dim = .{ 0xa7, 0xa7, 0xa7 }, + .accent = .{ 0x99, 0x99, 0x99 }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:277 Changed guifg - .box_dirty = .{ 0x00, 0x84, 0xa3 }, + .dirty = .{ 0x00, 0x84, 0xa3 }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:445 Type guifg - .column_box = .{ 0x6d, 0x4c, 0x52 }, + .column_grip = .{ 0x6d, 0x4c, 0x52 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:386 Keyword guifg - .kw = .{ 0xca, 0x62, 0x84 }, + .keyword = .{ 0xca, 0x62, 0x84 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:439 String guifg - .str = .{ 0x4a, 0x75, 0x87 }, + .string = .{ 0x4a, 0x75, 0x87 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:402 Number guifg - .num = .{ 0x89, 0x65, 0x00 }, + .number = .{ 0x89, 0x65, 0x00 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:283 Comment guifg .comment = .{ 0x62, 0x85, 0x62 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:388 LineNr guifg - .lineno = .{ 0x91, 0x91, 0x91 }, + .line_number = .{ 0x91, 0x91, 0x91 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:298 CursorLineNr guifg - .lineno_active = .{ 0x55, 0x55, 0x55 }, + .line_number_current = .{ 0x55, 0x55, 0x55 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:405 PmenuSbar guibg - .scroll_track = .{ 0x9e, 0x9e, 0x9e }, + .rail = .{ 0x9e, 0x9e, 0x9e }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:407 PmenuThumb guibg - .scroll_thumb = .{ 0xf3, 0xf3, 0xf3 }, + .rail_thumb = .{ 0xf3, 0xf3, 0xf3 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:456 WinSeparator guifg - .border = .{ 0x91, 0x91, 0x91 }, + .rule = .{ 0x91, 0x91, 0x91 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:411 Search guibg - .search_bg = .{ 0xcb, 0xb1, 0xca }, - // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:411 Search guifg - .search_fg = .{ 0x55, 0x55, 0x55 }, + .hit = .{ 0xcb, 0xb1, 0xca }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:349 Error guifg via DiagnosticError->Error (link :350) - .diagnostic_error = .{ 0xdc, 0x52, 0x84 }, + .@"error" = .{ 0xdc, 0x52, 0x84 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:450 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :451) - .diagnostic_warning = .{ 0xc4, 0x85, 0x62 }, + .warning = .{ 0xc4, 0x85, 0x62 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:308 DiagnosticInfo guifg - .diagnostic_info = .{ 0x00, 0x84, 0xa3 }, + .info = .{ 0x00, 0x84, 0xa3 }, // ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:303 DiagnosticHint guifg - .diagnostic_hint = .{ 0x89, 0x67, 0x88 }, - .palette = .{ + .hint = .{ 0x89, 0x67, 0x88 }, + .ansi = .{ .{ 0xe2, 0xe2, 0xe2 }, // 0: ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:253 g:terminal_color_0 .{ 0xdc, 0x52, 0x84 }, // 1: ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:254 g:terminal_color_1 .{ 0x62, 0x85, 0x62 }, // 2: ~/05-genizah/zenbones.nvim/colors/seoulbones.vim:255 g:terminal_color_2 diff --git a/core/themes/sepia.zig b/core/themes/sepia.zig new file mode 100644 index 00000000..06cf96c1 --- /dev/null +++ b/core/themes/sepia.zig @@ -0,0 +1,30 @@ +//! pardes sepia: long reading by daylight (DESIGN.md part D). Warm paper, +//! brown-black ink, earth hues, a calm comment that still reads 5.9:1, and a +//! cool grey-blue selection so the hits keep their amber. For prose, docs and +//! PDFs side by side, and long sessions where white paper glares. +pub const theme = .{ + .name = "sepia", + .page = .{ 0xf4, 0xec, 0xdb }, + .text = .{ 0x3a, 0x2e, 0x22 }, + .tag = .{ 0xe6, 0xd8, 0xba }, + .tag_text = .{ 0x4b, 0x3d, 0x2b }, + .accent = .{ 0xa0, 0x56, 0x2a }, + .selection = .{ 0xc9, 0xd4, 0xdc }, + .selection_text = .{ 0x23, 0x1a, 0x10 }, + .keyword = .{ 0x94, 0x35, 0x1c }, + .string = .{ 0x4c, 0x6a, 0x1f }, + .number = .{ 0x7b, 0x4b, 0x9a }, + .comment = .{ 0x6a, 0x57, 0x3e }, + .line_number = .{ 0xa8, 0x98, 0x7c }, + .line_number_current = .{ 0x76, 0x65, 0x4b }, + .@"error" = .{ 0xb3, 0x26, 0x1e }, + .warning = .{ 0x8a, 0x5a, 0x00 }, + .info = .{ 0x2f, 0x5f, 0x8f }, + .hint = .{ 0x3f, 0x6f, 0x5f }, + .ansi = .{ + .{ 0xe6, 0xd8, 0xba }, .{ 0xb3, 0x26, 0x1e }, .{ 0x4c, 0x6a, 0x1f }, .{ 0x8a, 0x5a, 0x00 }, + .{ 0x2f, 0x5f, 0x8f }, .{ 0x7b, 0x4b, 0x9a }, .{ 0x2f, 0x6f, 0x6a }, .{ 0x5a, 0x4a, 0x36 }, + .{ 0x7a, 0x68, 0x4b }, .{ 0xc1, 0x39, 0x28 }, .{ 0x52, 0x75, 0x17 }, .{ 0x8f, 0x60, 0x00 }, + .{ 0x36, 0x6d, 0xa2 }, .{ 0x88, 0x54, 0xa7 }, .{ 0x29, 0x76, 0x71 }, .{ 0x23, 0x1a, 0x10 }, + }, +}; diff --git a/core/themes/solarium.zig b/core/themes/solarium.zig index 316113eb..cbc5df96 100644 --- a/core/themes/solarium.zig +++ b/core/themes/solarium.zig @@ -4,36 +4,32 @@ //! Pardes-specific tag, search, diagnostic and ANSI roles; see docs/typ/themes.typ. pub const theme = .{ .name = "solarium", - .bg = .{ 0x17, 0x3e, 0x45 }, - .fg = .{ 0xa7, 0xb7, 0xae }, - .tag_bg = .{ 0x12, 0x3f, 0x43 }, - .tag_fg = .{ 0xc7, 0xd4, 0xbd }, - .tag_name_fg = .{ 0xe9, 0xc1, 0xe0 }, - .tag_active_name_fg = .{ 0xf5, 0xcd, 0xec }, - .tag_active_bg = .{ 0x21, 0x4e, 0x50 }, - .tag_active_fg = .{ 0xd3, 0xe0, 0xc9 }, - .box = .{ 0xe1, 0xc2, 0x66 }, - .box_dim = .{ 0x46, 0x7f, 0x76 }, - .column_box = .{ 0x5c, 0xb1, 0xeb }, - .column_box_dim = .{ 0x34, 0x7a, 0x9a }, - .kw = .{ 0x56, 0xb2, 0xf1 }, - .str = .{ 0xbd, 0xd0, 0x3f }, - .num = .{ 0xef, 0x99, 0x48 }, + .page = .{ 0x17, 0x3e, 0x45 }, + .text = .{ 0xa7, 0xb7, 0xae }, + .tag = .{ 0x12, 0x3f, 0x43 }, + .tag_text = .{ 0xc7, 0xd4, 0xbd }, + .tag_name = .{ 0xe9, 0xc1, 0xe0 }, + .tag_focus = .{ 0x21, 0x4e, 0x50 }, + .tag_focus_text = .{ 0xd3, 0xe0, 0xc9 }, + .accent = .{ 0xe1, 0xc2, 0x66 }, + .column_grip = .{ 0x5c, 0xb1, 0xeb }, + .keyword = .{ 0x56, 0xb2, 0xf1 }, + .string = .{ 0xbd, 0xd0, 0x3f }, + .number = .{ 0xef, 0x99, 0x48 }, .comment = .{ 0xf6, 0xce, 0x5a }, - .lineno = .{ 0x64, 0x7e, 0x7c }, - .lineno_active = .{ 0x6c, 0x86, 0x84 }, - .scroll_track = .{ 0x1c, 0x45, 0x4c }, - .scroll_thumb = .{ 0x65, 0x97, 0x8c }, - .border = .{ 0x4c, 0x88, 0x80 }, - .sel_bg = .{ 0x1f, 0x5c, 0x64 }, - .sel_fg = .{ 0xee, 0xe8, 0xd5 }, - .search_bg = .{ 0x6d, 0x57, 0x1d }, - .search_fg = .{ 0xff, 0xf0, 0xb9 }, - .diagnostic_error = .{ 0xff, 0x7a, 0x6a }, - .diagnostic_warning = .{ 0xf3, 0xbe, 0x47 }, - .diagnostic_info = .{ 0x59, 0xb1, 0xee }, - .diagnostic_hint = .{ 0x5c, 0xca, 0xb9 }, - .palette = .{ + .line_number = .{ 0x64, 0x7e, 0x7c }, + .line_number_current = .{ 0x6c, 0x86, 0x84 }, + .rail = .{ 0x1c, 0x45, 0x4c }, + .rail_thumb = .{ 0x65, 0x97, 0x8c }, + .rule = .{ 0x4c, 0x88, 0x80 }, + .selection = .{ 0x1f, 0x5c, 0x64 }, + .selection_text = .{ 0xee, 0xe8, 0xd5 }, + .hit = .{ 0x6d, 0x57, 0x1d }, + .@"error" = .{ 0xff, 0x7a, 0x6a }, + .warning = .{ 0xf3, 0xbe, 0x47 }, + .info = .{ 0x59, 0xb1, 0xee }, + .hint = .{ 0x5c, 0xca, 0xb9 }, + .ansi = .{ .{ 0x17, 0x3e, 0x45 }, .{ 0xed, 0x84, 0x77 }, .{ 0xaf, 0xbd, 0x52 }, diff --git a/core/themes/solarized_dark.zig b/core/themes/solarized_dark.zig index c7c43892..e013a060 100644 --- a/core/themes/solarized_dark.zig +++ b/core/themes/solarized_dark.zig @@ -10,57 +10,60 @@ //! - focused grip #268bd2 -> #2483c5: 1.38:1 on the focused tag #93a1a1 //! Upstream notes: green is the canonical #859900 (README), not //! solarized.vim:261's "experimental" #719e07. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #2483c5 -> #025384: 1.53:1 on the focused tag, now 3.05:1 (R6: 3:1) +//! - unsaved grip #b58900 -> #3e2c00: 1.39:1 on the tag, now 3.01:1 (R6: 3:1 on both tags) +//! - selection text #002b36 -> #cbf2ff: 2.79:1 on the selection, now 4.53:1 (R7: 4.5:1) +//! - error #dc322f -> #f95148: 3.25:1 on the page, now 4.50:1 (R9: 4.5:1, told from the text and the others) +//! - warning #dc322f -> #b58900: 3.25:1 on the page, now 4.68:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "solarized_dark", // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:539 Normal bg_back: base03 = ~/05-genizah/solarized/README.md:354 base03 - .bg = .{ 0x00, 0x2b, 0x36 }, + .page = .{ 0x00, 0x2b, 0x36 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:539 Normal fg: base0 = ~/05-genizah/solarized/README.md:358 base0 - .fg = .{ 0x83, 0x94, 0x96 }, + .text = .{ 0x83, 0x94, 0x96 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:614 Visual fg_base01 reversed: base01 = ~/05-genizah/solarized/README.md:356 base01 - .sel_bg = .{ 0x58, 0x6e, 0x75 }, + .selection = .{ 0x58, 0x6e, 0x75 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:614 Visual bg_base03 reversed: base03 = ~/05-genizah/solarized/README.md:354 base03 - .sel_fg = .{ 0x00, 0x2b, 0x36 }, + .selection_text = .{ 0x00, 0x2b, 0x36 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:613 StatusLineNC fg_base00 reversed: base00 = ~/05-genizah/solarized/README.md:357 base00 - .tag_bg = .{ 0x65, 0x7b, 0x83 }, + .tag = .{ 0x65, 0x7b, 0x83 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:613 StatusLineNC bg_base02 reversed: base02 = ~/05-genizah/solarized/README.md:355 base02 #073642, adjusted - .tag_fg = .{ 0x01, 0x09, 0x0b }, + .tag_text = .{ 0x01, 0x09, 0x0b }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:612 StatusLine fg_base1 reversed: base1 = ~/05-genizah/solarized/README.md:359 base1 - .tag_active_bg = .{ 0x93, 0xa1, 0xa1 }, + .tag_focus = .{ 0x93, 0xa1, 0xa1 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:612 StatusLine bg_base02 reversed: base02 = ~/05-genizah/solarized/README.md:355 base02 - .tag_active_fg = .{ 0x07, 0x36, 0x42 }, + .tag_focus_text = .{ 0x07, 0x36, 0x42 }, // the focused grip: no UI accent in solarized.vim; Identifier blue, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:552 Identifier: blue = ~/05-genizah/solarized/README.md:367 blue - .box = .{ 0x24, 0x83, 0xc5 }, - // derived: the grip at rest, the accent #268bd2 faded toward the unfocused tag #657b83 as far as 1.6:1 off it (1.00 of the way) - .box_dim = .{ 0x18, 0x59, 0x86 }, + .accent = .{ 0x24, 0x83, 0xc5 }, // an unsaved grip: the original's modified colour, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:636 DiffChange fg_yellow: yellow = ~/05-genizah/solarized/README.md:362 yellow - .box_dirty = .{ 0xb5, 0x89, 0x00 }, + .dirty = .{ 0xb5, 0x89, 0x00 }, // derived: the column grip, the original's keyword colour, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:556 Statement fg (Keyword links to Statement): green = ~/05-genizah/solarized/README.md:369 green - .column_box = .{ 0x85, 0x99, 0x00 }, + .column_grip = .{ 0x85, 0x99, 0x00 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:556 Statement fg (Keyword links to Statement): green = ~/05-genizah/solarized/README.md:369 green - .kw = .{ 0x85, 0x99, 0x00 }, + .keyword = .{ 0x85, 0x99, 0x00 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:544 Constant fg (String links to Constant): cyan = ~/05-genizah/solarized/README.md:368 cyan - .str = .{ 0x2a, 0xa1, 0x98 }, + .string = .{ 0x2a, 0xa1, 0x98 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:544 Constant fg (Number links to Constant): cyan = ~/05-genizah/solarized/README.md:368 cyan - .num = .{ 0x2a, 0xa1, 0x98 }, + .number = .{ 0x2a, 0xa1, 0x98 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:541 Comment fg: base01 = ~/05-genizah/solarized/README.md:356 base01 .comment = .{ 0x58, 0x6e, 0x75 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:621 LineNr fg: base01 = ~/05-genizah/solarized/README.md:356 base01 - .lineno = .{ 0x58, 0x6e, 0x75 }, + .line_number = .{ 0x58, 0x6e, 0x75 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:665 PmenuSbar fg_base2 reversed: base2 = ~/05-genizah/solarized/README.md:360 base2 - .scroll_track = .{ 0xee, 0xe8, 0xd5 }, + .rail = .{ 0xee, 0xe8, 0xd5 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:666 PmenuThumb fg_base0 reversed: base0 = ~/05-genizah/solarized/README.md:358 base0 - .scroll_thumb = .{ 0x83, 0x94, 0x96 }, + .rail_thumb = .{ 0x83, 0x94, 0x96 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:624 VertSplit fg_base00 bg_base00: base00 = ~/05-genizah/solarized/README.md:357 base00 - .border = .{ 0x65, 0x7b, 0x83 }, - // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:618 Search fg_yellow reversed: yellow = ~/05-genizah/solarized/README.md:362 yellow - .search_bg = .{ 0xb5, 0x89, 0x00 }, - // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:618 Search bg_none reversed: the page: base03 = ~/05-genizah/solarized/README.md:354 base03 - .search_fg = .{ 0x00, 0x2b, 0x36 }, + .rule = .{ 0x65, 0x7b, 0x83 }, + // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:618 Search fg_yellow reversed: yellow = ~/05-genizah/solarized/README.md:362 yellow #b58900, adjusted + // adjusted: search hit #b58900 -> #1d180e: the original reverses yellow under base03 ink; pardes keeps the text's own ink on a hit, which reads 1.02:1 on #b58900; its yellow a ground 1.18:1 off the page, 0.09 OKLab, the text 5.58:1 on it (DESIGN.md R0, R8) + .hit = .{ 0x1d, 0x18, 0x0e }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:592 Error fg: red = ~/05-genizah/solarized/README.md:364 red - .diagnostic_error = .{ 0xdc, 0x32, 0x2f }, + .@"error" = .{ 0xdc, 0x32, 0x2f }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:630 WarningMsg fg: red = ~/05-genizah/solarized/README.md:364 red - .diagnostic_warning = .{ 0xdc, 0x32, 0x2f }, - .palette = .{ + .warning = .{ 0xdc, 0x32, 0x2f }, + .ansi = .{ .{ 0x07, 0x36, 0x42 }, // 0: ~/05-genizah/solarized/README.md:355 base02 ANSI 0 (README TERMCOL column) .{ 0xdc, 0x32, 0x2f }, // 1: ~/05-genizah/solarized/README.md:364 red ANSI 1 (README TERMCOL column) .{ 0x85, 0x99, 0x00 }, // 2: ~/05-genizah/solarized/README.md:369 green ANSI 2 (README TERMCOL column) diff --git a/core/themes/solarized_light.zig b/core/themes/solarized_light.zig index 124d6d59..801c1693 100644 --- a/core/themes/solarized_light.zig +++ b/core/themes/solarized_light.zig @@ -11,57 +11,61 @@ //! - focused grip #268bd2 -> #2f90d4: 1.46:1 on the focused tag #586e75 //! Upstream notes: green is the canonical #859900 (README), not //! solarized.vim:261's "experimental" #719e07. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused tag ground #586e75 -> #728284: 1.70:1 off the tag, now 1.27:1 (R4, H: a focus step off the tag, and the loudest) +//! - focused grip #2f90d4 -> #00395e: 1.16:1 on the focused tag, now 3.00:1 (R6: 3:1) +//! - unsaved grip #b58900 -> #473300: 1.02:1 on the tag, now 3.81:1 (R6: 3:1 on both tags) +//! - selection text #fdf6e3 -> #3b3526: 2.48:1 on the selection, now 4.56:1 (R7: 4.5:1) +//! - error #dc322f -> #d72c2b: 4.29:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) +//! - warning #dc322f -> #8e6c07: 4.29:1 on the page, now 4.53:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "solarized_light", // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:539 Normal bg_back: base03 = ~/05-genizah/solarized/README.md:361 base3 (swapped for background=light, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:379-391) - .bg = .{ 0xfd, 0xf6, 0xe3 }, + .page = .{ 0xfd, 0xf6, 0xe3 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:539 Normal fg: base0 = ~/05-genizah/solarized/README.md:357 base00 (swapped for background=light, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:379-391) - .fg = .{ 0x65, 0x7b, 0x83 }, + .text = .{ 0x65, 0x7b, 0x83 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:614 Visual fg_base01 reversed: base01 = ~/05-genizah/solarized/README.md:359 base1 (swapped for background=light, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:379-391) - .sel_bg = .{ 0x93, 0xa1, 0xa1 }, + .selection = .{ 0x93, 0xa1, 0xa1 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:614 Visual bg_base03 reversed: base03 = ~/05-genizah/solarized/README.md:361 base3 (swapped for background=light, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:379-391) - .sel_fg = .{ 0xfd, 0xf6, 0xe3 }, + .selection_text = .{ 0xfd, 0xf6, 0xe3 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:613 StatusLineNC fg_base00 reversed: base00 = ~/05-genizah/solarized/README.md:358 base0 (swapped for background=light, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:379-391) - .tag_bg = .{ 0x83, 0x94, 0x96 }, + .tag = .{ 0x83, 0x94, 0x96 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:613 StatusLineNC bg_base02 reversed: base02 = ~/05-genizah/solarized/README.md:360 base2 (swapped for background=light, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:379-391) #eee8d5, adjusted - .tag_fg = .{ 0x2b, 0x2a, 0x26 }, + .tag_text = .{ 0x2b, 0x2a, 0x26 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:612 StatusLine fg_base1 reversed: base1 = ~/05-genizah/solarized/README.md:356 base01 (swapped for background=light, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:379-391) - .tag_active_bg = .{ 0x58, 0x6e, 0x75 }, + .tag_focus = .{ 0x58, 0x6e, 0x75 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:612 StatusLine bg_base02 reversed: base02 = ~/05-genizah/solarized/README.md:360 base2 (swapped for background=light, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:379-391) #eee8d5, adjusted - .tag_active_fg = .{ 0xf0, 0xeb, 0xda }, + .tag_focus_text = .{ 0xf0, 0xeb, 0xda }, // the focused grip: no UI accent in solarized.vim; Identifier blue, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:552 Identifier: blue = ~/05-genizah/solarized/README.md:367 blue - .box = .{ 0x2f, 0x90, 0xd4 }, - // derived: the grip at rest, the accent #268bd2 faded toward the unfocused tag #839496 as far as 1.6:1 off it (1.00 of the way) - .box_dim = .{ 0x1f, 0x72, 0xac }, + .accent = .{ 0x2f, 0x90, 0xd4 }, // an unsaved grip: the original's modified colour, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:636 DiffChange fg_yellow: yellow = ~/05-genizah/solarized/README.md:362 yellow - .box_dirty = .{ 0xb5, 0x89, 0x00 }, + .dirty = .{ 0xb5, 0x89, 0x00 }, // derived: the column grip, the original's keyword colour, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:556 Statement fg (Keyword links to Statement): green = ~/05-genizah/solarized/README.md:369 green - .column_box = .{ 0x85, 0x99, 0x00 }, + .column_grip = .{ 0x85, 0x99, 0x00 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:556 Statement fg (Keyword links to Statement): green = ~/05-genizah/solarized/README.md:369 green - .kw = .{ 0x85, 0x99, 0x00 }, + .keyword = .{ 0x85, 0x99, 0x00 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:544 Constant fg (String links to Constant): cyan = ~/05-genizah/solarized/README.md:368 cyan - .str = .{ 0x2a, 0xa1, 0x98 }, + .string = .{ 0x2a, 0xa1, 0x98 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:544 Constant fg (Number links to Constant): cyan = ~/05-genizah/solarized/README.md:368 cyan - .num = .{ 0x2a, 0xa1, 0x98 }, + .number = .{ 0x2a, 0xa1, 0x98 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:541 Comment fg: base01 = ~/05-genizah/solarized/README.md:359 base1 (swapped for background=light, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:379-391) .comment = .{ 0x93, 0xa1, 0xa1 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:621 LineNr fg: base01 = ~/05-genizah/solarized/README.md:359 base1 (swapped for background=light, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:379-391) - .lineno = .{ 0x93, 0xa1, 0xa1 }, + .line_number = .{ 0x93, 0xa1, 0xa1 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:665 PmenuSbar fg_base2 reversed: base2 = ~/05-genizah/solarized/README.md:355 base02 (swapped for background=light, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:379-391) - .scroll_track = .{ 0x07, 0x36, 0x42 }, + .rail = .{ 0x07, 0x36, 0x42 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:666 PmenuThumb fg_base0 reversed: base0 = ~/05-genizah/solarized/README.md:357 base00 (swapped for background=light, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:379-391) - .scroll_thumb = .{ 0x65, 0x7b, 0x83 }, + .rail_thumb = .{ 0x65, 0x7b, 0x83 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:624 VertSplit fg_base00 bg_base00: base00 = ~/05-genizah/solarized/README.md:358 base0 (swapped for background=light, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:379-391) - .border = .{ 0x83, 0x94, 0x96 }, + .rule = .{ 0x83, 0x94, 0x96 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:618 Search fg_yellow reversed: yellow = ~/05-genizah/solarized/README.md:362 yellow - .search_bg = .{ 0xb5, 0x89, 0x00 }, - // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:618 Search bg_none reversed: the page: base03 = ~/05-genizah/solarized/README.md:361 base3 (swapped for background=light, ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:379-391) - .search_fg = .{ 0xfd, 0xf6, 0xe3 }, + // adjusted: search hit #b58900 -> #ffeb99: the original reverses yellow under base3 ink; pardes keeps the text's own ink on a hit, which reads 1.39:1 on #b58900; its yellow a ground 1.11:1 off the page, 0.09 OKLab, the text 3.73:1 on it (its own is 4.13:1; DESIGN.md R0, R8) + .hit = .{ 0xff, 0xeb, 0x99 }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:592 Error fg: red = ~/05-genizah/solarized/README.md:364 red - .diagnostic_error = .{ 0xdc, 0x32, 0x2f }, + .@"error" = .{ 0xdc, 0x32, 0x2f }, // ~/05-genizah/solarized/vim-colors-solarized/colors/solarized.vim:630 WarningMsg fg: red = ~/05-genizah/solarized/README.md:364 red - .diagnostic_warning = .{ 0xdc, 0x32, 0x2f }, - .palette = .{ + .warning = .{ 0xdc, 0x32, 0x2f }, + .ansi = .{ .{ 0x07, 0x36, 0x42 }, // 0: ~/05-genizah/solarized/README.md:355 base02 ANSI 0 (README TERMCOL column) .{ 0xdc, 0x32, 0x2f }, // 1: ~/05-genizah/solarized/README.md:364 red ANSI 1 (README TERMCOL column) .{ 0x85, 0x99, 0x00 }, // 2: ~/05-genizah/solarized/README.md:369 green ANSI 2 (README TERMCOL column) diff --git a/core/themes/spectrum.zig b/core/themes/spectrum.zig index f7c25c3d..cb95fe87 100644 --- a/core/themes/spectrum.zig +++ b/core/themes/spectrum.zig @@ -4,36 +4,32 @@ //! Pardes-specific tag, search, diagnostic and ANSI roles; see docs/typ/themes.typ. pub const theme = .{ .name = "spectrum", - .bg = .{ 0x10, 0x0e, 0x11 }, - .fg = .{ 0xfc, 0xfc, 0xfa }, - .tag_bg = .{ 0x3b, 0x38, 0x30 }, - .tag_fg = .{ 0xdd, 0xd8, 0xbb }, - .tag_name_fg = .{ 0xc5, 0xd7, 0xff }, - .tag_active_name_fg = .{ 0xd7, 0xe3, 0xff }, - .tag_active_bg = .{ 0x4d, 0x47, 0x36 }, - .tag_active_fg = .{ 0xe9, 0xe4, 0xc7 }, - .box = .{ 0xff, 0xd8, 0x66 }, - .box_dim = .{ 0x92, 0x84, 0x4f }, - .column_box = .{ 0xa4, 0x92, 0xfd }, - .column_box_dim = .{ 0x70, 0x65, 0x96 }, - .kw = .{ 0xff, 0x61, 0x88 }, - .str = .{ 0xa9, 0xee, 0x64 }, - .num = .{ 0xa2, 0x90, 0xff }, + .page = .{ 0x10, 0x0e, 0x11 }, + .text = .{ 0xfc, 0xfc, 0xfa }, + .tag = .{ 0x3b, 0x38, 0x30 }, + .tag_text = .{ 0xdd, 0xd8, 0xbb }, + .tag_name = .{ 0xc5, 0xd7, 0xff }, + .tag_focus = .{ 0x4d, 0x47, 0x36 }, + .tag_focus_text = .{ 0xe9, 0xe4, 0xc7 }, + .accent = .{ 0xff, 0xd8, 0x66 }, + .column_grip = .{ 0xa4, 0x92, 0xfd }, + .keyword = .{ 0xff, 0x61, 0x88 }, + .string = .{ 0xa9, 0xee, 0x64 }, + .number = .{ 0xa2, 0x90, 0xff }, .comment = .{ 0xff, 0xe0, 0x9b }, - .lineno = .{ 0x68, 0x61, 0x6b }, - .lineno_active = .{ 0x70, 0x69, 0x73 }, - .scroll_track = .{ 0x21, 0x1d, 0x23 }, - .scroll_thumb = .{ 0x94, 0x8d, 0x6f }, - .border = .{ 0x8f, 0x87, 0x6c }, - .sel_bg = .{ 0x51, 0x3f, 0x60 }, - .sel_fg = .{ 0xfc, 0xfc, 0xfa }, - .search_bg = .{ 0x6f, 0x5b, 0x1e }, - .search_fg = .{ 0xff, 0xf0, 0xb0 }, - .diagnostic_error = .{ 0xff, 0x79, 0x9b }, - .diagnostic_warning = .{ 0xff, 0xd8, 0x66 }, - .diagnostic_info = .{ 0x67, 0xe9, 0xf9 }, - .diagnostic_hint = .{ 0xa9, 0xeb, 0x67 }, - .palette = .{ + .line_number = .{ 0x68, 0x61, 0x6b }, + .line_number_current = .{ 0x70, 0x69, 0x73 }, + .rail = .{ 0x21, 0x1d, 0x23 }, + .rail_thumb = .{ 0x94, 0x8d, 0x6f }, + .rule = .{ 0x8f, 0x87, 0x6c }, + .selection = .{ 0x51, 0x3f, 0x60 }, + .selection_text = .{ 0xfc, 0xfc, 0xfa }, + .hit = .{ 0x6f, 0x5b, 0x1e }, + .@"error" = .{ 0xff, 0x79, 0x9b }, + .warning = .{ 0xff, 0xd8, 0x66 }, + .info = .{ 0x67, 0xe9, 0xf9 }, + .hint = .{ 0xa9, 0xeb, 0x67 }, + .ansi = .{ .{ 0x10, 0x0e, 0x11 }, .{ 0xff, 0x79, 0x9b }, .{ 0xa9, 0xdc, 0x76 }, diff --git a/core/themes/tokyobones_dark.zig b/core/themes/tokyobones_dark.zig index 6a05e456..ec33b244 100644 --- a/core/themes/tokyobones_dark.zig +++ b/core/themes/tokyobones_dark.zig @@ -16,63 +16,61 @@ //! only), so it inherits Normal. TabLine links to StatusLine, TabLineFill to //! StatusLineNC. Accent is the lualine normal-mode a bg, a muted neutral (the //! theme is contrast-based, not hue-accented). Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #5b5d76 -> #898ca7: 1.55:1 on the focused tag, now 3.02:1 (R6: 3:1) pub const theme = .{ .name = "tokyobones_dark", // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:33 Normal guibg - .bg = .{ 0x1a, 0x1b, 0x26 }, + .page = .{ 0x1a, 0x1b, 0x26 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:33 Normal guifg - .fg = .{ 0xc0, 0xca, 0xf5 }, + .text = .{ 0xc0, 0xca, 0xf5 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:214 Visual guibg - .sel_bg = .{ 0x2c, 0x40, 0x75 }, + .selection = .{ 0x2c, 0x40, 0x75 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xc0, 0xca, 0xf5 }, + .selection_text = .{ 0xc0, 0xca, 0xf5 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:198 StatusLineNC guibg - .tag_bg = .{ 0x24, 0x25, 0x32 }, + .tag = .{ 0x24, 0x25, 0x32 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:198 StatusLineNC guifg - .tag_fg = .{ 0xd2, 0xd9, 0xf8 }, + .tag_text = .{ 0xd2, 0xd9, 0xf8 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:195 StatusLine guibg #303142, adjusted - .tag_active_bg = .{ 0x40, 0x41, 0x57 }, + .tag_focus = .{ 0x40, 0x41, 0x57 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:195 StatusLine guifg - .tag_active_fg = .{ 0xc0, 0xca, 0xf5 }, + .tag_focus_text = .{ 0xc0, 0xca, 0xf5 }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/tokyobones_dark_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0x5b, 0x5d, 0x76 }, - // derived: the grip at rest, the accent #51536d faded toward the unfocused tag #242532 as far as 1.6:1 off it (0.70 of the way) - .box_dim = .{ 0x44, 0x45, 0x5b }, + .accent = .{ 0x5b, 0x5d, 0x76 }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:41 Changed guifg - .box_dirty = .{ 0x7b, 0xa2, 0xf7 }, + .dirty = .{ 0x7b, 0xa2, 0xf7 }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:210 Type guifg - .column_box = .{ 0x93, 0x94, 0xaa }, + .column_grip = .{ 0x93, 0x94, 0xaa }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:192 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0xbb, 0x9b, 0xf7 }, + .keyword = .{ 0xbb, 0x9b, 0xf7 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:201 String guifg - .str = .{ 0x75, 0x92, 0xea }, + .string = .{ 0x75, 0x92, 0xea }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:164 Number guifg - .num = .{ 0x2b, 0xc4, 0xde }, + .number = .{ 0x2b, 0xc4, 0xde }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:47 Comment guifg .comment = .{ 0x65, 0x67, 0x7d }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:150 LineNr guifg - .lineno = .{ 0x5f, 0x61, 0x7e }, + .line_number = .{ 0x5f, 0x61, 0x7e }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:62 CursorLineNr guifg - .lineno_active = .{ 0xc0, 0xca, 0xf5 }, + .line_number_current = .{ 0xc0, 0xca, 0xf5 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:167 PmenuSbar guibg - .scroll_track = .{ 0x58, 0x5a, 0x76 }, + .rail = .{ 0x58, 0x5a, 0x76 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:169 PmenuThumb guibg - .scroll_thumb = .{ 0x80, 0x82, 0x9b }, + .rail_thumb = .{ 0x80, 0x82, 0x9b }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:221 WinSeparator guifg - .border = .{ 0x5f, 0x61, 0x7e }, + .rule = .{ 0x5f, 0x61, 0x7e }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:173 Search guibg - .search_bg = .{ 0x6e, 0x20, 0xbd }, - // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:173 Search guifg - .search_fg = .{ 0xc0, 0xca, 0xf5 }, + .hit = .{ 0x6e, 0x20, 0xbd }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:113 Error guifg via DiagnosticError->Error (link :114) - .diagnostic_error = .{ 0xf7, 0x78, 0x90 }, + .@"error" = .{ 0xf7, 0x78, 0x90 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:215 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :216) - .diagnostic_warning = .{ 0xe1, 0xb0, 0x68 }, + .warning = .{ 0xe1, 0xb0, 0x68 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:72 DiagnosticInfo guifg - .diagnostic_info = .{ 0x7b, 0xa2, 0xf7 }, + .info = .{ 0x7b, 0xa2, 0xf7 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:67 DiagnosticHint guifg - .diagnostic_hint = .{ 0xbb, 0x9b, 0xf7 }, - .palette = .{ + .hint = .{ 0xbb, 0x9b, 0xf7 }, + .ansi = .{ .{ 0x1a, 0x1b, 0x26 }, // 0: ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:17 g:terminal_color_0 .{ 0xf7, 0x78, 0x90 }, // 1: ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:18 g:terminal_color_1 .{ 0x74, 0xdb, 0xcb }, // 2: ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:19 g:terminal_color_2 diff --git a/core/themes/tokyobones_light.zig b/core/themes/tokyobones_light.zig index f57287ce..9db586e4 100644 --- a/core/themes/tokyobones_light.zig +++ b/core/themes/tokyobones_light.zig @@ -17,63 +17,62 @@ //! only), so it inherits Normal. TabLine links to StatusLine, TabLineFill to //! StatusLineNC. Accent is the lualine normal-mode a bg, a muted neutral (the //! theme is contrast-based, not hue-accented). Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #8f909b -> #5e5f6a: 1.51:1 on the focused tag, now 3.02:1 (R6: 3:1) +//! - warning #8f5e14 -> #845300: 3.87:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "tokyobones_light", // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:271 Normal guibg - .bg = .{ 0xd6, 0xd7, 0xdc }, + .page = .{ 0xd6, 0xd7, 0xdc }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:271 Normal guifg - .fg = .{ 0x33, 0x3a, 0x57 }, + .text = .{ 0x33, 0x3a, 0x57 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:452 Visual guibg - .sel_bg = .{ 0xbb, 0xc0, 0xd8 }, + .selection = .{ 0xbb, 0xc0, 0xd8 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x33, 0x3a, 0x57 }, + .selection_text = .{ 0x33, 0x3a, 0x57 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:436 StatusLineNC guibg - .tag_bg = .{ 0xc8, 0xc9, 0xcf }, + .tag = .{ 0xc8, 0xc9, 0xcf }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:436 StatusLineNC guifg #5f6b9b, adjusted - .tag_fg = .{ 0x4a, 0x53, 0x79 }, + .tag_text = .{ 0x4a, 0x53, 0x79 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:433 StatusLine guibg #b9bbc3, adjusted - .tag_active_bg = .{ 0xb1, 0xb3, 0xbc }, + .tag_focus = .{ 0xb1, 0xb3, 0xbc }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:433 StatusLine guifg - .tag_active_fg = .{ 0x33, 0x3a, 0x57 }, + .tag_focus_text = .{ 0x33, 0x3a, 0x57 }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/tokyobones_light_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0x8f, 0x90, 0x9b }, - // derived: the grip at rest, the accent #9b9da9 faded toward the unfocused tag #c8c9cf as far as 1.6:1 off it (0.98 of the way) - .box_dim = .{ 0x9c, 0x9e, 0xaa }, + .accent = .{ 0x8f, 0x90, 0x9b }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:279 Changed guifg - .box_dirty = .{ 0x34, 0x54, 0x8c }, + .dirty = .{ 0x34, 0x54, 0x8c }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:448 Type guifg - .column_box = .{ 0x48, 0x4f, 0x6b }, + .column_grip = .{ 0x48, 0x4f, 0x6b }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:430 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0x5a, 0x4a, 0x79 }, + .keyword = .{ 0x5a, 0x4a, 0x79 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:439 String guifg - .str = .{ 0x5b, 0x66, 0x94 }, + .string = .{ 0x5b, 0x66, 0x94 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:402 Number guifg - .num = .{ 0x17, 0x67, 0x75 }, + .number = .{ 0x17, 0x67, 0x75 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:285 Comment guifg .comment = .{ 0x7c, 0x7e, 0x89 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:388 LineNr guifg - .lineno = .{ 0x88, 0x8b, 0x99 }, + .line_number = .{ 0x88, 0x8b, 0x99 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:300 CursorLineNr guifg - .lineno_active = .{ 0x33, 0x3a, 0x57 }, + .line_number_current = .{ 0x33, 0x3a, 0x57 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:405 PmenuSbar guibg - .scroll_track = .{ 0x93, 0x95, 0xa2 }, + .rail = .{ 0x93, 0x95, 0xa2 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:407 PmenuThumb guibg - .scroll_thumb = .{ 0xed, 0xee, 0xf0 }, + .rail_thumb = .{ 0xed, 0xee, 0xf0 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:459 WinSeparator guifg - .border = .{ 0x88, 0x8b, 0x99 }, + .rule = .{ 0x88, 0x8b, 0x99 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:411 Search guibg - .search_bg = .{ 0xb3, 0xa9, 0xc9 }, - // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:411 Search guifg - .search_fg = .{ 0x33, 0x3a, 0x57 }, + .hit = .{ 0xb3, 0xa9, 0xc9 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:351 Error guifg via DiagnosticError->Error (link :352) - .diagnostic_error = .{ 0x8b, 0x43, 0x51 }, + .@"error" = .{ 0x8b, 0x43, 0x51 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:453 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :454) - .diagnostic_warning = .{ 0x8f, 0x5e, 0x14 }, + .warning = .{ 0x8f, 0x5e, 0x14 }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:310 DiagnosticInfo guifg - .diagnostic_info = .{ 0x34, 0x54, 0x8c }, + .info = .{ 0x34, 0x54, 0x8c }, // ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:305 DiagnosticHint guifg - .diagnostic_hint = .{ 0x5a, 0x4a, 0x79 }, - .palette = .{ + .hint = .{ 0x5a, 0x4a, 0x79 }, + .ansi = .{ .{ 0xd6, 0xd7, 0xdc }, // 0: ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:255 g:terminal_color_0 .{ 0x8b, 0x43, 0x51 }, // 1: ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:256 g:terminal_color_1 .{ 0x34, 0x64, 0x5d }, // 2: ~/05-genizah/zenbones.nvim/colors/tokyobones.vim:257 g:terminal_color_2 diff --git a/core/themes/tokyonight_day.zig b/core/themes/tokyonight_day.zig index 3d188454..5e0fab0c 100644 --- a/core/themes/tokyonight_day.zig +++ b/core/themes/tokyonight_day.zig @@ -23,63 +23,68 @@ //! computed at run time by Util.invert() of the night palette plus blended //! bg_dark/bg_dark1 (lua/tokyonight/colors/day.lua); all values here come from //! the generated extras for day. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #2e7de9 -> #0e64ce: 2.15:1 on the focused tag, now 3.01:1 (R6: 3:1) +//! - unsaved grip #506d9c -> #4b6897: 3.57:1 on the tag, now 3.84:1 (R6: 3:1 on both tags) +//! - selection text #3760bf -> #234aa7: 3.28:1 on the selection, now 4.50:1 (R7: 4.5:1) +//! - search hit #7890dd -> #fed092: 2.38:1 off the page, now 1.11:1 (R8: 1.5:1, the text reading on it) +//! - error #c64343 -> #b73537: 3.79:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) +//! - warning #8c6c3e -> #7e5f31: 3.75:1 on the page, now 4.55:1 (R9: 4.5:1, told from the text and the others) +//! - info #07879d -> #036f82: 3.27:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) +//! - hint #118c74 -> #07725e: 3.23:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "tokyonight_day", // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:193 Normal guibg - .bg = .{ 0xe1, 0xe2, 0xe7 }, + .page = .{ 0xe1, 0xe2, 0xe7 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:193 Normal guifg - .fg = .{ 0x37, 0x60, 0xbf }, + .text = .{ 0x37, 0x60, 0xbf }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:245 Visual guibg - .sel_bg = .{ 0xb7, 0xc1, 0xe3 }, + .selection = .{ 0xb7, 0xc1, 0xe3 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x37, 0x60, 0xbf }, + .selection_text = .{ 0x37, 0x60, 0xbf }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:220 StatusLineNC guibg - .tag_bg = .{ 0xd0, 0xd5, 0xe3 }, + .tag = .{ 0xd0, 0xd5, 0xe3 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:220 StatusLineNC guifg #a8aecb, adjusted - .tag_fg = .{ 0x57, 0x5a, 0x6a }, + .tag_text = .{ 0x57, 0x5a, 0x6a }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:219 StatusLine guibg #d0d5e3, adjusted - .tag_active_bg = .{ 0xb5, 0xbd, 0xd7 }, + .tag_focus = .{ 0xb5, 0xbd, 0xd7 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:219 StatusLine guifg #6172b0, adjusted - .tag_active_fg = .{ 0x40, 0x4b, 0x74 }, + .tag_focus_text = .{ 0x40, 0x4b, 0x74 }, // the focused grip: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_day.lua:15 blue; lualine normal-mode section a bg = colors.blue per ~/05-genizah/tokyonight.nvim/lua/lualine/themes/_tokyonight.lua:12 (tokyonight-day.lua calls it with style "day") - .box = .{ 0x2e, 0x7d, 0xe9 }, - // derived: the grip at rest, the accent #2e7de9 faded toward the unfocused tag #d0d5e3 as far as 1.6:1 off it (0.50 of the way) - .box_dim = .{ 0x7f, 0xa9, 0xe6 }, + .accent = .{ 0x2e, 0x7d, 0xe9 }, // an unsaved grip: the original's modified colour, ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:254 diffChanged guifg (= palette git.change) - .box_dirty = .{ 0x50, 0x6d, 0x9c }, + .dirty = .{ 0x50, 0x6d, 0x9c }, // derived: the column grip, the original's type colour, ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:228 Type guifg - .column_box = .{ 0x18, 0x80, 0x92 }, + .column_grip = .{ 0x18, 0x80, 0x92 }, // ~/05-genizah/tokyonight.nvim/lua/tokyonight/groups/treesitter.lua:36 ["@keyword"] = c.purple, ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_day.lua:55 purple (vim's regex Keyword is #007197) - .kw = .{ 0x78, 0x47, 0xbd }, + .keyword = .{ 0x78, 0x47, 0xbd }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:221 String guifg - .str = .{ 0x58, 0x75, 0x39 }, + .string = .{ 0x58, 0x75, 0x39 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:27 Constant guifg (Number is not defined by the theme, so Neovim's default link Number->Constant applies) - .num = .{ 0xb1, 0x5c, 0x00 }, + .number = .{ 0xb1, 0x5c, 0x00 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:24 Comment guifg .comment = .{ 0x84, 0x8c, 0xb5 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:91 LineNr guifg - .lineno = .{ 0xa8, 0xae, 0xcb }, + .line_number = .{ 0xa8, 0xae, 0xcb }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:34 CursorLineNr guifg - .lineno_active = .{ 0xb1, 0x5c, 0x00 }, + .line_number_current = .{ 0xb1, 0x5c, 0x00 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:201 PmenuSbar guibg - .scroll_track = .{ 0xc8, 0xcf, 0xe1 }, + .rail = .{ 0xc8, 0xcf, 0xe1 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:203 PmenuThumb guibg #a8aecb, adjusted - .scroll_thumb = .{ 0x9f, 0xa8, 0xca }, + .rail_thumb = .{ 0x9f, 0xa8, 0xca }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:250 WinSeparator guifg - .border = .{ 0xb4, 0xb5, 0xb9 }, + .rule = .{ 0xb4, 0xb5, 0xb9 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:207 Search guibg - .search_bg = .{ 0x78, 0x90, 0xdd }, - // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:207 Search guifg - .search_fg = .{ 0x37, 0x60, 0xbf }, + .hit = .{ 0x78, 0x90, 0xdd }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:36 DiagnosticError guifg - .diagnostic_error = .{ 0xc6, 0x43, 0x43 }, + .@"error" = .{ 0xc6, 0x43, 0x43 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:48 DiagnosticWarn guifg - .diagnostic_warning = .{ 0x8c, 0x6c, 0x3e }, + .warning = .{ 0x8c, 0x6c, 0x3e }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:38 DiagnosticInfo guifg - .diagnostic_info = .{ 0x07, 0x87, 0x9d }, + .info = .{ 0x07, 0x87, 0x9d }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-day.vim:37 DiagnosticHint guifg - .diagnostic_hint = .{ 0x11, 0x8c, 0x74 }, - .palette = .{ + .hint = .{ 0x11, 0x8c, 0x74 }, + .ansi = .{ .{ 0xb4, 0xb5, 0xb9 }, // 0: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_day.lua:61 terminal.black (vim.g.terminal_color_0 per ~/05-genizah/tokyonight.nvim/lua/tokyonight/theme.lua:33-57) .{ 0xf5, 0x2a, 0x65 }, // 1: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_day.lua:71 terminal.red (vim.g.terminal_color_1 per ~/05-genizah/tokyonight.nvim/lua/tokyonight/theme.lua:33-57) .{ 0x58, 0x75, 0x39 }, // 2: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_day.lua:67 terminal.green (vim.g.terminal_color_2 per ~/05-genizah/tokyonight.nvim/lua/tokyonight/theme.lua:33-57) diff --git a/core/themes/tokyonight_moon.zig b/core/themes/tokyonight_moon.zig index 04c1bccc..b96663e7 100644 --- a/core/themes/tokyonight_moon.zig +++ b/core/themes/tokyonight_moon.zig @@ -22,63 +22,63 @@ //! named colours); terminal.* omitted from palette since it is the ansi list. //! ansi matches extras/kitty/tokyonight_moon.conf color0-15. Lowercased from //! upstream uppercase hex: bg_dark1. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #1e2030 -> #1a1c2c: 1.05:1 off the page, now 1.10:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - search hit #3e68d7 -> #543d2d: 3.03:1 off the page, now 1.52:1 (R8: 1.5:1, the text reading on it) +//! - error #c53b53 -> #e85c70: 3.00:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "tokyonight_moon", // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:193 Normal guibg - .bg = .{ 0x22, 0x24, 0x36 }, + .page = .{ 0x22, 0x24, 0x36 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:193 Normal guifg - .fg = .{ 0xc8, 0xd3, 0xf5 }, + .text = .{ 0xc8, 0xd3, 0xf5 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:245 Visual guibg - .sel_bg = .{ 0x2d, 0x3f, 0x76 }, + .selection = .{ 0x2d, 0x3f, 0x76 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xc8, 0xd3, 0xf5 }, + .selection_text = .{ 0xc8, 0xd3, 0xf5 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:220 StatusLineNC guibg - .tag_bg = .{ 0x1e, 0x20, 0x30 }, + .tag = .{ 0x1e, 0x20, 0x30 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:220 StatusLineNC guifg #3b4261, adjusted - .tag_fg = .{ 0x85, 0x8a, 0x9d }, + .tag_text = .{ 0x85, 0x8a, 0x9d }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:219 StatusLine guibg #1e2030, adjusted - .tag_active_bg = .{ 0x3a, 0x3e, 0x56 }, + .tag_focus = .{ 0x3a, 0x3e, 0x56 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:219 StatusLine guifg #828bb8, adjusted - .tag_active_fg = .{ 0xa3, 0xa9, 0xca }, + .tag_focus_text = .{ 0xa3, 0xa9, 0xca }, // the focused grip: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_moon.lua:15 blue; lualine normal-mode section a bg = colors.blue per ~/05-genizah/tokyonight.nvim/lua/lualine/themes/_tokyonight.lua:12 (tokyonight-moon.lua calls it with style "moon") - .box = .{ 0x82, 0xaa, 0xff }, - // derived: the grip at rest, the accent #82aaff faded toward the unfocused tag #1e2030 as far as 1.6:1 off it (0.26 of the way) - .box_dim = .{ 0x38, 0x44, 0x66 }, + .accent = .{ 0x82, 0xaa, 0xff }, // an unsaved grip: the original's warning colour, ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:48 DiagnosticWarn guifg - .box_dirty = .{ 0xff, 0xc7, 0x77 }, + .dirty = .{ 0xff, 0xc7, 0x77 }, // derived: the column grip, the original's string colour, ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:221 String guifg - .column_box = .{ 0xc3, 0xe8, 0x8d }, + .column_grip = .{ 0xc3, 0xe8, 0x8d }, // ~/05-genizah/tokyonight.nvim/lua/tokyonight/groups/treesitter.lua:36 ["@keyword"] = c.purple, ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_moon.lua:55 purple (vim's regex Keyword is #86e1fc) - .kw = .{ 0xfc, 0xa7, 0xea }, + .keyword = .{ 0xfc, 0xa7, 0xea }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:221 String guifg - .str = .{ 0xc3, 0xe8, 0x8d }, + .string = .{ 0xc3, 0xe8, 0x8d }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:27 Constant guifg (Number is not defined by the theme, so Neovim's default link Number->Constant applies) - .num = .{ 0xff, 0x96, 0x6c }, + .number = .{ 0xff, 0x96, 0x6c }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:24 Comment guifg .comment = .{ 0x63, 0x6d, 0xa6 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:91 LineNr guifg - .lineno = .{ 0x3b, 0x42, 0x61 }, + .line_number = .{ 0x3b, 0x42, 0x61 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:34 CursorLineNr guifg - .lineno_active = .{ 0xff, 0x96, 0x6c }, + .line_number_current = .{ 0xff, 0x96, 0x6c }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:201 PmenuSbar guibg - .scroll_track = .{ 0x27, 0x29, 0x3a }, + .rail = .{ 0x27, 0x29, 0x3a }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:203 PmenuThumb guibg #3b4261, adjusted - .scroll_thumb = .{ 0x3e, 0x45, 0x64 }, + .rail_thumb = .{ 0x3e, 0x45, 0x64 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:250 WinSeparator guifg #1b1d2b, adjusted - .border = .{ 0x41, 0x45, 0x57 }, + .rule = .{ 0x41, 0x45, 0x57 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:207 Search guibg - .search_bg = .{ 0x3e, 0x68, 0xd7 }, - // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:207 Search guifg - .search_fg = .{ 0xc8, 0xd3, 0xf5 }, + .hit = .{ 0x3e, 0x68, 0xd7 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:36 DiagnosticError guifg - .diagnostic_error = .{ 0xc5, 0x3b, 0x53 }, + .@"error" = .{ 0xc5, 0x3b, 0x53 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:48 DiagnosticWarn guifg - .diagnostic_warning = .{ 0xff, 0xc7, 0x77 }, + .warning = .{ 0xff, 0xc7, 0x77 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:38 DiagnosticInfo guifg - .diagnostic_info = .{ 0x0d, 0xb9, 0xd7 }, + .info = .{ 0x0d, 0xb9, 0xd7 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-moon.vim:37 DiagnosticHint guifg - .diagnostic_hint = .{ 0x4f, 0xd6, 0xbe }, - .palette = .{ + .hint = .{ 0x4f, 0xd6, 0xbe }, + .ansi = .{ .{ 0x1b, 0x1d, 0x2b }, // 0: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_moon.lua:61 terminal.black (vim.g.terminal_color_0 per ~/05-genizah/tokyonight.nvim/lua/tokyonight/theme.lua:33-57) .{ 0xff, 0x75, 0x7f }, // 1: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_moon.lua:71 terminal.red (vim.g.terminal_color_1 per ~/05-genizah/tokyonight.nvim/lua/tokyonight/theme.lua:33-57) .{ 0xc3, 0xe8, 0x8d }, // 2: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_moon.lua:67 terminal.green (vim.g.terminal_color_2 per ~/05-genizah/tokyonight.nvim/lua/tokyonight/theme.lua:33-57) diff --git a/core/themes/tokyonight_night.zig b/core/themes/tokyonight_night.zig index eeb7e5a5..792b1a25 100644 --- a/core/themes/tokyonight_night.zig +++ b/core/themes/tokyonight_night.zig @@ -20,63 +20,63 @@ //! named colours); terminal.* omitted from palette since it is the ansi list. //! ansi matches extras/kitty/tokyonight_night.conf color0-15. Lowercased from //! upstream uppercase hex: bg_dark1. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #16161e -> #101018: 1.05:1 off the page, now 1.11:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - search hit #3d59a1 -> #4e351d: 2.56:1 off the page, now 1.51:1 (R8: 1.5:1, the text reading on it) +//! - error #db4b4b -> #e25251: 4.17:1 on the page, now 4.52:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "tokyonight_night", // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:193 Normal guibg - .bg = .{ 0x1a, 0x1b, 0x26 }, + .page = .{ 0x1a, 0x1b, 0x26 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:193 Normal guifg - .fg = .{ 0xc0, 0xca, 0xf5 }, + .text = .{ 0xc0, 0xca, 0xf5 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:245 Visual guibg - .sel_bg = .{ 0x28, 0x34, 0x57 }, + .selection = .{ 0x28, 0x34, 0x57 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xc0, 0xca, 0xf5 }, + .selection_text = .{ 0xc0, 0xca, 0xf5 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:220 StatusLineNC guibg - .tag_bg = .{ 0x16, 0x16, 0x1e }, + .tag = .{ 0x16, 0x16, 0x1e }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:220 StatusLineNC guifg #3b4261, adjusted - .tag_fg = .{ 0x7e, 0x82, 0x97 }, + .tag_text = .{ 0x7e, 0x82, 0x97 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:219 StatusLine guibg #16161e, adjusted - .tag_active_bg = .{ 0x36, 0x38, 0x46 }, + .tag_focus = .{ 0x36, 0x38, 0x46 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:219 StatusLine guifg - .tag_active_fg = .{ 0xa9, 0xb1, 0xd6 }, + .tag_focus_text = .{ 0xa9, 0xb1, 0xd6 }, // the focused grip: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_night.lua:15 blue; lualine normal-mode section a bg = colors.blue per ~/05-genizah/tokyonight.nvim/lua/lualine/themes/_tokyonight.lua:12 (tokyonight-night.lua calls it with style "night") - .box = .{ 0x7a, 0xa2, 0xf7 }, - // derived: the grip at rest, the accent #7aa2f7 faded toward the unfocused tag #16161e as far as 1.6:1 off it (0.28 of the way) - .box_dim = .{ 0x32, 0x3d, 0x5b }, + .accent = .{ 0x7a, 0xa2, 0xf7 }, // an unsaved grip: the original's modified colour, ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:254 diffChanged guifg (= palette git.change) - .box_dirty = .{ 0x61, 0x83, 0xbb }, + .dirty = .{ 0x61, 0x83, 0xbb }, // derived: the column grip, the original's type colour, ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:228 Type guifg - .column_box = .{ 0x2a, 0xc3, 0xde }, + .column_grip = .{ 0x2a, 0xc3, 0xde }, // ~/05-genizah/tokyonight.nvim/lua/tokyonight/groups/treesitter.lua:36 ["@keyword"] = c.purple, ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_night.lua:55 purple (vim's regex Keyword is #7dcfff) - .kw = .{ 0x9d, 0x7c, 0xd8 }, + .keyword = .{ 0x9d, 0x7c, 0xd8 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:221 String guifg - .str = .{ 0x9e, 0xce, 0x6a }, + .string = .{ 0x9e, 0xce, 0x6a }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:27 Constant guifg (Number is not defined by the theme, so Neovim's default link Number->Constant applies) - .num = .{ 0xff, 0x9e, 0x64 }, + .number = .{ 0xff, 0x9e, 0x64 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:24 Comment guifg .comment = .{ 0x56, 0x5f, 0x89 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:91 LineNr guifg - .lineno = .{ 0x3b, 0x42, 0x61 }, + .line_number = .{ 0x3b, 0x42, 0x61 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:34 CursorLineNr guifg - .lineno_active = .{ 0xff, 0x9e, 0x64 }, + .line_number_current = .{ 0xff, 0x9e, 0x64 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:201 PmenuSbar guibg - .scroll_track = .{ 0x1f, 0x1f, 0x29 }, + .rail = .{ 0x1f, 0x1f, 0x29 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:203 PmenuThumb guibg - .scroll_thumb = .{ 0x3b, 0x42, 0x61 }, + .rail_thumb = .{ 0x3b, 0x42, 0x61 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:250 WinSeparator guifg #15161e, adjusted - .border = .{ 0x3b, 0x3e, 0x4d }, + .rule = .{ 0x3b, 0x3e, 0x4d }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:207 Search guibg - .search_bg = .{ 0x3d, 0x59, 0xa1 }, - // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:207 Search guifg - .search_fg = .{ 0xc0, 0xca, 0xf5 }, + .hit = .{ 0x3d, 0x59, 0xa1 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:36 DiagnosticError guifg - .diagnostic_error = .{ 0xdb, 0x4b, 0x4b }, + .@"error" = .{ 0xdb, 0x4b, 0x4b }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:48 DiagnosticWarn guifg - .diagnostic_warning = .{ 0xe0, 0xaf, 0x68 }, + .warning = .{ 0xe0, 0xaf, 0x68 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:38 DiagnosticInfo guifg - .diagnostic_info = .{ 0x0d, 0xb9, 0xd7 }, + .info = .{ 0x0d, 0xb9, 0xd7 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-night.vim:37 DiagnosticHint guifg - .diagnostic_hint = .{ 0x1a, 0xbc, 0x9c }, - .palette = .{ + .hint = .{ 0x1a, 0xbc, 0x9c }, + .ansi = .{ .{ 0x15, 0x16, 0x1e }, // 0: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_night.lua:61 terminal.black (vim.g.terminal_color_0 per ~/05-genizah/tokyonight.nvim/lua/tokyonight/theme.lua:33-57) .{ 0xf7, 0x76, 0x8e }, // 1: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_night.lua:71 terminal.red (vim.g.terminal_color_1 per ~/05-genizah/tokyonight.nvim/lua/tokyonight/theme.lua:33-57) .{ 0x9e, 0xce, 0x6a }, // 2: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_night.lua:67 terminal.green (vim.g.terminal_color_2 per ~/05-genizah/tokyonight.nvim/lua/tokyonight/theme.lua:33-57) diff --git a/core/themes/tokyonight_storm.zig b/core/themes/tokyonight_storm.zig index 5fadf177..f46dc56b 100644 --- a/core/themes/tokyonight_storm.zig +++ b/core/themes/tokyonight_storm.zig @@ -20,63 +20,65 @@ //! (colors.blue). Palette skips 'none' and the 'rainbow' list (duplicates of //! named colours); terminal.* omitted from palette since it is the ansi list. //! ansi matches extras/kitty/tokyonight_storm.conf color0-15. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - tag ground #1f2335 -> #1c2032: 1.07:1 off the page, now 1.11:1 (H: a band 1.1:1 off the page; R3: tone on tone) +//! - unsaved grip #6183bb -> #6c8fc7: 4.20:1 on the tag, now 4.91:1 (R6: 3:1 on both tags) +//! - selection #2e3c64 -> #2d3c7a: 1.35:1 off the page, now 1.41:1 (R7) +//! - search hit #3d59a1 -> #554031: 2.18:1 off the page, now 1.50:1 (R8: 1.5:1, the text reading on it) +//! - error #db4b4b -> #f05f5c: 3.55:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "tokyonight_storm", // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:193 Normal guibg - .bg = .{ 0x24, 0x28, 0x3b }, + .page = .{ 0x24, 0x28, 0x3b }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:193 Normal guifg - .fg = .{ 0xc0, 0xca, 0xf5 }, + .text = .{ 0xc0, 0xca, 0xf5 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:245 Visual guibg - .sel_bg = .{ 0x2e, 0x3c, 0x64 }, + .selection = .{ 0x2e, 0x3c, 0x64 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xc0, 0xca, 0xf5 }, + .selection_text = .{ 0xc0, 0xca, 0xf5 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:220 StatusLineNC guibg - .tag_bg = .{ 0x1f, 0x23, 0x35 }, + .tag = .{ 0x1f, 0x23, 0x35 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:220 StatusLineNC guifg #3b4261, adjusted - .tag_fg = .{ 0x85, 0x8a, 0x9d }, + .tag_text = .{ 0x85, 0x8a, 0x9d }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:219 StatusLine guibg #1f2335, adjusted - .tag_active_bg = .{ 0x3d, 0x42, 0x58 }, + .tag_focus = .{ 0x3d, 0x42, 0x58 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:219 StatusLine guifg - .tag_active_fg = .{ 0xa9, 0xb1, 0xd6 }, + .tag_focus_text = .{ 0xa9, 0xb1, 0xd6 }, // the focused grip: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_storm.lua:15 blue; lualine normal-mode section a bg = colors.blue per ~/05-genizah/tokyonight.nvim/lua/lualine/themes/_tokyonight.lua:12 (tokyonight-storm.lua calls it with style "storm") - .box = .{ 0x7a, 0xa2, 0xf7 }, - // derived: the grip at rest, the accent #7aa2f7 faded toward the unfocused tag #1f2335 as far as 1.6:1 off it (0.26 of the way) - .box_dim = .{ 0x37, 0x44, 0x67 }, + .accent = .{ 0x7a, 0xa2, 0xf7 }, // an unsaved grip: the original's modified colour, ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:254 diffChanged guifg (= palette git.change) - .box_dirty = .{ 0x61, 0x83, 0xbb }, + .dirty = .{ 0x61, 0x83, 0xbb }, // derived: the column grip, the original's type colour, ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:228 Type guifg - .column_box = .{ 0x2a, 0xc3, 0xde }, + .column_grip = .{ 0x2a, 0xc3, 0xde }, // ~/05-genizah/tokyonight.nvim/lua/tokyonight/groups/treesitter.lua:36 ["@keyword"] = c.purple, ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_storm.lua:55 purple (vim's regex Keyword is #7dcfff) - .kw = .{ 0x9d, 0x7c, 0xd8 }, + .keyword = .{ 0x9d, 0x7c, 0xd8 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:221 String guifg - .str = .{ 0x9e, 0xce, 0x6a }, + .string = .{ 0x9e, 0xce, 0x6a }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:27 Constant guifg (Number is not defined by the theme, so Neovim's default link Number->Constant applies) - .num = .{ 0xff, 0x9e, 0x64 }, + .number = .{ 0xff, 0x9e, 0x64 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:24 Comment guifg .comment = .{ 0x56, 0x5f, 0x89 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:91 LineNr guifg - .lineno = .{ 0x3b, 0x42, 0x61 }, + .line_number = .{ 0x3b, 0x42, 0x61 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:34 CursorLineNr guifg - .lineno_active = .{ 0xff, 0x9e, 0x64 }, + .line_number_current = .{ 0xff, 0x9e, 0x64 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:201 PmenuSbar guibg - .scroll_track = .{ 0x27, 0x2b, 0x3f }, + .rail = .{ 0x27, 0x2b, 0x3f }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:203 PmenuThumb guibg #3b4261, adjusted - .scroll_thumb = .{ 0x40, 0x47, 0x67 }, + .rail_thumb = .{ 0x40, 0x47, 0x67 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:250 WinSeparator guifg #1d202f, adjusted - .border = .{ 0x44, 0x49, 0x5f }, + .rule = .{ 0x44, 0x49, 0x5f }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:207 Search guibg - .search_bg = .{ 0x3d, 0x59, 0xa1 }, - // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:207 Search guifg - .search_fg = .{ 0xc0, 0xca, 0xf5 }, + .hit = .{ 0x3d, 0x59, 0xa1 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:36 DiagnosticError guifg - .diagnostic_error = .{ 0xdb, 0x4b, 0x4b }, + .@"error" = .{ 0xdb, 0x4b, 0x4b }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:48 DiagnosticWarn guifg - .diagnostic_warning = .{ 0xe0, 0xaf, 0x68 }, + .warning = .{ 0xe0, 0xaf, 0x68 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:38 DiagnosticInfo guifg - .diagnostic_info = .{ 0x0d, 0xb9, 0xd7 }, + .info = .{ 0x0d, 0xb9, 0xd7 }, // ~/05-genizah/tokyonight.nvim/extras/vim/colors/tokyonight-storm.vim:37 DiagnosticHint guifg - .diagnostic_hint = .{ 0x1a, 0xbc, 0x9c }, - .palette = .{ + .hint = .{ 0x1a, 0xbc, 0x9c }, + .ansi = .{ .{ 0x1d, 0x20, 0x2f }, // 0: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_storm.lua:61 terminal.black (vim.g.terminal_color_0 per ~/05-genizah/tokyonight.nvim/lua/tokyonight/theme.lua:33-57) .{ 0xf7, 0x76, 0x8e }, // 1: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_storm.lua:71 terminal.red (vim.g.terminal_color_1 per ~/05-genizah/tokyonight.nvim/lua/tokyonight/theme.lua:33-57) .{ 0x9e, 0xce, 0x6a }, // 2: ~/05-genizah/tokyonight.nvim/extras/lua/tokyonight_storm.lua:67 terminal.green (vim.g.terminal_color_2 per ~/05-genizah/tokyonight.nvim/lua/tokyonight/theme.lua:33-57) diff --git a/core/themes/vimbones.zig b/core/themes/vimbones.zig index 1823c40d..e2f5ea34 100644 --- a/core/themes/vimbones.zig +++ b/core/themes/vimbones.zig @@ -18,63 +18,62 @@ //! links to StatusLine, TabLineFill to StatusLineNC. Accent is the lualine //! normal-mode a bg, a muted neutral (the theme is contrast-based, not //! hue-accented). Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #a2a287 -> #6e6e55: 1.51:1 on the focused tag, now 3.02:1 (R6: 3:1) +//! - selection #d7d7d7 -> #d8d8b3: 1.24:1 off the page, now 1.25:1 (R7) pub const theme = .{ .name = "vimbones", // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:34 Normal guibg - .bg = .{ 0xf0, 0xf0, 0xca }, + .page = .{ 0xf0, 0xf0, 0xca }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:34 Normal guifg - .fg = .{ 0x35, 0x35, 0x35 }, + .text = .{ 0x35, 0x35, 0x35 }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:212 Visual guibg - .sel_bg = .{ 0xd7, 0xd7, 0xd7 }, + .selection = .{ 0xd7, 0xd7, 0xd7 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x35, 0x35, 0x35 }, + .selection_text = .{ 0x35, 0x35, 0x35 }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:199 StatusLineNC guibg - .tag_bg = .{ 0xdf, 0xdf, 0xbc }, + .tag = .{ 0xdf, 0xdf, 0xbc }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:199 StatusLineNC guifg #686868, adjusted - .tag_fg = .{ 0x60, 0x60, 0x60 }, + .tag_text = .{ 0x60, 0x60, 0x60 }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:196 StatusLine guibg #d1d1b0, adjusted - .tag_active_bg = .{ 0xc7, 0xc7, 0xa8 }, + .tag_focus = .{ 0xc7, 0xc7, 0xa8 }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:196 StatusLine guifg - .tag_active_fg = .{ 0x35, 0x35, 0x35 }, + .tag_focus_text = .{ 0x35, 0x35, 0x35 }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/vimbones_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0xa2, 0xa2, 0x87 }, - // derived: the grip at rest, the accent #b0b093 faded toward the unfocused tag #dfdfbc as far as 1.6:1 off it (1.00 of the way) - .box_dim = .{ 0xb0, 0xb0, 0x93 }, + .accent = .{ 0xa2, 0xa2, 0x87 }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/vimbones.vim:42 Changed guifg - .box_dirty = .{ 0x28, 0x64, 0x86 }, + .dirty = .{ 0x28, 0x64, 0x86 }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/vimbones.vim:208 Type guifg - .column_box = .{ 0x5b, 0x5b, 0x42 }, + .column_grip = .{ 0x5b, 0x5b, 0x42 }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:193 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0x15, 0x6a, 0x29 }, + .keyword = .{ 0x15, 0x6a, 0x29 }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:202 String guifg - .str = .{ 0x63, 0x63, 0x63 }, + .string = .{ 0x63, 0x63, 0x63 }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:165 Number guifg - .num = .{ 0x2a, 0x65, 0x35 }, + .number = .{ 0x2a, 0x65, 0x35 }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:48 Comment guifg .comment = .{ 0x8c, 0x8c, 0x7c }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:151 LineNr guifg - .lineno = .{ 0x9a, 0x9a, 0x81 }, + .line_number = .{ 0x9a, 0x9a, 0x81 }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:63 CursorLineNr guifg - .lineno_active = .{ 0x35, 0x35, 0x35 }, + .line_number_current = .{ 0x35, 0x35, 0x35 }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:168 PmenuSbar guibg - .scroll_track = .{ 0xa7, 0xa7, 0x8d }, + .rail = .{ 0xa7, 0xa7, 0x8d }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:170 PmenuThumb guibg - .scroll_thumb = .{ 0xf9, 0xf9, 0xd2 }, + .rail_thumb = .{ 0xf9, 0xf9, 0xd2 }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:219 WinSeparator guifg - .border = .{ 0x9a, 0x9a, 0x81 }, + .rule = .{ 0x9a, 0x9a, 0x81 }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:174 Search guibg - .search_bg = .{ 0xde, 0xb9, 0xd6 }, - // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:174 Search guifg - .search_fg = .{ 0x35, 0x35, 0x35 }, + .hit = .{ 0xde, 0xb9, 0xd6 }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:114 Error guifg via DiagnosticError->Error (link :115) - .diagnostic_error = .{ 0xa8, 0x33, 0x4c }, + .@"error" = .{ 0xa8, 0x33, 0x4c }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:213 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :214) - .diagnostic_warning = .{ 0x94, 0x49, 0x27 }, + .warning = .{ 0x94, 0x49, 0x27 }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:73 DiagnosticInfo guifg - .diagnostic_info = .{ 0x28, 0x64, 0x86 }, + .info = .{ 0x28, 0x64, 0x86 }, // ~/05-genizah/zenbones.nvim/colors/vimbones.vim:68 DiagnosticHint guifg - .diagnostic_hint = .{ 0x88, 0x50, 0x7d }, - .palette = .{ + .hint = .{ 0x88, 0x50, 0x7d }, + .ansi = .{ .{ 0xf0, 0xf0, 0xca }, // 0: ~/05-genizah/zenbones.nvim/colors/vimbones.vim:18 g:terminal_color_0 .{ 0xa8, 0x33, 0x4c }, // 1: ~/05-genizah/zenbones.nvim/colors/vimbones.vim:19 g:terminal_color_1 .{ 0x4f, 0x6c, 0x31 }, // 2: ~/05-genizah/zenbones.nvim/colors/vimbones.vim:20 g:terminal_color_2 diff --git a/core/themes/zenbones_dark.zig b/core/themes/zenbones_dark.zig index 89f5a934..6d5b5f55 100644 --- a/core/themes/zenbones_dark.zig +++ b/core/themes/zenbones_dark.zig @@ -15,63 +15,62 @@ //! StatusLine, TabLineFill to StatusLineNC. Accent is the lualine normal-mode a //! bg, a muted neutral (the theme is contrast-based, not hue-accented). //! Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #635b58 -> #928986: 1.55:1 on the focused tag, now 3.00:1 (R6: 3:1) +//! - search hit #65435e -> #5a2c14: 2.10:1 off the page, now 1.50:1 (R8: 1.5:1, the text reading on it) pub const theme = .{ .name = "zenbones_dark", // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:33 Normal guibg - .bg = .{ 0x1c, 0x19, 0x17 }, + .page = .{ 0x1c, 0x19, 0x17 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:33 Normal guifg - .fg = .{ 0xb4, 0xbd, 0xc3 }, + .text = .{ 0xb4, 0xbd, 0xc3 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:211 Visual guibg - .sel_bg = .{ 0x3d, 0x40, 0x42 }, + .selection = .{ 0x3d, 0x40, 0x42 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xb4, 0xbd, 0xc3 }, + .selection_text = .{ 0xb4, 0xbd, 0xc3 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:198 StatusLineNC guibg - .tag_bg = .{ 0x27, 0x23, 0x21 }, + .tag = .{ 0x27, 0x23, 0x21 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:198 StatusLineNC guifg - .tag_fg = .{ 0xca, 0xd0, 0xd4 }, + .tag_text = .{ 0xca, 0xd0, 0xd4 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:195 StatusLine guibg #352f2d, adjusted - .tag_active_bg = .{ 0x47, 0x3f, 0x3d }, + .tag_focus = .{ 0x47, 0x3f, 0x3d }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:195 StatusLine guifg - .tag_active_fg = .{ 0xb4, 0xbd, 0xc3 }, + .tag_focus_text = .{ 0xb4, 0xbd, 0xc3 }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/zenbones_dark_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0x63, 0x5b, 0x58 }, - // derived: the grip at rest, the accent #59514d faded toward the unfocused tag #272321 as far as 1.6:1 off it (0.72 of the way) - .box_dim = .{ 0x4b, 0x44, 0x41 }, + .accent = .{ 0x63, 0x5b, 0x58 }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/zenbones.vim:41 Changed guifg - .box_dirty = .{ 0x60, 0x99, 0xc0 }, + .dirty = .{ 0x60, 0x99, 0xc0 }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/zenbones.vim:207 Type guifg - .column_box = .{ 0xa1, 0x93, 0x8c }, + .column_grip = .{ 0xa1, 0x93, 0x8c }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:191 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0xb4, 0xbd, 0xc3 }, + .keyword = .{ 0xb4, 0xbd, 0xc3 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:201 String guifg - .str = .{ 0x86, 0x8c, 0x91 }, + .string = .{ 0x86, 0x8c, 0x91 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:164 Number guifg - .num = .{ 0x86, 0x8c, 0x91 }, + .number = .{ 0x86, 0x8c, 0x91 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:47 Comment guifg .comment = .{ 0x6e, 0x67, 0x63 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:150 LineNr guifg - .lineno = .{ 0x68, 0x5f, 0x5a }, + .line_number = .{ 0x68, 0x5f, 0x5a }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:62 CursorLineNr guifg - .lineno_active = .{ 0xb4, 0xbd, 0xc3 }, + .line_number_current = .{ 0xb4, 0xbd, 0xc3 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:167 PmenuSbar guibg - .scroll_track = .{ 0x61, 0x58, 0x53 }, + .rail = .{ 0x61, 0x58, 0x53 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:169 PmenuThumb guibg - .scroll_thumb = .{ 0x8e, 0x81, 0x7b }, + .rail_thumb = .{ 0x8e, 0x81, 0x7b }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:218 WinSeparator guifg - .border = .{ 0x68, 0x5f, 0x5a }, + .rule = .{ 0x68, 0x5f, 0x5a }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:172 Search guibg - .search_bg = .{ 0x65, 0x43, 0x5e }, - // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:172 Search guifg - .search_fg = .{ 0xb4, 0xbd, 0xc3 }, + .hit = .{ 0x65, 0x43, 0x5e }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:113 Error guifg via DiagnosticError->Error (link :114) - .diagnostic_error = .{ 0xde, 0x6e, 0x7c }, + .@"error" = .{ 0xde, 0x6e, 0x7c }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:212 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :213) - .diagnostic_warning = .{ 0xb7, 0x7e, 0x64 }, + .warning = .{ 0xb7, 0x7e, 0x64 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:72 DiagnosticInfo guifg - .diagnostic_info = .{ 0x60, 0x99, 0xc0 }, + .info = .{ 0x60, 0x99, 0xc0 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:67 DiagnosticHint guifg - .diagnostic_hint = .{ 0xb2, 0x79, 0xa7 }, - .palette = .{ + .hint = .{ 0xb2, 0x79, 0xa7 }, + .ansi = .{ .{ 0x1c, 0x19, 0x17 }, // 0: ~/05-genizah/zenbones.nvim/colors/zenbones.vim:17 g:terminal_color_0 .{ 0xde, 0x6e, 0x7c }, // 1: ~/05-genizah/zenbones.nvim/colors/zenbones.vim:18 g:terminal_color_1 .{ 0x81, 0x9b, 0x69 }, // 2: ~/05-genizah/zenbones.nvim/colors/zenbones.vim:19 g:terminal_color_2 diff --git a/core/themes/zenbones_light.zig b/core/themes/zenbones_light.zig index 8d5cc2b8..b60b6d54 100644 --- a/core/themes/zenbones_light.zig +++ b/core/themes/zenbones_light.zig @@ -16,63 +16,62 @@ //! StatusLine, TabLineFill to StatusLineNC. Accent is the lualine normal-mode a //! bg, a muted neutral (the theme is contrast-based, not hue-accented). //! Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #ac9d96 -> #786a64: 1.52:1 on the focused tag, now 3.02:1 (R6: 3:1) +//! - selection #cbd9e3 -> #ccd7e0: 1.24:1 off the page, now 1.26:1 (R7) pub const theme = .{ .name = "zenbones_light", // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:267 Normal guibg - .bg = .{ 0xf0, 0xed, 0xec }, + .page = .{ 0xf0, 0xed, 0xec }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:267 Normal guifg - .fg = .{ 0x2c, 0x36, 0x3c }, + .text = .{ 0x2c, 0x36, 0x3c }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:445 Visual guibg - .sel_bg = .{ 0xcb, 0xd9, 0xe3 }, + .selection = .{ 0xcb, 0xd9, 0xe3 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x2c, 0x36, 0x3c }, + .selection_text = .{ 0x2c, 0x36, 0x3c }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:432 StatusLineNC guibg - .tag_bg = .{ 0xe1, 0xdc, 0xd9 }, + .tag = .{ 0xe1, 0xdc, 0xd9 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:432 StatusLineNC guifg #596a76, adjusted - .tag_fg = .{ 0x52, 0x62, 0x6d }, + .tag_text = .{ 0x52, 0x62, 0x6d }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:429 StatusLine guibg #d6cdc9, adjusted - .tag_active_bg = .{ 0xcf, 0xc3, 0xbf }, + .tag_focus = .{ 0xcf, 0xc3, 0xbf }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:429 StatusLine guifg - .tag_active_fg = .{ 0x2c, 0x36, 0x3c }, + .tag_focus_text = .{ 0x2c, 0x36, 0x3c }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/zenbones_light_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0xac, 0x9d, 0x96 }, - // derived: the grip at rest, the accent #bbaba3 faded toward the unfocused tag #e1dcd9 as far as 1.6:1 off it (0.98 of the way) - .box_dim = .{ 0xbc, 0xac, 0xa4 }, + .accent = .{ 0xac, 0x9d, 0x96 }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/zenbones.vim:275 Changed guifg - .box_dirty = .{ 0x28, 0x64, 0x86 }, + .dirty = .{ 0x28, 0x64, 0x86 }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/zenbones.vim:441 Type guifg - .column_box = .{ 0x6a, 0x55, 0x49 }, + .column_grip = .{ 0x6a, 0x55, 0x49 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:425 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0x2c, 0x36, 0x3c }, + .keyword = .{ 0x2c, 0x36, 0x3c }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:435 String guifg - .str = .{ 0x55, 0x65, 0x70 }, + .string = .{ 0x55, 0x65, 0x70 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:398 Number guifg - .num = .{ 0x55, 0x65, 0x70 }, + .number = .{ 0x55, 0x65, 0x70 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:281 Comment guifg .comment = .{ 0x94, 0x89, 0x85 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:384 LineNr guifg - .lineno = .{ 0xa4, 0x96, 0x8f }, + .line_number = .{ 0xa4, 0x96, 0x8f }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:296 CursorLineNr guifg - .lineno_active = .{ 0x2c, 0x36, 0x3c }, + .line_number_current = .{ 0x2c, 0x36, 0x3c }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:401 PmenuSbar guibg - .scroll_track = .{ 0xb2, 0xa3, 0x9b }, + .rail = .{ 0xb2, 0xa3, 0x9b }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:403 PmenuThumb guibg - .scroll_thumb = .{ 0xf7, 0xf6, 0xf5 }, + .rail_thumb = .{ 0xf7, 0xf6, 0xf5 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:452 WinSeparator guifg - .border = .{ 0xa4, 0x96, 0x8f }, + .rule = .{ 0xa4, 0x96, 0x8f }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:406 Search guibg - .search_bg = .{ 0xde, 0xb9, 0xd6 }, - // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:406 Search guifg - .search_fg = .{ 0x2c, 0x36, 0x3c }, + .hit = .{ 0xde, 0xb9, 0xd6 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:347 Error guifg via DiagnosticError->Error (link :348) - .diagnostic_error = .{ 0xa8, 0x33, 0x4c }, + .@"error" = .{ 0xa8, 0x33, 0x4c }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:446 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :447) - .diagnostic_warning = .{ 0x94, 0x49, 0x27 }, + .warning = .{ 0x94, 0x49, 0x27 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:306 DiagnosticInfo guifg - .diagnostic_info = .{ 0x28, 0x64, 0x86 }, + .info = .{ 0x28, 0x64, 0x86 }, // ~/05-genizah/zenbones.nvim/colors/zenbones.vim:301 DiagnosticHint guifg - .diagnostic_hint = .{ 0x88, 0x50, 0x7d }, - .palette = .{ + .hint = .{ 0x88, 0x50, 0x7d }, + .ansi = .{ .{ 0xf0, 0xed, 0xec }, // 0: ~/05-genizah/zenbones.nvim/colors/zenbones.vim:251 g:terminal_color_0 .{ 0xa8, 0x33, 0x4c }, // 1: ~/05-genizah/zenbones.nvim/colors/zenbones.vim:252 g:terminal_color_1 .{ 0x4f, 0x6c, 0x31 }, // 2: ~/05-genizah/zenbones.nvim/colors/zenbones.vim:253 g:terminal_color_2 diff --git a/core/themes/zenburned.zig b/core/themes/zenburned.zig index 3c8baa82..4e9df574 100644 --- a/core/themes/zenburned.zig +++ b/core/themes/zenburned.zig @@ -15,63 +15,68 @@ //! (bold only), so it inherits Normal. TabLine links to StatusLine, TabLineFill //! to StatusLineNC. Accent is the lualine normal-mode a bg, a muted neutral //! (the theme is contrast-based, not hue-accented). Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #838383 -> #b9b9b9: 1.56:1 on the focused tag, now 3.02:1 (R6: 3:1) +//! - unsaved grip #6099c0 -> #86c0e8: 2.92:1 on the tag, now 4.60:1 (R6: 3:1 on both tags) +//! - selection text #f0e4cf -> #f6ead4: 4.29:1 on the selection, now 4.53:1 (R7: 4.5:1) +//! - search hit #9c6992 -> #7d4f3a: 2.39:1 off the page, now 1.51:1 (R8: 1.5:1, the text reading on it) +//! - error #e3716e -> #fe8985: 3.38:1 on the page, now 4.51:1 (R9: 4.5:1, told from the text and the others) +//! - warning #b77e64 -> #d99e83: 3.05:1 on the page, now 4.53:1 (R9: 4.5:1, told from the text and the others) +//! - info #6099c0 -> #78b2da: 3.36:1 on the page, now 4.53:1 (R9: 4.5:1, told from the text and the others) +//! - hint #b279a7 -> #d499c8: 3.05:1 on the page, now 4.54:1 (R9: 4.5:1, told from the text and the others) pub const theme = .{ .name = "zenburned", // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:34 Normal guibg - .bg = .{ 0x40, 0x40, 0x40 }, + .page = .{ 0x40, 0x40, 0x40 }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:34 Normal guifg - .fg = .{ 0xf0, 0xe4, 0xcf }, + .text = .{ 0xf0, 0xe4, 0xcf }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:212 Visual guibg - .sel_bg = .{ 0x74, 0x69, 0x56 }, + .selection = .{ 0x74, 0x69, 0x56 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xf0, 0xe4, 0xcf }, + .selection_text = .{ 0xf0, 0xe4, 0xcf }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:199 StatusLineNC guibg - .tag_bg = .{ 0x49, 0x49, 0x49 }, + .tag = .{ 0x49, 0x49, 0x49 }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:199 StatusLineNC guifg - .tag_fg = .{ 0xf5, 0xed, 0xe0 }, + .tag_text = .{ 0xf5, 0xed, 0xe0 }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:196 StatusLine guibg #555555, adjusted - .tag_active_bg = .{ 0x64, 0x64, 0x64 }, + .tag_focus = .{ 0x64, 0x64, 0x64 }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:196 StatusLine guifg - .tag_active_fg = .{ 0xf0, 0xe4, 0xcf }, + .tag_focus_text = .{ 0xf0, 0xe4, 0xcf }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/zenburned_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0x83, 0x83, 0x83 }, - // derived: the grip at rest, the accent #6f6f6f faded toward the unfocused tag #494949 as far as 1.6:1 off it (0.82 of the way) - .box_dim = .{ 0x68, 0x68, 0x68 }, + .accent = .{ 0x83, 0x83, 0x83 }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/zenburned.vim:42 Changed guifg - .box_dirty = .{ 0x60, 0x99, 0xc0 }, + .dirty = .{ 0x60, 0x99, 0xc0 }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/zenburned.vim:208 Type guifg - .column_box = .{ 0xa8, 0xa8, 0xa8 }, + .column_grip = .{ 0xa8, 0xa8, 0xa8 }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:193 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0xdc, 0xa2, 0xa2 }, + .keyword = .{ 0xdc, 0xa2, 0xa2 }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:202 String guifg - .str = .{ 0xba, 0xa6, 0x81 }, + .string = .{ 0xba, 0xa6, 0x81 }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:165 Number guifg - .num = .{ 0xba, 0xa6, 0x81 }, + .number = .{ 0xba, 0xa6, 0x81 }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:48 Comment guifg .comment = .{ 0x84, 0x84, 0x84 }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:151 LineNr guifg - .lineno = .{ 0x7f, 0x7f, 0x7f }, + .line_number = .{ 0x7f, 0x7f, 0x7f }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:63 CursorLineNr guifg - .lineno_active = .{ 0xf0, 0xe4, 0xcf }, + .line_number_current = .{ 0xf0, 0xe4, 0xcf }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:168 PmenuSbar guibg - .scroll_track = .{ 0x77, 0x77, 0x77 }, + .rail = .{ 0x77, 0x77, 0x77 }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:170 PmenuThumb guibg - .scroll_thumb = .{ 0x9b, 0x9b, 0x9b }, + .rail_thumb = .{ 0x9b, 0x9b, 0x9b }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:219 WinSeparator guifg - .border = .{ 0x7f, 0x7f, 0x7f }, + .rule = .{ 0x7f, 0x7f, 0x7f }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:174 Search guibg - .search_bg = .{ 0x9c, 0x69, 0x92 }, - // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:174 Search guifg - .search_fg = .{ 0xf0, 0xe4, 0xcf }, + .hit = .{ 0x9c, 0x69, 0x92 }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:114 Error guifg via DiagnosticError->Error (link :115) - .diagnostic_error = .{ 0xe3, 0x71, 0x6e }, + .@"error" = .{ 0xe3, 0x71, 0x6e }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:213 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :214) - .diagnostic_warning = .{ 0xb7, 0x7e, 0x64 }, + .warning = .{ 0xb7, 0x7e, 0x64 }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:73 DiagnosticInfo guifg - .diagnostic_info = .{ 0x60, 0x99, 0xc0 }, + .info = .{ 0x60, 0x99, 0xc0 }, // ~/05-genizah/zenbones.nvim/colors/zenburned.vim:68 DiagnosticHint guifg - .diagnostic_hint = .{ 0xb2, 0x79, 0xa7 }, - .palette = .{ + .hint = .{ 0xb2, 0x79, 0xa7 }, + .ansi = .{ .{ 0x40, 0x40, 0x40 }, // 0: ~/05-genizah/zenbones.nvim/colors/zenburned.vim:18 g:terminal_color_0 .{ 0xe3, 0x71, 0x6e }, // 1: ~/05-genizah/zenbones.nvim/colors/zenburned.vim:19 g:terminal_color_1 .{ 0x81, 0x9b, 0x69 }, // 2: ~/05-genizah/zenbones.nvim/colors/zenburned.vim:20 g:terminal_color_2 diff --git a/core/themes/zenwritten_dark.zig b/core/themes/zenwritten_dark.zig index 76b7047e..ec4db41d 100644 --- a/core/themes/zenwritten_dark.zig +++ b/core/themes/zenwritten_dark.zig @@ -15,63 +15,62 @@ //! StatusLine, TabLineFill to StatusLineNC. Accent is the lualine normal-mode a //! bg, a muted neutral (the theme is contrast-based, not hue-accented). //! Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #5c5c5c -> #8c8c8c: 1.53:1 on the focused tag, now 3.04:1 (R6: 3:1) +//! - search hit #65435e -> #572d18: 2.11:1 off the page, now 1.50:1 (R8: 1.5:1, the text reading on it) pub const theme = .{ .name = "zenwritten_dark", // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:33 Normal guibg - .bg = .{ 0x19, 0x19, 0x19 }, + .page = .{ 0x19, 0x19, 0x19 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:33 Normal guifg - .fg = .{ 0xbb, 0xbb, 0xbb }, + .text = .{ 0xbb, 0xbb, 0xbb }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:211 Visual guibg - .sel_bg = .{ 0x40, 0x40, 0x40 }, + .selection = .{ 0x40, 0x40, 0x40 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0xbb, 0xbb, 0xbb }, + .selection_text = .{ 0xbb, 0xbb, 0xbb }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:198 StatusLineNC guibg - .tag_bg = .{ 0x24, 0x24, 0x24 }, + .tag = .{ 0x24, 0x24, 0x24 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:198 StatusLineNC guifg - .tag_fg = .{ 0xcf, 0xcf, 0xcf }, + .tag_text = .{ 0xcf, 0xcf, 0xcf }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:195 StatusLine guibg #303030, adjusted - .tag_active_bg = .{ 0x41, 0x41, 0x41 }, + .tag_focus = .{ 0x41, 0x41, 0x41 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:195 StatusLine guifg - .tag_active_fg = .{ 0xbb, 0xbb, 0xbb }, + .tag_focus_text = .{ 0xbb, 0xbb, 0xbb }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/zenwritten_dark_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0x5c, 0x5c, 0x5c }, - // derived: the grip at rest, the accent #525252 faded toward the unfocused tag #242424 as far as 1.6:1 off it (0.72 of the way) - .box_dim = .{ 0x45, 0x45, 0x45 }, + .accent = .{ 0x5c, 0x5c, 0x5c }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:41 Changed guifg - .box_dirty = .{ 0x60, 0x99, 0xc0 }, + .dirty = .{ 0x60, 0x99, 0xc0 }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:207 Type guifg - .column_box = .{ 0x96, 0x96, 0x96 }, + .column_grip = .{ 0x96, 0x96, 0x96 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:191 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0xbb, 0xbb, 0xbb }, + .keyword = .{ 0xbb, 0xbb, 0xbb }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:201 String guifg - .str = .{ 0x8b, 0x8b, 0x8b }, + .string = .{ 0x8b, 0x8b, 0x8b }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:164 Number guifg - .num = .{ 0x8b, 0x8b, 0x8b }, + .number = .{ 0x8b, 0x8b, 0x8b }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:47 Comment guifg .comment = .{ 0x68, 0x68, 0x68 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:150 LineNr guifg - .lineno = .{ 0x61, 0x61, 0x61 }, + .line_number = .{ 0x61, 0x61, 0x61 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:62 CursorLineNr guifg - .lineno_active = .{ 0xbb, 0xbb, 0xbb }, + .line_number_current = .{ 0xbb, 0xbb, 0xbb }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:167 PmenuSbar guibg - .scroll_track = .{ 0x59, 0x59, 0x59 }, + .rail = .{ 0x59, 0x59, 0x59 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:169 PmenuThumb guibg - .scroll_thumb = .{ 0x84, 0x84, 0x84 }, + .rail_thumb = .{ 0x84, 0x84, 0x84 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:218 WinSeparator guifg - .border = .{ 0x61, 0x61, 0x61 }, + .rule = .{ 0x61, 0x61, 0x61 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:172 Search guibg - .search_bg = .{ 0x65, 0x43, 0x5e }, - // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:172 Search guifg - .search_fg = .{ 0xbb, 0xbb, 0xbb }, + .hit = .{ 0x65, 0x43, 0x5e }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:113 Error guifg via DiagnosticError->Error (link :114) - .diagnostic_error = .{ 0xde, 0x6e, 0x7c }, + .@"error" = .{ 0xde, 0x6e, 0x7c }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:212 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :213) - .diagnostic_warning = .{ 0xb7, 0x7e, 0x64 }, + .warning = .{ 0xb7, 0x7e, 0x64 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:72 DiagnosticInfo guifg - .diagnostic_info = .{ 0x60, 0x99, 0xc0 }, + .info = .{ 0x60, 0x99, 0xc0 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:67 DiagnosticHint guifg - .diagnostic_hint = .{ 0xb2, 0x79, 0xa7 }, - .palette = .{ + .hint = .{ 0xb2, 0x79, 0xa7 }, + .ansi = .{ .{ 0x19, 0x19, 0x19 }, // 0: ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:17 g:terminal_color_0 .{ 0xde, 0x6e, 0x7c }, // 1: ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:18 g:terminal_color_1 .{ 0x81, 0x9b, 0x69 }, // 2: ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:19 g:terminal_color_2 diff --git a/core/themes/zenwritten_light.zig b/core/themes/zenwritten_light.zig index 42e1623a..4581b1a6 100644 --- a/core/themes/zenwritten_light.zig +++ b/core/themes/zenwritten_light.zig @@ -16,63 +16,62 @@ //! StatusLine, TabLineFill to StatusLineNC. Accent is the lualine normal-mode a //! bg, a muted neutral (the theme is contrast-based, not hue-accented). //! Modified = Changed fg. +//! Moved by pardes as it loads, to meet its floors (DESIGN.md G4: that colour alone; colors.Chrome.of): +//! - focused grip #a0a0a0 -> #6c6c6c: 1.52:1 on the focused tag, now 3.04:1 (R6: 3:1) +//! - selection #d7d7d7 -> #d6d6d6: 1.24:1 off the page, now 1.25:1 (R7) pub const theme = .{ .name = "zenwritten_light", // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:267 Normal guibg - .bg = .{ 0xee, 0xee, 0xee }, + .page = .{ 0xee, 0xee, 0xee }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:267 Normal guifg - .fg = .{ 0x35, 0x35, 0x35 }, + .text = .{ 0x35, 0x35, 0x35 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:445 Visual guibg - .sel_bg = .{ 0xd7, 0xd7, 0xd7 }, + .selection = .{ 0xd7, 0xd7, 0xd7 }, // the original keeps text colours over its selection; its text colour - .sel_fg = .{ 0x35, 0x35, 0x35 }, + .selection_text = .{ 0x35, 0x35, 0x35 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:432 StatusLineNC guibg - .tag_bg = .{ 0xdd, 0xdd, 0xdd }, + .tag = .{ 0xdd, 0xdd, 0xdd }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:432 StatusLineNC guifg #686868, adjusted - .tag_fg = .{ 0x60, 0x60, 0x60 }, + .tag_text = .{ 0x60, 0x60, 0x60 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:429 StatusLine guibg #cfcfcf, adjusted - .tag_active_bg = .{ 0xc5, 0xc5, 0xc5 }, + .tag_focus = .{ 0xc5, 0xc5, 0xc5 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:429 StatusLine guifg - .tag_active_fg = .{ 0x35, 0x35, 0x35 }, + .tag_focus_text = .{ 0x35, 0x35, 0x35 }, // the focused grip: ~/05-genizah/zenbones.nvim/lua/lualine/themes/zenwritten_light_default.lua:8 normal.a bg (lualine theme, default ness; generator derives it as PmenuSbar.bg.abs_da(3), lua/zenbones/shipwright/runners/lualine.lua:66) - .box = .{ 0xa0, 0xa0, 0xa0 }, - // derived: the grip at rest, the accent #aeaeae faded toward the unfocused tag #dddddd as far as 1.6:1 off it (0.98 of the way) - .box_dim = .{ 0xaf, 0xaf, 0xaf }, + .accent = .{ 0xa0, 0xa0, 0xa0 }, // an unsaved grip: the original's modified colour, ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:275 Changed guifg - .box_dirty = .{ 0x28, 0x64, 0x86 }, + .dirty = .{ 0x28, 0x64, 0x86 }, // derived: the column grip, the original's type colour, ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:441 Type guifg - .column_box = .{ 0x73, 0x50, 0x57 }, + .column_grip = .{ 0x73, 0x50, 0x57 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:425 Statement guifg (no Keyword group defined; Vim default links Keyword to Statement) - .kw = .{ 0x35, 0x35, 0x35 }, + .keyword = .{ 0x35, 0x35, 0x35 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:435 String guifg - .str = .{ 0x63, 0x63, 0x63 }, + .string = .{ 0x63, 0x63, 0x63 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:398 Number guifg - .num = .{ 0x63, 0x63, 0x63 }, + .number = .{ 0x63, 0x63, 0x63 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:281 Comment guifg .comment = .{ 0x8b, 0x8b, 0x8b }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:384 LineNr guifg - .lineno = .{ 0x98, 0x98, 0x98 }, + .line_number = .{ 0x98, 0x98, 0x98 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:296 CursorLineNr guifg - .lineno_active = .{ 0x35, 0x35, 0x35 }, + .line_number_current = .{ 0x35, 0x35, 0x35 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:401 PmenuSbar guibg - .scroll_track = .{ 0xa6, 0xa6, 0xa6 }, + .rail = .{ 0xa6, 0xa6, 0xa6 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:403 PmenuThumb guibg - .scroll_thumb = .{ 0xf6, 0xf6, 0xf6 }, + .rail_thumb = .{ 0xf6, 0xf6, 0xf6 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:452 WinSeparator guifg - .border = .{ 0x98, 0x98, 0x98 }, + .rule = .{ 0x98, 0x98, 0x98 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:406 Search guibg - .search_bg = .{ 0xde, 0xb9, 0xd6 }, - // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:406 Search guifg - .search_fg = .{ 0x35, 0x35, 0x35 }, + .hit = .{ 0xde, 0xb9, 0xd6 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:347 Error guifg via DiagnosticError->Error (link :348) - .diagnostic_error = .{ 0xa8, 0x33, 0x4c }, + .@"error" = .{ 0xa8, 0x33, 0x4c }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:446 WarningMsg guifg via DiagnosticWarn->WarningMsg (link :447) - .diagnostic_warning = .{ 0x94, 0x49, 0x27 }, + .warning = .{ 0x94, 0x49, 0x27 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:306 DiagnosticInfo guifg - .diagnostic_info = .{ 0x28, 0x64, 0x86 }, + .info = .{ 0x28, 0x64, 0x86 }, // ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:301 DiagnosticHint guifg - .diagnostic_hint = .{ 0x88, 0x50, 0x7d }, - .palette = .{ + .hint = .{ 0x88, 0x50, 0x7d }, + .ansi = .{ .{ 0xee, 0xee, 0xee }, // 0: ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:251 g:terminal_color_0 .{ 0xa8, 0x33, 0x4c }, // 1: ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:252 g:terminal_color_1 .{ 0x4f, 0x6c, 0x31 }, // 2: ~/05-genizah/zenbones.nvim/colors/zenwritten.vim:253 g:terminal_color_2 diff --git a/core/tutor.txt b/core/tutor.txt index 5b0fd23d..62f71402 100644 --- a/core/tutor.txt +++ b/core/tutor.txt @@ -59,18 +59,19 @@ The workspace tag, a column's, and a file's, a terminal's, a PDF's and an image's: -| Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config History Debug Exit -| New Term Find Grep Joincol Delcol -| Save Term Collapse Follow Del -| Term Save Mode Filter Collapse Del -| Term PdfSections PdfTint PdfFit Collapse Del -| Term Collapse Follow Del +| Find Grep Newcol Help Exit +| New Term Joincol Delcol +| Save Undo Del +| Del Term +| PdfSections PdfTint PdfFit Del +| Del - 1. Press : here: the keyboard goes to this pane's tag, on `Save`. - Press A, type a space and Help, press Esc, then Tab: `Help` + 1. Press : twice here: the keyboard goes to this pane's tag, after + its words. Press i, type Help, press Esc, then Tab: `Help` runs and its list takes the keyboard. Esc brings you back. - 2. Click `Collapse` in this tag: the pane folds to its tag. Click - it again. + 2. A tag shows the words that act now; its kind's others run from + :, listed for this pane. Press :, type Coll, press Enter: the + pane folds to its tag. The same again unfolds it. 3. Drag the box left of the tag down a few rows, then back. -> Guide: Tags |
