Commit 2a9597a69f
Unsigned
Layout: unified · split
gitbay/Theme/Theme.swift +5
| @@ -32,6 +32,11 @@ extension Color { | |||
| 32 | nonisolated static let gbCodeBackground = paired(0xF5F5F5, 0x050505) | 32 | nonisolated static let gbCodeBackground = paired(0xF5F5F5, 0x050505) |
| 33 | /// --fill-subtle: hunk headers and quiet fills. | 33 | /// --fill-subtle: hunk headers and quiet fills. |
| 34 | nonisolated static let gbFillSubtle = paired(0xECECEC, 0x161616) | 34 | 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) | ||
| 35 | } | 40 | } |
| 36 | 41 | ||
| 37 | extension UIColor { | 42 | extension UIColor { |
gitbay/Views/Discovery/ActivityGraph.swift +10 −7
| @@ -55,7 +55,7 @@ struct ActivityGraph: View { | |||
| 55 | let date: String | 55 | let date: String |
| 56 | let count: Int | 56 | let count: Int |
| 57 | 57 | ||
| 58 | /// Five buckets, as the stylesheet colors them. | 58 | /// The same five buckets activityLevel uses server-side. |
| 59 | var level: Int { | 59 | var level: Int { |
| 60 | switch count { | 60 | switch count { |
| 61 | case 0: 0 | 61 | case 0: 0 |
| @@ -75,7 +75,7 @@ struct ActivityGraph: View { | |||
| 75 | ForEach(Array(week.enumerated()), id: \.offset) { _, cell in | 75 | ForEach(Array(week.enumerated()), id: \.offset) { _, cell in |
| 76 | RoundedRectangle(cornerRadius: 2) | 76 | RoundedRectangle(cornerRadius: 2) |
| 77 | .fill(color(for: cell)) | 77 | .fill(color(for: cell)) |
| 78 | .frame(width: 10, height: 10) | 78 | .frame(width: 11, height: 11) |
| 79 | } | 79 | } |
| 80 | } | 80 | } |
| 81 | } | 81 | } |
| @@ -85,14 +85,17 @@ struct ActivityGraph: View { | |||
| 85 | .defaultScrollAnchor(.trailing) | 85 | .defaultScrollAnchor(.trailing) |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 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. | ||
| 88 | private func color(for cell: Cell?) -> Color { | 91 | private func color(for cell: Cell?) -> Color { |
| 89 | guard let cell else { return .clear } | 92 | guard let cell else { return .clear } |
| 90 | return switch cell.level { | 93 | return switch cell.level { |
| 91 | case 0: Color.gbFillSubtle | 94 | case 0: Color.gbFaint |
| 92 | case 1: Color.gbOK.opacity(0.30) | 95 | case 1: Color.gbAccent.mix(with: .gbBackground, by: 0.75) |
| 93 | case 2: Color.gbOK.opacity(0.55) | 96 | case 2: Color.gbAccent.mix(with: .gbBackground, by: 0.50) |
| 94 | case 3: Color.gbOK.opacity(0.78) | 97 | case 3: Color.gbAccent.mix(with: .gbBackground, by: 0.25) |
| 95 | default: Color.gbOK | 98 | default: Color.gbAccent |
| 96 | } | 99 | } |
| 97 | } | 100 | } |
| 98 | } | 101 | } |