Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Every word and button on Home reads clearly in every appearance

Țugui Dragoșd08f902326a6
diff --git a/Peel/Assets.xcassets/InkOnOrange.colorset/Contents.json b/Peel/Assets.xcassets/InkOnOrange.colorset/Contents.json
new file mode 100644
index 00000000..969cacd7
--- /dev/null
+++ b/Peel/Assets.xcassets/InkOnOrange.colorset/Contents.json
@@ -0,0 +1,78 @@
+{
+ "colors": [
+ {
+ "color": {
+ "color-space": "display-p3",
+ "components": {
+ "alpha": "1.000",
+ "red": "0.190",
+ "green": "0.180",
+ "blue": "0.170"
+ }
+ },
+ "idiom": "universal"
+ },
+ {
+ "color": {
+ "color-space": "display-p3",
+ "components": {
+ "alpha": "1.000",
+ "red": "1.000",
+ "green": "1.000",
+ "blue": "1.000"
+ }
+ },
+ "idiom": "universal",
+ "appearances": [
+ {
+ "appearance": "contrast",
+ "value": "high"
+ }
+ ]
+ },
+ {
+ "color": {
+ "color-space": "display-p3",
+ "components": {
+ "alpha": "1.000",
+ "red": "0.190",
+ "green": "0.180",
+ "blue": "0.170"
+ }
+ },
+ "idiom": "universal",
+ "appearances": [
+ {
+ "appearance": "luminosity",
+ "value": "dark"
+ }
+ ]
+ },
+ {
+ "color": {
+ "color-space": "display-p3",
+ "components": {
+ "alpha": "1.000",
+ "red": "0.190",
+ "green": "0.180",
+ "blue": "0.170"
+ }
+ },
+ "idiom": "universal",
+ "appearances": [
+ {
+ "appearance": "luminosity",
+ "value": "dark"
+ },
+ {
+ "appearance": "contrast",
+ "value": "high"
+ }
+ ]
+ }
+ ],
+ "info": {
+ "author": "xcode",
+ "version": 1
+ }
+}
diff --git a/Peel/Assets.xcassets/PeelOrangeInk.colorset/Contents.json b/Peel/Assets.xcassets/PeelOrangeInk.colorset/Contents.json
new file mode 100644
index 00000000..403a3c8b
--- /dev/null
+++ b/Peel/Assets.xcassets/PeelOrangeInk.colorset/Contents.json
@@ -0,0 +1,78 @@
+{
+ "colors": [
+ {
+ "color": {
+ "color-space": "srgb",
+ "components": {
+ "alpha": "1.000",
+ "red": "0.690",
+ "green": "0.290",
+ "blue": "0.000"
+ }
+ },
+ "idiom": "universal"
+ },
+ {
+ "color": {
+ "color-space": "srgb",
+ "components": {
+ "alpha": "1.000",
+ "red": "0.541",
+ "green": "0.224",
+ "blue": "0.000"
+ }
+ },
+ "idiom": "universal",
+ "appearances": [
+ {
+ "appearance": "contrast",
+ "value": "high"
+ }
+ ]
+ },
+ {
+ "color": {
+ "color-space": "display-p3",
+ "components": {
+ "alpha": "1.000",
+ "red": "1.000",
+ "green": "0.600",
+ "blue": "0.200"
+ }
+ },
+ "idiom": "universal",
+ "appearances": [
+ {
+ "appearance": "luminosity",
+ "value": "dark"
+ }
+ ]
+ },
+ {
+ "color": {
+ "color-space": "display-p3",
+ "components": {
+ "alpha": "1.000",
+ "red": "1.000",
+ "green": "0.750",
+ "blue": "0.450"
+ }
+ },
+ "idiom": "universal",
+ "appearances": [
+ {
+ "appearance": "luminosity",
+ "value": "dark"
+ },
+ {
+ "appearance": "contrast",
+ "value": "high"
+ }
+ ]
+ }
+ ],
+ "info": {
+ "author": "xcode",
+ "version": 1
+ }
+}
diff --git a/Peel/Assets.xcassets/PeelRed.colorset/Contents.json b/Peel/Assets.xcassets/PeelRed.colorset/Contents.json
new file mode 100644
index 00000000..d8b17215
--- /dev/null
+++ b/Peel/Assets.xcassets/PeelRed.colorset/Contents.json
@@ -0,0 +1,78 @@
+{
+ "colors": [
+ {
+ "color": {
+ "color-space": "srgb",
+ "components": {
+ "alpha": "1.000",
+ "red": "0.843",
+ "green": "0.000",
+ "blue": "0.082"
+ }
+ },
+ "idiom": "universal"
+ },
+ {
+ "color": {
+ "color-space": "srgb",
+ "components": {
+ "alpha": "1.000",
+ "red": "0.690",
+ "green": "0.000",
+ "blue": "0.059"
+ }
+ },
+ "idiom": "universal",
+ "appearances": [
+ {
+ "appearance": "contrast",
+ "value": "high"
+ }
+ ]
+ },
+ {
+ "color": {
+ "color-space": "srgb",
+ "components": {
+ "alpha": "1.000",
+ "red": "1.000",
+ "green": "0.498",
+ "blue": "0.471"
+ }
+ },
+ "idiom": "universal",
+ "appearances": [
+ {
+ "appearance": "luminosity",
+ "value": "dark"
+ }
+ ]
+ },
+ {
+ "color": {
+ "color-space": "srgb",
+ "components": {
+ "alpha": "1.000",
+ "red": "1.000",
+ "green": "0.647",
+ "blue": "0.624"
+ }
+ },
+ "idiom": "universal",
+ "appearances": [
+ {
+ "appearance": "luminosity",
+ "value": "dark"
+ },
+ {
+ "appearance": "contrast",
+ "value": "high"
+ }
+ ]
+ }
+ ],
+ "info": {
+ "author": "xcode",
+ "version": 1
+ }
+}
diff --git a/Peel/Assets.xcassets/PeelRedFill.colorset/Contents.json b/Peel/Assets.xcassets/PeelRedFill.colorset/Contents.json
new file mode 100644
index 00000000..364eb237
--- /dev/null
+++ b/Peel/Assets.xcassets/PeelRedFill.colorset/Contents.json
@@ -0,0 +1,78 @@
+{
+ "colors": [
+ {
+ "color": {
+ "color-space": "srgb",
+ "components": {
+ "alpha": "1.000",
+ "red": "0.843",
+ "green": "0.000",
+ "blue": "0.082"
+ }
+ },
+ "idiom": "universal"
+ },
+ {
+ "color": {
+ "color-space": "srgb",
+ "components": {
+ "alpha": "1.000",
+ "red": "0.690",
+ "green": "0.000",
+ "blue": "0.059"
+ }
+ },
+ "idiom": "universal",
+ "appearances": [
+ {
+ "appearance": "contrast",
+ "value": "high"
+ }
+ ]
+ },
+ {
+ "color": {
+ "color-space": "srgb",
+ "components": {
+ "alpha": "1.000",
+ "red": "0.843",
+ "green": "0.000",
+ "blue": "0.082"
+ }
+ },
+ "idiom": "universal",
+ "appearances": [
+ {
+ "appearance": "luminosity",
+ "value": "dark"
+ }
+ ]
+ },
+ {
+ "color": {
+ "color-space": "srgb",
+ "components": {
+ "alpha": "1.000",
+ "red": "0.690",
+ "green": "0.000",
+ "blue": "0.059"
+ }
+ },
+ "idiom": "universal",
+ "appearances": [
+ {
+ "appearance": "luminosity",
+ "value": "dark"
+ },
+ {
+ "appearance": "contrast",
+ "value": "high"
+ }
+ ]
+ }
+ ],
+ "info": {
+ "author": "xcode",
+ "version": 1
+ }
+}
diff --git a/Peel/Navigation/ToolSidebar.swift b/Peel/Navigation/ToolSidebar.swift
index 265471e8..6c4488b3 100644
--- a/Peel/Navigation/ToolSidebar.swift
+++ b/Peel/Navigation/ToolSidebar.swift
@@ -232,10 +232,11 @@ struct ToolSidebar: View {
/// The red badge that marks a missing required permission, beside Home in the sidebar and on Home itself.
struct AttentionBadge: View {
var size: CGFloat = 16
+ var fill: Color = .red
var body: some View {
RoundedRectangle(cornerRadius: size / 4, style: .continuous)
- .fill(.red)
+ .fill(fill)
.frame(width: size, height: size)
.overlay(
Image(systemName: "exclamationmark")
diff --git a/Peel/Views/Home/HomeDeviceCard.swift b/Peel/Views/Home/HomeDeviceCard.swift
index 3fb0d326..20ae1e5a 100644
--- a/Peel/Views/Home/HomeDeviceCard.swift
+++ b/Peel/Views/Home/HomeDeviceCard.swift
@@ -10,6 +10,8 @@ struct DeviceSticker: View {
let label: LocalizedStringResource
let fill: Color
let ink: Color
+ /// The label is quieter than the value, except on the orange sticker, where it would be too faint to read.
+ var labelOpacity = 0.7
let width: CGFloat
let radius: CGFloat
let angle: Double
@@ -51,7 +53,7 @@ struct DeviceSticker: View {
(proxy.bounds(of: .named(Self.space))?.height ?? 0) - proxy.frame(in: .named(Self.space)).maxY
} action: { labelRise = $0 }
.padding(.horizontal, 5 + curveRoom / 2)
- .opacity(0.7)
+ .opacity(labelOpacity)
.background { LongestWord(text: String(localized: label), width: $longestWord).font(Self.labelFont) }
}
.foregroundStyle(ink)
diff --git a/Peel/Views/Home/HomePermissionsView.swift b/Peel/Views/Home/HomePermissionsView.swift
index 582154be..fcd1baca 100644
--- a/Peel/Views/Home/HomePermissionsView.swift
+++ b/Peel/Views/Home/HomePermissionsView.swift
@@ -49,7 +49,7 @@ struct HomePermissionsContent: View {
named title: LocalizedStringResource,
tapedAt corner: Alignment,
fill: Color = Album.orange,
- ink: Color = .white
+ ink: Color = Album.onOrange
) -> some View {
Grid(alignment: .leading, horizontalSpacing: 12, verticalSpacing: 0) {
ForEach(Array(permissions.enumerated()), id: \.element.id) { index, permission in
@@ -91,7 +91,7 @@ struct HomePermissionsContent: View {
}
Text(home.status(of: permission))
.font(.system(size: 11.5, weight: .medium))
- .foregroundStyle(state.isMissing ? Color.red : .secondary)
+ .foregroundStyle(state.isMissing ? Album.red : .secondary)
.fixedSize(horizontal: false, vertical: true)
}
}
@@ -111,7 +111,7 @@ struct HomePermissionsContent: View {
let isPointedAt = pointingAt == permission
Button { reveal(permission) } label: {
title
- .foregroundStyle(state.isMissing ? Color.red : isPointedAt ? Album.orange : Album.ink)
+ .foregroundStyle(state.isMissing ? Album.red : isPointedAt ? Album.orangeInk : Album.ink)
.underline(isPointedAt, pattern: .solid)
.minimumTarget()
}
@@ -121,7 +121,7 @@ struct HomePermissionsContent: View {
.onHover { pointingAt = $0 ? permission : nil }
.help(Text("Show \(String(localized: permission.title)) in System Settings"))
} else {
- title.foregroundStyle(state.isMissing ? Color.red : Album.ink)
+ title.foregroundStyle(state.isMissing ? Album.red : Album.ink)
}
}
@@ -151,7 +151,7 @@ struct HomePermissionsContent: View {
Text(action)
.keepsWordsWhole(String(localized: action))
}
- .buttonStyle(state.isMissing ? .sticker(fill: .red, size: 11.5) : .stickerQuiet)
+ .buttonStyle(state.isMissing ? .sticker(fill: Album.redFill, size: 11.5) : .stickerQuiet)
.accessibilityLabel(Text("\(String(localized: action)): \(String(localized: permission.title))", comment: "What VoiceOver reads for a button. The first %@ is the action, such as Install. The second is what it acts on, such as Helper."))
}
} else {
@@ -173,15 +173,15 @@ struct HomePermissionsContent: View {
// Any state but on is a flat, filled circle, not a dashed ring, which would look unfinished.
// On is a raised sticker with an edge and a shadow, so the two stay easy to tell apart.
Circle()
- .fill(state.isMissing ? Color.red.opacity(0.16) : Album.slot)
+ .fill(state.isMissing ? Album.red.opacity(0.16) : Album.slot)
.overlay(
Image(systemName: permission.symbol)
.font(.system(size: 14, weight: .semibold))
- .foregroundStyle(state.isMissing ? Color.red : Color.secondary)
+ .foregroundStyle(state.isMissing ? Album.red : Color.secondary)
)
}
if state.isMissing {
- AttentionBadge().offset(x: 3, y: -3)
+ AttentionBadge(fill: Album.redFill).offset(x: 3, y: -3)
}
}
.frame(width: Self.markSize, height: Self.markSize)
@@ -199,7 +199,7 @@ struct HomePermissionsContent: View {
) {
if home.needsRelaunchForFullDiskAccess {
Button("Reopen Peel") { home.relaunch() }
- .buttonStyle(.sticker(fill: .red, size: 11.5))
+ .buttonStyle(.sticker(fill: Album.redFill, size: 11.5))
}
}
} else if exclusions.exclusions.isUnreadable {
@@ -211,7 +211,7 @@ struct HomePermissionsContent: View {
SettingsLink {
Text("Open Peel Settings")
}
- .buttonStyle(.sticker(fill: .red, size: 11.5))
+ .buttonStyle(.sticker(fill: Album.redFill, size: 11.5))
}
} else if !home.waitingRequired.isEmpty, home.hasChecked {
// A required permission that is still pending is not set up. For example, a helper waiting for
@@ -249,7 +249,7 @@ struct HomePermissionsContent: View {
private func colors(for permission: HomeModel.Permission) -> (fill: Color, ink: Color) {
switch permission {
case .fullDiskAccess: (Album.charcoal, .white)
- case .helper: (Album.orange, .white)
+ case .helper: (Album.orange, Album.onOrange)
case .appManagement: (Album.cream, Album.orange)
default: (Album.cream, Album.charcoal)
}
diff --git a/Peel/Views/Home/HomeView.swift b/Peel/Views/Home/HomeView.swift
index f559d72a..0dafb02e 100644
--- a/Peel/Views/Home/HomeView.swift
+++ b/Peel/Views/Home/HomeView.swift
@@ -100,7 +100,7 @@ struct HomeContent: View {
}
Text(verbatim: device.model)
.font(.system(size: 17, weight: .bold, design: .rounded))
- .foregroundStyle(isPointingAtDevice ? Album.orange : Album.ink)
+ .foregroundStyle(isPointingAtDevice ? Album.orangeInk : Album.ink)
.lineLimit(1)
.minimumScaleFactor(0.7)
}
@@ -117,7 +117,7 @@ struct HomeContent: View {
/// removal is shown only in the menu bar panel, since a fourth sticker doesn't fit the column.
private var totals: some View {
HStack(spacing: 10) {
- DeviceSticker(value: stats.bytesFreed.text, amount: Double(stats.bytesFreed.known), label: "Moved to Trash", fill: Album.orange, ink: .white, width: 86, radius: 16, angle: -3)
+ DeviceSticker(value: stats.bytesFreed.text, amount: Double(stats.bytesFreed.known), label: "Moved to Trash", fill: Album.orange, ink: Album.onOrange, labelOpacity: 1, width: 86, radius: 16, angle: -3)
DeviceSticker(
value: stats.appsRemoved.shortCount,
amount: Double(stats.appsRemoved),
diff --git a/Peel/Views/InfoNote.swift b/Peel/Views/InfoNote.swift
index e3204854..35a798eb 100644
--- a/Peel/Views/InfoNote.swift
+++ b/Peel/Views/InfoNote.swift
@@ -108,7 +108,7 @@ struct NoteCard: View {
/// Home keeps the album's orange; everywhere else a note takes the accent color the user chose.
private func noteTint(isAlbum: Bool) -> Color {
- isAlbum ? Album.orange : .accentColor
+ isAlbum ? Album.orangeInk : .accentColor
}
/// A section's heading, with a note beside it holding what would otherwise be a paragraph under it.
diff --git a/Peel/Views/MenuBarPanel.swift b/Peel/Views/MenuBarPanel.swift
index 8aa9b150..8427e4da 100644
--- a/Peel/Views/MenuBarPanel.swift
+++ b/Peel/Views/MenuBarPanel.swift
@@ -145,7 +145,7 @@ struct MenuBarPanel: View {
HStack(spacing: Self.iconSpacing) {
Image(systemName: symbol)
.font(.system(size: 15))
- .foregroundStyle(Album.orange)
+ .foregroundStyle(Album.orangeInk)
.frame(width: Self.iconWidth)
label
.font(.system(size: 13.5, weight: .semibold, design: .rounded))
@@ -155,7 +155,7 @@ struct MenuBarPanel: View {
.monospacedDigit()
.contentTransition(.numericText(value: Double(amount)))
.motion(value: value)
- .foregroundStyle(isAccented ? Album.orange : .primary)
+ .foregroundStyle(isAccented ? Album.orangeInk : .primary)
if leadsSomewhere {
Image(systemName: "chevron.right")
.font(.subheadline.weight(.semibold))
diff --git a/Peel/Views/Notice.swift b/Peel/Views/Notice.swift
index 08b7b37a..6783db54 100644
--- a/Peel/Views/Notice.swift
+++ b/Peel/Views/Notice.swift
@@ -75,7 +75,7 @@ struct Notice<Actions: View>: View {
/// Only a problem gets a colored title, in red. Orange text is too faint to read, and gray would look
/// like the detail line under it.
private var titleColor: Color {
- guard kind != .problem else { return .red }
+ guard kind != .problem else { return isAlbum ? Album.red : .red }
return isAlbum ? Album.ink : .primary
}
@@ -94,7 +94,7 @@ struct Notice<Actions: View>: View {
// for problems.
let isQuiet = kind != .problem
RoundedRectangle(cornerRadius: 6, style: .continuous)
- .fill(isQuiet ? Album.slot : .red)
+ .fill(isQuiet ? Album.slot : Album.redFill)
.frame(width: 26, height: 26)
.overlay(
Image(systemName: isQuiet ? "info" : "exclamationmark")
diff --git a/Peel/Views/Stickers/StickerControls.swift b/Peel/Views/Stickers/StickerControls.swift
index 852192db..83a4c00c 100644
--- a/Peel/Views/Stickers/StickerControls.swift
+++ b/Peel/Views/Stickers/StickerControls.swift
@@ -4,7 +4,7 @@ import SwiftUI
struct TapeHeader: View {
let title: Text
var fill: Color = Album.orange
- var ink: Color = .white
+ var ink: Color = Album.onOrange
var angle: Double = 0
var body: some View {
diff --git a/Peel/Views/Stickers/StickerStyle.swift b/Peel/Views/Stickers/StickerStyle.swift
index f3c6d705..28e79a93 100644
--- a/Peel/Views/Stickers/StickerStyle.swift
+++ b/Peel/Views/Stickers/StickerStyle.swift
@@ -17,6 +17,14 @@ enum Album {
static let slot = Color(.slot)
static let shadow = Color(.stickerShadow)
static let quietFill = Color(.quietFill)
+ /// The red of words and marks for what is missing, readable on a sticker in every appearance, which the system
+ /// red is not. A red sticker under white ink takes `redFill`: in dark, no one red serves both.
+ static let red = Color(.peelRed)
+ static let redFill = Color(.peelRedFill)
+ /// Orange for words and marks on the paper, where the brand orange is too light to read. The logo keeps `orange`.
+ static let orangeInk = Color(.peelOrangeInk)
+ /// Words and marks drawn on `orange`: dark, and white where Increase Contrast darkens the orange.
+ static let onOrange = Color(.inkOnOrange)
}
/// Draws content as a sticker: a body, a die-cut edge, and a short shadow. In the light appearance the white edge