Skip to content

Commit

Permalink
Improve the legibility of the progress circle in dark mode (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Feb 10, 2020
1 parent ab927d0 commit 8e152d3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
28 changes: 28 additions & 0 deletions Gifski/Assets.xcassets/ProgressCircleColor.colorset/Contents.json
@@ -0,0 +1,28 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [
{
"idiom" : "mac",
"color" : {
"platform" : "osx",
"reference" : "controlAccentColor"
}
},
{
"idiom" : "mac",
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"platform" : "osx",
"reference" : "labelColor"
}
}
]
}
1 change: 1 addition & 0 deletions Gifski/Constants.swift
Expand Up @@ -9,6 +9,7 @@ struct Constants {

extension NSColor {
static let themeColor = NSColor.controlAccentColorPolyfill
static let progressCircleColor = NSColor(named: "ProgressCircleColor")!

enum Checkerboard {
static let first = NSColor(named: "CheckerboardFirstColor")!
Expand Down
5 changes: 3 additions & 2 deletions Gifski/ConversionViewController.swift
Expand Up @@ -6,14 +6,15 @@ import Defaults
final class ConversionViewController: NSViewController {
private lazy var circularProgress = with(CircularProgress(size: 160.0)) {
$0.translatesAutoresizingMaskIntoConstraints = false
$0.color = .themeColor
$0.color = .progressCircleColor
$0.lineWidth = 3
}

private lazy var timeRemainingLabel = with(Label()) {
$0.translatesAutoresizingMaskIntoConstraints = false
$0.isHidden = true
$0.textColor = .secondaryLabelColor
$0.font = NSFont.monospacedDigitSystemFont(ofSize: 12, weight: .regular)
$0.font = .monospacedDigitSystemFont(ofSize: 12, weight: .regular)
}

private lazy var timeRemainingEstimator = TimeRemainingEstimator(label: timeRemainingLabel)
Expand Down

0 comments on commit 8e152d3

Please sign in to comment.