a native ios client for gitbay

client ios swift

https://gitbay.org

Commit 0f215ef0ee

0f215ef0eea92267b482a00d2c7adff7c59197c7

parent: 4a31811ff2

Verified · cmc

cmc <hello@cleberg.net> · 2026-08-28T03:00:04Z

activity graph: the stylesheet's ramp, not an invented one

The graph shipped green with opacity steps I chose myself. The web
mixes --accent toward --bg at 25/50/75/100 with --faint for an empty
day, and the cells are 11px. Adding --faint and --bg as tokens and
using them.

The level thresholds happened to match activityLevel; that was luck,
not care, and they are now stated as matching it.

Every other token was checked against style.css in the same pass: all
ten already matched exactly.
gitbay/Theme/Theme.swift +5
@@ -32,6 +32,11 @@ extension Color {
3232 nonisolated static let gbCodeBackground = paired(0xF5F5F5, 0x050505)
3333 /// --fill-subtle: hunk headers and quiet fills.
3434 nonisolated static let gbFillSubtle = paired(0xECECEC, 0x161616)
35 /// --faint: hairlines, row separators, and an empty calendar cell.
36 nonisolated static let gbFaint = paired(0xEAEAEA, 0x1C1C1C)
37 /// --bg: the page ground the accent is mixed toward. Chrome uses the
38 /// system background; this is for blends that must match the web.
39 nonisolated static let gbBackground = paired(0xFFFFFF, 0x0A0A0A)
3540 }
3641
3742 extension UIColor {
gitbay/Views/Discovery/ActivityGraph.swift +10 −7
@@ -55,7 +55,7 @@ struct ActivityGraph: View {
5555 let date: String
5656 let count: Int
5757
58 /// Five buckets, as the stylesheet colors them.
58 /// The same five buckets activityLevel uses server-side.
5959 var level: Int {
6060 switch count {
6161 case 0: 0
@@ -75,7 +75,7 @@ struct ActivityGraph: View {
7575 ForEach(Array(week.enumerated()), id: \.offset) { _, cell in
7676 RoundedRectangle(cornerRadius: 2)
7777 .fill(color(for: cell))
78 .frame(width: 10, height: 10)
78 .frame(width: 11, height: 11)
7979 }
8080 }
8181 }
@@ -85,14 +85,17 @@ struct ActivityGraph: View {
8585 .defaultScrollAnchor(.trailing)
8686 }
8787
88 /// The stylesheet's ramp: an empty day is --faint, and the rest mix
89 /// --accent toward --bg at 25/50/75/100 percent. A day outside the
90 /// window draws nothing at all.
8891 private func color(for cell: Cell?) -> Color {
8992 guard let cell else { return .clear }
9093 return switch cell.level {
91 case 0: Color.gbFillSubtle
92 case 1: Color.gbOK.opacity(0.30)
93 case 2: Color.gbOK.opacity(0.55)
94 case 3: Color.gbOK.opacity(0.78)
95 default: Color.gbOK
94 case 0: Color.gbFaint
95 case 1: Color.gbAccent.mix(with: .gbBackground, by: 0.75)
96 case 2: Color.gbAccent.mix(with: .gbBackground, by: 0.50)
97 case 3: Color.gbAccent.mix(with: .gbBackground, by: 0.25)
98 default: Color.gbAccent
9699 }
97100 }
98101 }