From 36a82737fdef93a5b35575e90ab4230ce26cb09d Mon Sep 17 00:00:00 2001 From: jeff-h Date: Fri, 12 Jan 2018 04:05:27 +1300 Subject: [PATCH] Set cursor white when on dark-colored note backgrounds. (#92) --- FSNotes/EditTextView.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/FSNotes/EditTextView.swift b/FSNotes/EditTextView.swift index bc7075d0d..92bcf3798 100644 --- a/FSNotes/EditTextView.swift +++ b/FSNotes/EditTextView.swift @@ -29,6 +29,10 @@ class EditTextView: NSTextView { override func drawBackground(in rect: NSRect) { backgroundColor = UserDefaultsManagement.bgColor + + let isDarkBG = backgroundColor.brightnessComponent < 0.5 + insertionPointColor = isDarkBG ? NSColor.white : NSColor.black + super.drawBackground(in: rect) }