Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions BeeKit/GoalExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,18 @@ extension Goal {
}

public var countdownColor :UIColor {
let buf = self.safeBuf
if buf < 1 {
return UIColor.Beeminder.red
switch self.safeBuf {
case ..<1:
return UIColor.Beeminder.SafetyBuffer.red
case ..<2:
return UIColor.Beeminder.SafetyBuffer.orange
case ..<3:
return UIColor.Beeminder.SafetyBuffer.blue
case ..<7:
return UIColor.Beeminder.SafetyBuffer.green
default:
return UIColor.Beeminder.SafetyBuffer.forestGreen
}
else if buf < 2 {
return UIColor.Beeminder.orange
}
else if buf < 3 {
return UIColor.Beeminder.blue
}
return UIColor.Beeminder.green
}

public var hideDataEntry: Bool {
Expand Down
17 changes: 9 additions & 8 deletions BeeKit/UI/UIColorExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@ import UIKit
extension UIColor {

public struct Beeminder {
public static let green = UIColor(red: 81.0/255.0,
green: 163.0/255.0,
blue: 81.0/255.0,
alpha: 1)

public static let blue: UIColor = .systemBlue
public static let orange: UIColor = .systemOrange
public static let red: UIColor = .systemRed

public static let gray = UIColor(white: 0.7, alpha: 1.0)
public static let gray = UIColor.systemGray
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is a somewhat darker color than the previous one (more like white: 0.5). Was that deliberate?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The system gray one will adapt to the device's environment whereas the white 0.7 with alpha 1.0 one will not.
And since the app does not use the exact same colors the website uses for the dots, picking something easier to read (better contrast) instead, this MR does the same with the gray.

before

before - buttons-white0 7-on-dark
before - buttons-white0 7-on-light
before - last updated-white0 7-on-dark
before - last updated-white0 7-on-light

after

after - buttons-systemgray-on-dark
after - buttons-systemgray-on-light
after - last updated-systemgray-on-dark
after - last updated-systemgray-on-light

Copy link
Copy Markdown
Collaborator

@theospears theospears Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The system gray one will adapt to the device's environment

I agree this is true in abstract, and for most system colors. It turns out systemGray is the same in both dark mode and light mode.

I'm not convinced having this universal gray really makes sense (e.g. perhaps backgrounds should be closer to the background color than borders are), but that seems like a problem for another day.


public static let yellow = UIColor(red: 255.0/255.0,
green: 217.0/255.0,
blue: 17.0/255.0,
alpha: 1)

public struct SafetyBuffer {
public static let red: UIColor = .systemRed // .init(red: 1, green: 0, blue: 0, alpha: 1)
public static let orange: UIColor = .systemOrange // .init(red: 1, green: 165/255.0, blue: 00, alpha: 1)
public static let blue: UIColor = .systemBlue // .init(red: 63/255.0, green: 63/255.0, blue: 1, alpha: 1)
public static let green: UIColor = .systemGreen // .init(red: 0, green: 170/255.0, blue: 0, alpha: 1)
public static let forestGreen: UIColor = .init(red: 34/255.0, green: 139/255.0, blue: 34/255.0, alpha: 1)
}
}
}