╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │407 }; │ │408 if (tb) |t| { │ │409 t.options.border_style = if (selected_tab == id) .single else .hidden; │ │410 + t.options.inverted = selected_tab == id; │ │411 } │ │412 tabs_width += if (child.min_size) |min_size| min_size.width orelse 0 else 0;│ │413 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │83 .fork => true, │ │84 .branch => false, │ │85 }, │ │86 - .text_box => |*selector| selector.options.border_style = if (id == self.selectors.get(self.selected)) .single else .hidden,│ │86 + .text_box => |*selector| { │ │87 + const selected = id == self.selectors.get(self.selected); │ │88 + selector.options.border_style = if (selected) .single else .hidden; │ │89 + selector.options.inverted = selected; │ │90 + }, │ │91 else => {}, │ │92 }; │ │93 try self.box.build(allocator, constraint, root_focus); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────╮ │src/ui/Repo/Undo.zig│ ╰────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │586 self.shown_failure = failure; │ │587 } │ │588 } │ │589 - for (rows.children.keys(), rows.children.values()) |id, *child| child.widget.text_box.options.border_style = if (rows.getFocus().child_id == id) .single else .hidden;│ │589 + for (rows.children.keys(), rows.children.values()) |id, *child| { │ │590 + const is_selected = rows.getFocus().child_id == id; │ │591 + child.widget.text_box.options.border_style = if (is_selected) .single else .hidden; │ │592 + child.widget.text_box.options.inverted = is_selected; │ │593 + } │ │594 const both_fit = if (constraint.max_size.width) |width| width >= list_max_width + detail_min_width else true; │ │595 self.contentBox().children.values()[0].max_size = if (both_fit) .{ .width = list_max_width, .height = null } else null; │ │596 const width = if (constraint.max_size.width) |value| if (both_fit) value - list_max_width else value else detail_min_width; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/User/Header.zig│ ╰──────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │220 else => null, │ │221 }; │ │222 if (tb) |t| { │ │223 - t.options.border_style = if (self.getFocus().child_id == id) .single else .hidden;│ │223 + const selected = self.getFocus().child_id == id; │ │224 + t.options.border_style = if (selected) .single else .hidden; │ │225 + t.options.inverted = selected; │ │226 } │ │227 } │ │228 var scroll_constraint = constraint; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────╮ │src/ui/widget.zig│ ╰─────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │1290 38, 48 => { │ │1291 // truecolor form: 38;2;r;g;b — anything else is ignored│ │1292 if (i + 4 < n and nums[i + 1] == 2) { │ │1293 - const c = Grid.Color{ │ │1293 + const c = Grid.Color{ .rgb = .{ │ │1294 .r = @truncate(nums[i + 2]), │ │1295 .g = @truncate(nums[i + 3]), │ │1296 .b = @truncate(nums[i + 4]), │ ╰──────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │1297 - }; │ │1297 + } }; │ │1298 if (nums[i] == 38) style.fg = c else style.bg = c;│ │1299 i += 4; │ │1300 } │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────╮ │1389 // stays legible over it │ │1390 const art_brightness = 35; // percent │ │1391 │ │1392 + // only truecolor can be dimmed; palette colors pass through │ │1393 fn dimColor(color: ?Grid.Color) ?Grid.Color { │ │1394 const c = color orelse return null; │ │1394 - return .{ │ │1395 - .r = @intCast(@as(u16, c.r) * art_brightness / 100), │ │1396 - .g = @intCast(@as(u16, c.g) * art_brightness / 100), │ │1397 - .b = @intCast(@as(u16, c.b) * art_brightness / 100), │ │1395 + return switch (c) { │ │1396 + .rgb => |v| .{ .rgb = .{ │ │1397 + .r = @intCast(@as(u16, v.r) * art_brightness / 100),│ │1398 + .g = @intCast(@as(u16, v.g) * art_brightness / 100),│ │1399 + .b = @intCast(@as(u16, v.b) * art_brightness / 100),│ │1400 + } }, │ │1401 + else => c, │ │1402 }; │ │1403 } │ │1404 │ ╰──────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │1428 return if (v >= 1 and v <= 9) 10 else v; │ │1429 } │ │1430 }.f; │ │1427 - return .{ .r = snap(c.r), .g = snap(c.g), .b = snap(c.b) }; │ │1431 + return switch (c) { │ │1432 + .rgb => |v| .{ .rgb = .{ .r = snap(v.r), .g = snap(v.g), .b = snap(v.b) } },│ │1433 + else => c, │ │1434 + }; │ │1435 } │ │1436 │ │1437 fn applyArtBackground(dst: *Grid.Cell, src: Grid.Cell) void { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────╮ │1439 dst.style.bg = background_maybe; │ │1440 // change unstyled text to contrast with the art behind it │ │1441 if (dst.style.fg == null) { │ │1435 - if (background_maybe) |background| { │ │1442 + // the art is parsed as truecolor, so a palette bg never occurs │ │1443 + const background: ?Grid.Color.Rgb = if (background_maybe) |b| switch (b) {│ │1444 + .rgb => |v| v, │ │1445 + else => null, │ │1446 + } else null; │ │1447 + if (background) |v| { │ │1448 // use near-black and near-white, which is easier on the eyes │ │1449 // while retaining high contrast │ │1438 - const luminance = (@as(u32, background.r) * 299 + │ │1439 - @as(u32, background.g) * 587 + │ │1440 - @as(u32, background.b) * 114) / 1000; │ │1450 + const luminance = (@as(u32, v.r) * 299 + │ │1451 + @as(u32, v.g) * 587 + │ │1452 + @as(u32, v.b) * 114) / 1000; │ │1453 dst.style.fg = if (luminance >= 128) │ │1442 - .{ .r = 16, .g = 16, .b = 16 } │ │1454 + .{ .rgb = .{ .r = 16, .g = 16, .b = 16 } } │ │1455 else │ │1444 - .{ .r = 240, .g = 240, .b = 240 }; │ │1456 + .{ .rgb = .{ .r = 240, .g = 240, .b = 240 } }; │ │1457 } │ │1458 } │ │1459 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────╮ │1608 (if (focused) .double else .single) │ │1609 else │ │1610 .hidden; │ │1611 + self.selector(i).options.inverted = i == self.selected;│ │1612 } │ │1613 } │ │1614 self.textInput().options.border_style = .single; │ ╰─────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯