title: Coloured Bullets NSTextList
body: <p>I am using a NSTextList in a text editor I am building. I am trying to change the colour of the bullets in NSTextList while still keeping the built in functionality of an NSTextList. So far I have tried overriding the <a href="https://developer.apple.com/documentation/appkit/nstextview/1449532-shouldchangetext" rel="nofollow noreferrer">shouldChangeText</a> function in NSTextList to intercept when a bullet is being added and tried to replace it with my own coloured bullet.</p>
  
  <pre><code>override func shouldChangeText(in affectedCharRange: NSRange, replacementString: String) {
      if replacementString == "\t\u{2022}\t" {
          let redBullet = NSAttributedString(string: "\t\u{2022}\t", attributes: [NSForegroundColorAttributeName: NSColor.red])
          insertText(redBullet, replacementRange: affectedCharRange)
          return false
      }
  }
  </code></pre>
  
  <p>However, this does not keep the functionality of a NSTextList and does not distinguish whether the bullet is already coloured or not. Any advice on how to do this would be greatly appreciated.</p>