-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathConstants.swift
More file actions
309 lines (276 loc) · 16.1 KB
/
Copy pathConstants.swift
File metadata and controls
309 lines (276 loc) · 16.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
import Defaults
import KeyboardShortcuts
import SwiftUI
// swiftlint:disable trailing_comma
// swiftlint:disable line_length
extension KeyboardShortcuts.Name {
static let togglePika = Self("togglePika")
}
enum PikaConstants {
// Release URL
static func url() -> String {
Defaults[.betaUpdates]
? "https://superhighfives.com/releases/pika/betas"
: "https://superhighfives.com/releases/pika"
}
static let pikaWebsiteURL = "https://superhighfives.com/pika"
static let gitHubRepoURL = "https://github.com/superhighfives/pika"
static let gitHubIssueURL = "https://github.com/superhighfives/pika/issues/new/choose"
static let charlieGleasonWebsiteURL = "https://charliegleason.com"
// Initial colors
static let initialColors = [
NSColor(r: 143.0, g: 15.0, b: 208.0),
NSColor(r: 224.0, g: 53.0, b: 139.0),
NSColor(r: 20.0, g: 63.0, b: 245.0),
NSColor(r: 235.0, g: 54.0, b: 75.0),
NSColor(r: 182.0, g: 26.0, b: 129.0),
NSColor(r: 88.0, g: 32.0, b: 228.0),
NSColor(r: 191.0, g: 19.0, b: 186.0),
NSColor(r: 119.0, g: 77.0, b: 178.0),
NSColor(r: 14.0, g: 35.0, b: 204.0),
NSColor(r: 188.0, g: 42.0, b: 97.0),
]
// Notification Center constants
static let ncTriggerCopyForeground = "triggerCopyForeground"
static let ncTriggerCopyBackground = "triggerCopyBackground"
static let ncTriggerCopyText = "triggerCopyText"
static let ncTriggerCopyData = "triggerCopyData"
static let ncTriggerPickForeground = "triggerPickForeground"
static let ncTriggerPickBackground = "triggerPickBackground"
static let ncTriggerSystemPickerForeground = "triggerSystemPickerForeground"
static let ncTriggerSystemPickerBackground = "triggerSystemPickerBackground"
static let ncTriggerSwap = "triggerSwap"
static let ncTriggerUndo = "triggerUndo"
static let ncTriggerRedo = "triggerRedo"
static let ncTriggerPreferences = "triggerPreferences"
static let ncTriggerFormatHex = "triggerFormatHex"
static let ncTriggerFormatRGB = "triggerFormatRGB"
static let ncTriggerFormatHSB = "triggerFormatHSB"
static let ncTriggerFormatHSL = "triggerFormatHSL"
static let ncTriggerFormatOpenGL = "triggerFormatOpenGL"
static let ncTriggerFormatLAB = "triggerFormatLAB"
static let ncTriggerFormatOKLCH = "triggerFormatOKLCH"
static let ncTriggerQuit = "triggerQuit"
// Disabled formats for SwiftUI copy format
static let disabledFormats: [ColorFormat] = [.hex, .hsl, .opengl, .lab, .oklch]
}
extension Notification.Name {
static let triggerPickForeground = Notification.Name(PikaConstants.ncTriggerPickForeground)
static let triggerPickBackground = Notification.Name(PikaConstants.ncTriggerPickBackground)
static let triggerCopyForeground = Notification.Name(PikaConstants.ncTriggerCopyForeground)
static let triggerCopyBackground = Notification.Name(PikaConstants.ncTriggerCopyBackground)
static let triggerCopyText = Notification.Name(PikaConstants.ncTriggerCopyText)
static let triggerCopyData = Notification.Name(PikaConstants.ncTriggerCopyData)
static let triggerSystemPickerForeground = Notification.Name(PikaConstants.ncTriggerSystemPickerForeground)
static let triggerSystemPickerBackground = Notification.Name(PikaConstants.ncTriggerSystemPickerBackground)
static let triggerSwap = Notification.Name(PikaConstants.ncTriggerSwap)
static let triggerUndo = Notification.Name(PikaConstants.ncTriggerUndo)
static let triggerRedo = Notification.Name(PikaConstants.ncTriggerRedo)
static let triggerPreferences = Notification.Name(PikaConstants.ncTriggerPreferences)
static let triggerFormatHex = Notification.Name(PikaConstants.ncTriggerFormatHex)
static let triggerFormatRGB = Notification.Name(PikaConstants.ncTriggerFormatRGB)
static let triggerFormatHSB = Notification.Name(PikaConstants.ncTriggerFormatHSB)
static let triggerFormatHSL = Notification.Name(PikaConstants.ncTriggerFormatHSL)
static let triggerFormatOpenGL = Notification.Name(PikaConstants.ncTriggerFormatOpenGL)
static let triggerFormatLAB = Notification.Name(PikaConstants.ncTriggerFormatLAB)
static let triggerFormatOKLCH = Notification.Name(PikaConstants.ncTriggerFormatOKLCH)
static let triggerQuit = Notification.Name(PikaConstants.ncTriggerQuit)
}
enum PikaText {
static let textAppName = NSLocalizedString("app.name", comment: "Pika")
/*
* Colors
*/
static let textColorForeground = NSLocalizedString("color.foreground", comment: "Foreground")
static let textColorBackground = NSLocalizedString("color.background", comment: "Background")
static let textColorPass = NSLocalizedString("color.wcag.pass", comment: "Pass")
static let textColorFail = NSLocalizedString("color.wcag.fail", comment: "Fail")
static let textColorRatio = NSLocalizedString("color.ratio", comment: "Contrast Ratio")
static let textColorRatioDescription = NSLocalizedString("color.ratio.description", comment: "Contrast ratio is a measure of the difference in perceived brightness between two colors, used to calculate the contrast ratio.")
static let textLightnessContrastValue = NSLocalizedString("color.lc", comment: "Lightness Contrast Level")
static let textLightnessContrastValueDescription = NSLocalizedString("color.lc.description", comment: "Lightness contrast (Lc) is a measure of the lightness difference between two colors, used to calculate the contrast value.")
static let textColorWCAG = NSLocalizedString("color.wcag", comment: "WCAG Compliance")
static let textColorAPCA = NSLocalizedString("color.apca", comment: "APCA Compliance")
static let textColorWCAG30 = NSLocalizedString("color.wcag.30", comment: "WCAG 3:1")
static let textColorWCAG45 = NSLocalizedString("color.wcag.45", comment: "WCAG 4.5:1")
static let textColorWCAG70 = NSLocalizedString("color.wcag.70", comment: "WCAG 7:1")
static let textColorSwap = NSLocalizedString("color.swap", comment: "Swap")
static let textColorSwapDetail = NSLocalizedString("color.swap.detail", comment: "Swap colors")
static let textColorUndo = NSLocalizedString("color.undo", comment: "Undo")
static let textColorRedo = NSLocalizedString("color.redo", comment: "Redo")
static let textColorCopy = NSLocalizedString("color.copy", comment: "Copy")
static let textColorSystemPicker = NSLocalizedString("color.system", comment: "System picker")
static let textColorCopied = NSLocalizedString("color.copy.toast", comment: "Copied")
/*
* Menu
*/
static let textMenuAbout = NSLocalizedString("menu.about", comment: "About")
static let textMenuUpdates = NSLocalizedString("menu.updates", comment: "Check for updates")
static let textMenuPreferences = NSLocalizedString("menu.preferences", comment: "Preferences")
static let textMenuWebsite = NSLocalizedString("menu.website", comment: "Pika website")
static let textMenuGitHubIssue = NSLocalizedString("menu.issue", comment: "Report feedback")
static let textMenuQuit = NSLocalizedString("menu.quit", comment: "Quit Pika")
// Navigation
static let textMenuCopyAllAsText = NSLocalizedString("color.copy.text", comment: "Copy all as text")
static let textMenuCopyAllAsJSON = NSLocalizedString("color.copy.data", comment: "Copy all as JSON")
/*
* Touchbar
*/
static let textColorNormal = NSLocalizedString("color.wcag.normal", comment: "Normal")
static let textColorLargeAbbr = NSLocalizedString("color.wcag.large.abbr", comment: "LG")
static let textColorLarge = NSLocalizedString("color.wcag.large", comment: "Large")
/*
* Splash
*/
static let textSplashLaunch = NSLocalizedString("splash.hotkey", comment: "Global shortcut")
static let textSplashHotkey = NSLocalizedString("splash.launch", comment: "Launch at login")
static let textSplashStart = NSLocalizedString("splash.start", comment: "Get started")
/*
* About
*/
static let textAboutWebsite = NSLocalizedString("app.website", comment: "Website")
static let textAboutGitHub = NSLocalizedString("app.github", comment: "GitHub")
static let textAboutBy = NSLocalizedString("app.designed", comment: "Designed by")
static let textAboutVersion = NSLocalizedString("app.version", comment: "Version")
static let textAboutBuild = NSLocalizedString("app.build", comment: "Build")
static let textAboutUnknown = NSLocalizedString("app.unknown", comment: "Unknown")
static let textAboutMacAppStore = NSLocalizedString("app.store.mas", comment: "Mac App Store")
static let textAboutDownloaded = NSLocalizedString("app.store.download", comment: "Downloaded from the internet")
// APCA Compliance Labels
static let textAPCABaseline = NSLocalizedString("color.apca.baseline", comment: "Baseline")
static let textAPCAHeadline = NSLocalizedString("color.apca.headline", comment: "Headline")
static let textAPCATitle = NSLocalizedString("color.apca.title", comment: "Title")
static let textAPCABody = NSLocalizedString("color.apca.body", comment: "Body Text")
// APCA Tooltips
static let textColorAPCA30 = NSLocalizedString("color.apca.30", comment: "APCA ≥30")
static let textColorAPCA45 = NSLocalizedString("color.apca.45", comment: "APCA ≥45")
static let textColorAPCA60 = NSLocalizedString("color.apca.60", comment: "APCA ≥60")
static let textColorAPCA75 = NSLocalizedString("color.apca.75", comment: "APCA ≥75")
// Keyboard shortcuts
static let textPickForeground = NSLocalizedString("color.pick.foreground", comment: "Pick foreground")
static let textPickBackground = NSLocalizedString("color.pick.background", comment: "Pick background")
static let textCopyForeground = NSLocalizedString("color.copy.foreground", comment: "Copy foreground")
static let textCopyBackground = NSLocalizedString("color.copy.background", comment: "Copy background")
static let textColorSystemPickerForeground = NSLocalizedString(
"color.system.foreground",
comment: "Use foreground system color picker"
)
static let textColorSystemPickerBackground = NSLocalizedString(
"color.system.background",
comment: "Use background system color picker"
)
static let textColorSystemPickerForegroundSimple = NSLocalizedString(
"color.system.foreground.simple",
comment: "System foreground"
)
static let textColorSystemPickerBackgroundSimple = NSLocalizedString(
"color.system.background.simple",
comment: "System background"
)
/*
* Preferences
*/
// General Settings
static let textGeneralTitle = NSLocalizedString("preferences.general.title", comment: "General Settings")
static let textLaunchDescription = NSLocalizedString(
"preferences.launch.description",
comment: "Launch at login"
)
static let textBetaDescription = NSLocalizedString(
"preferences.beta.description",
comment: "Subscribe to beta releases"
)
static let textSelectionTitle = NSLocalizedString("preferences.selection.title", comment: "Selection Settings")
static let textPickHide = NSLocalizedString("preferences.pick.hide", comment: "Hide Pika while picking")
static let textIconDescription = NSLocalizedString(
"preferences.icon.description",
comment: "Hide menu bar icon"
)
static let textColorNamesDescription = NSLocalizedString(
"preferences.names.description",
comment: "Hide color names"
)
static let textFloatDescription = NSLocalizedString(
"preferences.float.description",
comment: "Float above windows"
)
static let textAlwaysShowOnLaunch = NSLocalizedString(
"preferences.show.description",
comment: "Always show Pika on launch"
)
// App Settings
static let textAppTitle = NSLocalizedString("preferences.app.title", comment: "App Settings")
static let textAppMenubarTitle = NSLocalizedString("preferences.app.menubar.title", comment: "Menu bar")
static let textAppMenubarDescription = NSLocalizedString(
"preferences.app.menubar.description", comment: "Show in menu bar"
)
static let textAppDockTitle = NSLocalizedString("preferences.app.dock.title", comment: "Dock")
static let textAppDockDescription = NSLocalizedString("preferences.app.dock.description", comment: "Show in dock")
static let textAppHiddenTitle = NSLocalizedString("preferences.app.hidden.title", comment: "Hidden")
static let textAppHiddenDescription = NSLocalizedString("preferences.app.hidden.description", comment: "Hide app")
// Appearance Settings
static let textAppearanceTitle = NSLocalizedString("preferences.appearance.title", comment: "Appearance")
static let textAppearanceWeightTitle = NSLocalizedString("preferences.appearance.weight.title", comment: "Weight")
static let textAppearanceWeightDescription = NSLocalizedString(
"preferences.appearance.weight.description",
comment: "View WCAG compliance by weight, from normal to large"
)
static let textAppearanceContrastTitle = NSLocalizedString(
"preferences.appearance.contrast.title",
comment: "Contrast"
)
static let textAppearanceContrastDescription = NSLocalizedString(
"preferences.appearance.contrast.description",
comment: "View WCAG compliance by contrast, from 3:1 to 7:1"
)
static let textAppearanceAPCATitle = NSLocalizedString(
"preferences.appearance.apca.title",
comment: "Contrast Value"
)
static let textAppearanceAPCADescription = NSLocalizedString(
"preferences.appearance.apca.description",
comment: "View APCA contrast value by lightness contrast (Lc), from 30 to 75"
)
static let textContrastStandard = NSLocalizedString(
"preferences.contrast.standard",
comment: "Contrast Standard"
)
// Copy Settings
static let textCopyTitle = NSLocalizedString("preferences.copy.title", comment: "Copy Settings")
static let textCopyExport = NSLocalizedString("preferences.copy.export", comment: "Export color for")
static let textCopyExportExample = NSLocalizedString("preferences.copy.export.example", comment: "Export example")
static let textCopyFormat = NSLocalizedString("preferences.copy.format", comment: "Export Format")
static let textCopyAutomatic = NSLocalizedString(
"preferences.copy.automatic",
comment: "Automatically copy color to clipboard on pick"
)
// Color Format
static let textFormatTitle = NSLocalizedString("preferences.format.title", comment: "Color Format")
static let textFormatDescription = NSLocalizedString(
"preferences.space.description",
comment: "Set your RGB color space"
)
static let textSpaceTitle = NSLocalizedString("preferences.space.title", comment: "Color Space")
static let textSystemDefault = NSLocalizedString("preferences.space.default", comment: "System Default")
static let textFormatHex = NSLocalizedString("color.format.hex", comment: "Hex format")
static let textFormatRGB = NSLocalizedString("color.format.rgb", comment: "RGB format")
static let textFormatHSL = NSLocalizedString("color.format.hsl", comment: "HSL format")
static let textFormatHSB = NSLocalizedString("color.format.hsb", comment: "HSB format")
static let textFormatOpenGL = NSLocalizedString("color.format.opengl", comment: "OpenGL format")
static let textFormatLAB = NSLocalizedString("color.format.lab", comment: "LAB format")
static let textFormatOKLCH = NSLocalizedString("color.format.oklch", comment: "OKLCH format")
// Global Shortcut
static let textHotkeyTitle = NSLocalizedString("preferences.hotkey.title", comment: "Global Shortcut")
static let textHotkeyDescription = NSLocalizedString(
"preferences.hotkey.description",
comment: "Set a global hotkey shortcut to invoke Pika"
)
// Color Overlay
static let textShowColorOverlay = NSLocalizedString(
"preferences.overlay.show",
comment: "Show color overlay after picking"
)
static let textDuration = NSLocalizedString("preferences.overlay.duration", comment: "Duration:")
}
// swiftlint:enable trailing_comma
// swiftlint:enable line_length