     
     private var drawingInfo: DrawingInfo?
     private var thickness: CGFloat = 32
+    
+    private var textColor: NSColor = .textColor  { didSet { self.needsDisplay = true } }
+    private var backgroundColor: NSColor = .textBackgroundColor  { didSet { self.needsDisplay = true } }
     
     private var opacityObserver: AnyCancellable?
     private var textViewSubscriptions: Set<AnyCancellable> = []

            }
            .store(in: &self.textViewSubscriptions)
        
        textView.publisher(for: \.backgroundColor)
            .sink { [weak self] _ in
                self?.needsDisplay = true
            }
            .store(in: &self.textViewSubscriptions)
        
        textView.publisher(for: \.font)
            .sink { [weak self] _ in
                self?.invalidateDrawingInfo()
            }
            .store(in: &self.textViewSubscriptions)
        
        textView.publisher(for: \.scale)
            .sink { [weak self] _ in
                self?.invalidateDrawingInfo()
            }
            .store(in: &self.textViewSubscriptions)
    }
    

    /// 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
    }
    
    
