             }
             .store(in: &self.textViewSubscriptions)
         
-        textView.publisher(for: \.backgroundColor)
-            .sink { [weak self] _ in
-                self?.needsDisplay = true
-            }
+        textView.publisher(for: \.textColor, options: .initial)
+            .compactMap { $0 }
+            .sink { [weak self] in self?.textColor = $0 }
+            .store(in: &self.textViewSubscriptions)
+        
+        textView.publisher(for: \.backgroundColor, options: .initial)
+            .sink { [weak self] in self?.backgroundColor = $0 }
             .store(in: &self.textViewSubscriptions)
         
         textView.publisher(for: \.font)
-            .sink { [weak self] _ in
-                self?.invalidateDrawingInfo()
-            }
+            .sink { [weak self] _ in self?.invalidateDrawingInfo() }
             .store(in: &self.textViewSubscriptions)
         
         textView.publisher(for: \.scale)
-            .sink { [weak self] _ in
-                self?.invalidateDrawingInfo()
-            }
+            .sink { [weak self] _ in self?.invalidateDrawingInfo() }
             .store(in: &self.textViewSubscriptions)
     }
     

    
    private var drawingInfo: DrawingInfo?
    private var thickness: CGFloat = 32
    
    private var opacityObserver: AnyCancellable?
    private var textViewSubscriptions: Set<AnyCancellable> = []

    /// return foreground color by considering the current accesibility setting
    private func foregroundColor(_ strength: ColorStrength = .normal) -> NSColor {
        
        let fraction = NSWorkspace.shared.accessibilityDisplayShouldIncreaseContrast
            ? strength.rawValue + ColorStrength.highContrastCoefficient
            : strength.rawValue
        
        return fraction < 1
            ? self.textColor.withAlphaComponent(1 - fraction)
            : self.textColor
    }
    
    
