Skip to content

Commit eab1c36

Browse files
Add spaces to lab unformatted output and fix closing paren formatting
Consistent comma spacing in lab unformatted style to match oklch. Move closing parentheses to their own lines for multiline function calls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 157119d commit eab1c36

8 files changed

Lines changed: 55 additions & 29 deletions

File tree

Pika/Constants/Constants.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import KeyboardShortcuts
33
import SwiftUI
44

55
// swiftlint:disable line_length
6-
// trailing_comma is already disabled globally in .swiftlint.yml
76

87
extension KeyboardShortcuts.Name {
98
static let togglePika = Self("togglePika")

Pika/Extensions/NSColor+Lab.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ extension NSColor {
9393
case .design, .swiftUI:
9494
return "lab(\(l_str), \(a_str), \(b_str))"
9595
case .unformatted:
96-
return "\(l_str),\(a_str),\(b_str)"
96+
return "\(l_str), \(a_str), \(b_str)"
9797
}
9898
}
9999

Pika/Services/ColorPickOverlayWindow.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class ColorPickOverlayWindow {
2525

2626
positionPanels(
2727
infoPanel: infoPanel, crosshairPanel: crosshairPanel,
28-
near: cursorPosition, panelSize: panelSize, crosshairSize: crosshairSize)
28+
near: cursorPosition, panelSize: panelSize, crosshairSize: crosshairSize
29+
)
2930

3031
infoPanel.orderFrontRegardless()
3132
crosshairPanel.orderFrontRegardless()
@@ -121,14 +122,17 @@ class ColorPickOverlayWindow {
121122

122123
infoPanel.setFrame(
123124
NSRect(x: xPosition, y: yPosition, width: panelSize.width, height: panelSize.height),
124-
display: true)
125+
display: true
126+
)
125127

126128
crosshairPanel.setFrame(
127129
NSRect(
128130
x: cursorPosition.x - crosshairSize / 2,
129131
y: cursorPosition.y - crosshairSize / 2,
130-
width: crosshairSize, height: crosshairSize),
131-
display: true)
132+
width: crosshairSize, height: crosshairSize
133+
),
134+
display: true
135+
)
132136
}
133137

134138
func dismiss() {

Pika/Services/Eyedroppers.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ class Eyedropper: ObservableObject {
141141
if let selectedColor = selectedColor {
142142
if Defaults[.showColorOverlay] {
143143
let colorText = selectedColor.toFormat(
144-
format: Defaults[.colorFormat], style: Defaults[.copyFormat])
144+
format: Defaults[.colorFormat], style: Defaults[.copyFormat]
145+
)
145146
let cursorPosition = NSEvent.mouseLocation
146147
self.overlayWindow.show(
147148
colorText: colorText,

Pika/Views/ColorPickOverlay.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,20 @@ struct ColorPickOverlay_Previews: PreviewProvider {
140140
VStack(spacing: 20) {
141141
ColorPickOverlay(
142142
colorText: "#232323", pickedColor: NSColor(hex: "#232323"),
143-
viewModel: ColorPickOverlayViewModel())
143+
viewModel: ColorPickOverlayViewModel()
144+
)
144145
ColorPickOverlay(
145146
colorText: "rgb(35, 35, 35)", pickedColor: NSColor(hex: "#232323"),
146-
viewModel: ColorPickOverlayViewModel())
147+
viewModel: ColorPickOverlayViewModel()
148+
)
147149
ColorPickOverlay(
148150
colorText: "hsl(0, 0%, 14%)", pickedColor: NSColor(hex: "#232323"),
149-
viewModel: ColorPickOverlayViewModel())
151+
viewModel: ColorPickOverlayViewModel()
152+
)
150153
ColorPickOverlay(
151154
colorText: "0.14 0.14 0.14", pickedColor: NSColor(hex: "#232323"),
152-
viewModel: ColorPickOverlayViewModel())
155+
viewModel: ColorPickOverlayViewModel()
156+
)
153157
}
154158
.frame(width: 400, height: 400)
155159
}

Pika/Views/ComplianceToggleGroup.swift

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ struct ComplianceToggleGroup: View {
3535
}
3636
ComplianceToggle(
3737
title: "AA", isCompliant: wcag.ratio45,
38-
tooltip: PikaText.textColorWCAG45, size: size)
38+
tooltip: PikaText.textColorWCAG45, size: size
39+
)
3940
ComplianceToggle(
4041
title: "AAA", isCompliant: wcag.ratio70,
41-
tooltip: PikaText.textColorWCAG70, size: size)
42+
tooltip: PikaText.textColorWCAG70, size: size
43+
)
4244
}
4345
HStack(alignment: .center, spacing: 8.0) {
4446
if size == .full {
@@ -49,40 +51,49 @@ struct ComplianceToggleGroup: View {
4951
}
5052
ComplianceToggle(
5153
title: "AA", isCompliant: wcag.ratio30,
52-
tooltip: PikaText.textColorWCAG30, large: true, size: size)
54+
tooltip: PikaText.textColorWCAG30, large: true, size: size
55+
)
5356
ComplianceToggle(
5457
title: "AAA", isCompliant: wcag.ratio45,
55-
tooltip: PikaText.textColorWCAG45, large: true, size: size)
58+
tooltip: PikaText.textColorWCAG45, large: true, size: size
59+
)
5660
}
5761
}
5862
} else {
5963
HStack(spacing: size == .full ? 16.0 : 8.0) {
6064
ComplianceToggle(
6165
title: "AA", isCompliant: wcag.ratio30,
62-
tooltip: PikaText.textColorWCAG30, large: true, combined: true, size: size)
66+
tooltip: PikaText.textColorWCAG30, large: true, combined: true, size: size
67+
)
6368
ComplianceToggle(
6469
title: "AA/AAA", isCompliant: wcag.ratio45,
65-
tooltip: PikaText.textColorWCAG45, large: true, combined: true, size: size)
70+
tooltip: PikaText.textColorWCAG45, large: true, combined: true, size: size
71+
)
6672
ComplianceToggle(
6773
title: "AAA", isCompliant: wcag.ratio70,
68-
tooltip: PikaText.textColorWCAG70, combined: true, size: size)
74+
tooltip: PikaText.textColorWCAG70, combined: true, size: size
75+
)
6976
}
7077
}
7178

7279
case let .apca(apca):
7380
HStack(spacing: size == .full ? 16.0 : 8.0) {
7481
ComplianceToggle(
7582
title: PikaText.textAPCABaseline, isCompliant: abs(apca.value) >= 30,
76-
tooltip: PikaText.textColorAPCA30, combined: true, size: size)
83+
tooltip: PikaText.textColorAPCA30, combined: true, size: size
84+
)
7785
ComplianceToggle(
7886
title: PikaText.textAPCAHeadline, isCompliant: abs(apca.value) >= 45,
79-
tooltip: PikaText.textColorAPCA45, combined: true, size: size)
87+
tooltip: PikaText.textColorAPCA45, combined: true, size: size
88+
)
8089
ComplianceToggle(
8190
title: PikaText.textAPCATitle, isCompliant: abs(apca.value) >= 60,
82-
tooltip: PikaText.textColorAPCA60, combined: true, size: size)
91+
tooltip: PikaText.textColorAPCA60, combined: true, size: size
92+
)
8393
ComplianceToggle(
8494
title: PikaText.textAPCABody, isCompliant: abs(apca.value) >= 75,
85-
tooltip: PikaText.textColorAPCA75, combined: true, size: size)
95+
tooltip: PikaText.textColorAPCA75, combined: true, size: size
96+
)
8697
}
8798
}
8899
}

Pika/Views/ContentView.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,16 @@ struct ContentView: View {
7171
pasteboard.clearContents()
7272
let contents = Exporter.toText(
7373
foreground: eyedroppers.foreground, background: eyedroppers.background,
74-
style: copyFormat)
74+
style: copyFormat
75+
)
7576
pasteboard.setString(contents, forType: .string)
7677
}
7778
.onReceive(NotificationCenter.default.publisher(for: .triggerCopyData)) { _ in
7879
pasteboard.clearContents()
7980
let contents = Exporter.toJSON(
8081
foreground: eyedroppers.foreground, background: eyedroppers.background,
81-
style: copyFormat)
82+
style: copyFormat
83+
)
8284
pasteboard.setString(contents, forType: .string)
8385
}
8486
}

Pika/Views/KeyboardShortcutGrid.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,29 @@ private struct ShortcutEntry {
99
private let pickRow: [ShortcutEntry] = [
1010
ShortcutEntry(title: PikaText.textPickForeground, notificationName: .triggerPickForeground, keys: ["", "D"]),
1111
ShortcutEntry(
12-
title: PikaText.textPickBackground, notificationName: .triggerPickBackground, keys: ["", "", "D"]),
12+
title: PikaText.textPickBackground, notificationName: .triggerPickBackground, keys: ["", "", "D"]
13+
),
1314
ShortcutEntry(title: PikaText.textCopyForeground, notificationName: .triggerCopyForeground, keys: ["", "C"]),
1415
ShortcutEntry(
15-
title: PikaText.textCopyBackground, notificationName: .triggerCopyBackground, keys: ["", "", "C"]),
16+
title: PikaText.textCopyBackground, notificationName: .triggerCopyBackground, keys: ["", "", "C"]
17+
),
1618
ShortcutEntry(
1719
title: PikaText.textColorSystemPickerForegroundSimple,
18-
notificationName: .triggerSystemPickerForeground, keys: ["", "S"]),
20+
notificationName: .triggerSystemPickerForeground, keys: ["", "S"]
21+
),
1922
ShortcutEntry(
2023
title: PikaText.textColorSystemPickerBackgroundSimple,
21-
notificationName: .triggerSystemPickerBackground, keys: ["", "", "S"]),
24+
notificationName: .triggerSystemPickerBackground, keys: ["", "", "S"]
25+
),
2226
]
2327

2428
private let actionRow: [ShortcutEntry] = [
2529
ShortcutEntry(title: PikaText.textColorUndo, notificationName: .triggerUndo, keys: ["", "z"]),
2630
ShortcutEntry(title: PikaText.textColorRedo, notificationName: .triggerRedo, keys: ["", "", "Z"]),
2731
ShortcutEntry(title: PikaText.textColorSwapDetail, notificationName: .triggerSwap, keys: ["X"]),
2832
ShortcutEntry(
29-
title: "\(PikaText.textMenuPreferences)...", notificationName: .triggerPreferences, keys: ["", ","]),
33+
title: "\(PikaText.textMenuPreferences)...", notificationName: .triggerPreferences, keys: ["", ","]
34+
),
3035
ShortcutEntry(title: PikaText.textMenuQuit, notificationName: .triggerQuit, keys: ["", "Q"]),
3136
]
3237

0 commit comments

Comments
 (0)