diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-26 02:04:56 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-26 02:27:51 -0300 |
| commit | 54cd21e1bd487276142e3b1d62f1556f05b7f978 (patch) | |
| tree | bf5e33338a9b393764ed65829f90d2191117c4c9 /core | |
| parent | df964ae2f14d21a4799d52a07abfe3b2bef3c65e (diff) | |
| download | pardes-54cd21e1bd487276142e3b1d62f1556f05b7f978.tar.gz pardes-54cd21e1bd487276142e3b1d62f1556f05b7f978.zip | |
gui, tui, macos, surface, draw: the frontends' colours from the chrome (the themes programme's L2e; DESIGN.md R1, R6, R11, R15, G1'): the window's one null page and text are colors.null_page and null_text (gui.zig's own bg_default and fg_default, the same values written twice, deleted; the tty's trail ink the same constant where it wrote #cccccc again); SGR faint in a window is its ink toward its own ground to the dim floor, 3.5:1 (R15; a terminal's faint on the page's text is the page's dim ink already, L2d's), where it was the ink at 60 % toward black, darker and stronger on a light page; InactiveDim's fade is worked out, not searched: luminance runs straight in linear light, which `blendLinear` mixes in, so the most of the setting that keeps a pair at its own contrast or 4.5 is one division (`fadeToward`, a hair inside the floor for the bytes' rounding), where each frame bisected every distinct (ink, paper) pair eight times into a 32-slot cache made again each frame (A7); the grips (G1', R6): a reading pane's button is ringed in the chrome's mode ink (`grip.mode`: sky, else mint, violet, paper, rose; 3:1 on both tag grounds), two logical pixels as acme's ButtonBorder, outside a pixel of band so its fill never touches it (an unfocused dirty one's gap, now a reading one's too), a held pane's ring the resting `grip.ring` and a focused one's `grip.focus`, dirty `grip.dirty`; the glyph and the mode's bars on a filled button (focused or dirty) in `grip.ink` (held 4.5:1 on every fill), on the band in the tag's own ink: gui.zig's inkOn (black or white past a luminance of 140, not WCAG) deleted; the window's rules: spines, column and stacked-pane rules in `rule` (R11), the topbar's in `rule` unless gui_topbar_pane_border_rgb, the tag rule `tag_rule` (half the tag toward the page in OKLab; acme's own #8888cc) where it was the sRGB average of the tag and the page, `rule_px` and `rail_px` the chrome's; surface.Chrome gains `grip_mode` and `grip_ink`, `tag_rule` is always given (null meant "mix it yourself"), and draw.zig fills them from `p.chrome()`; macOS: the two exports nothing reads, pardes_tagline_bg (the tag's ground, misnamed) and pardes_tag_active_bg, deleted with their header lines and ABI guards; the Mac's sixteen for an index are core/colors.zig's `xterm`, the gui's, where they were Tango (a window is handed a program's sixteen as the theme's own colours now, L2d, so an index under 16 reaches it only from elsewhere: one colour an index in every window); RUN (TEST FIRST): gui.zig "every pixel of a grip column is band, button or ring" asks the button's pixels in the chrome's fills, rings, mode ring and grip ink (it allowed the grid's old box and boxDirty colours and inkOn), over four sizes, focused or not, dirty or not, the first pane reading (Jumps walk): fails on the base by compile (the surface had no mode ring or grip ink), passes now; "InactiveDim fades the unfocused panes' rows alone, never below the text's floor" passes with the fade worked out (#e6e6e6 on black faded toward it, at least 4.5:1); acme's #8888cc tag rule and its 2 px rules and 18 px track as before; PICTURES (the S kit, before = the installed build, after = this tree's Debug gui, 26 px, `Jumps walk`): .scratch/themes/L2cde/png/: the Changes view (dark, neonotte84, orchard, acme), a terminal with `ls --color` and the sixteen, bright, backgrounds, faint, 256 and greys (dark, neonotte84), the grip's four states (held or reading, focused or not; 16 and 26 px; dark, neonotte84), InactiveDim 35 (dark, neonotte84); derived once: every colour these surfaces read is Chrome.of's (colors.zig, at the theme's change: finishThemeInitialization, setThemeIndex, previewTheme, loadThemeFile), handed to the window in surface.Chrome by draw.zig a frame as before; the fades (faint, InactiveDim) are a cell's arithmetic, as the 60 % and the blend were, with no search or cache left; NOT DONE: PDF hits (the PDF addon is handed fg, bg, sel and link through pa_view, the addon ABI 3.3; the theme's hit wants a field there, an ABI 3.4 with a version check: abi/pardes_addon.h, abi/addon.zig, core/Kind.zig, addons/fake, beyond this line's files), so test/image_harness.zig's helix tints are unchanged and not re-pinned; a mark's ink on a button is still pushed 4.5:1 against the fill a frame (it wants a severity ink per grip fill in Chrome: L2a's marks); the grid's frame and empty columns (draw.zig's fills) and the tag grounds the window lays under a tag (tag_bg, tag_focus_bg, tag_reading_bg) stay the old views' until L2a moves the grid; GATES: gui unit-test 1948/1952 (4 skipped; w2base 1947/1951, +1 the dark terminal test of L2d; its one failure the known BaselineHarnessMismatch); macOS: runtime/macos.zig built for this host and its ABI guard run (`unit-test -Dplatform=macos`, "pardes.h declares every export the way it is defined"), the Swift not compiled (no Darwin here); the tui suites on L2c+L2d+L2e: core-test 1123/1296 (173 skipped), shell-test 1344/1347 (3 skipped), pane-test 184/185 (1 skipped), behaviour-test 280/280 and --replay 20 seeds of 70 steps, 0 failures, process-test 0 of 147 failed (3 skipped, no golden moved by L2e), term-test 17/17, kitty-test 45/45; the dump and digest unchanged (no fuzz or soak); load 0.9 to 12.8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'core')
| -rw-r--r-- | core/colors.zig | 2 | ||||
| -rw-r--r-- | core/draw.zig | 21 | ||||
| -rw-r--r-- | core/surface.zig | 9 |
3 files changed, 20 insertions, 12 deletions
diff --git a/core/colors.zig b/core/colors.zig index 4e4bd9ba..d280172e 100644 --- a/core/colors.zig +++ b/core/colors.zig @@ -85,7 +85,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; diff --git a/core/draw.zig b/core/draw.zig index 2553d5be..d2e54cbb 100644 --- a/core/draw.zig +++ b/core/draw.zig @@ -330,11 +330,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 +347,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. 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, |
