Change article accent color to be NNW blue. Issue #2367

This commit is contained in:
Maurice Parker 2020-08-19 12:31:03 -05:00
parent 1f047cdb10
commit bbd2dfad45
2 changed files with 4 additions and 30 deletions

View File

@ -10,16 +10,16 @@ body {
:root {
--body-color: #444;
--body-background-color: -apple-system-text-background;
--accent-color: rgba([[accent-r]], [[accent-g]], [[accent-b]], .75);
--block-quote-border-color: rgba([[accent-r]], [[accent-g]], [[accent-b]], .50);
--accent-color: rgb(8, 106, 238, 1);
--block-quote-border-color: rgb(8, 106, 238, .50);
}
@media(prefers-color-scheme: dark) {
:root {
--body-color: #d2d2d2;
--body-background-color: #2d2d2d;
--accent-color: rgba([[accent-r]], [[accent-g]], [[accent-b]], .75);
--block-quote-border-color: rgba([[accent-r]], [[accent-g]], [[accent-b]], .50);
--accent-color: rgba(45, 128, 241, 1);
--block-quote-border-color: rgba(45, 128, 241, .50);
--header-table-border-color: rgba(255, 255, 255, 0.1);
}
}

View File

@ -276,32 +276,6 @@ private extension ArticleRenderer {
d["font-size"] = String(describing: Int(round(bodyFont.pointSize * 1.33)))
#endif
guard let linkColor = NSColor.controlAccentColor.usingColorSpace(.deviceRGB) else {
return d
}
let red: Int
let green: Int
let blue: Int
if NSApplication.shared.effectiveAppearance.isDarkMode {
let brighten = CGFloat(0.50)
let baseRed = linkColor.redComponent * 0xFF
red = Int(round(((255 - baseRed) * brighten)) + round(baseRed))
let baseGreen = linkColor.greenComponent * 0xFF
green = Int(round(((255 - baseGreen) * brighten)) + round(baseGreen))
let baseBlue = linkColor.blueComponent * 0xFF
blue = Int(round(((255 - baseBlue) * brighten)) + round(baseBlue))
} else {
let darken = CGFloat(0.75)
red = Int(round(linkColor.redComponent * 0xFF * darken))
green = Int(round(linkColor.greenComponent * 0xFF * darken))
blue = Int(round(linkColor.blueComponent * 0xFF * darken))
}
d["accent-r"] = String(red)
d["accent-g"] = String(green)
d["accent-b"] = String(blue)
return d
}
#endif