import Quill from 'quill'

let Inline = Quill.import('blots/inline');
class BoldBlot extends Inline { }
BoldBlot.blotName = 'bold';
BoldBlot.tagName = 'strong';

class ItalicBlot extends Inline { }
ItalicBlot.blotName = 'italic';
ItalicBlot.tagName = 'em';

Quill.register(BoldBlot);
Quill.register(ItalicBlot);


let CHARS = {
  '0-0': '#aaa',
  '1-1': '#faf'
};

class LinkBlot extends Inline {
  static create(value) {
    let node = super.create();
    node.setAttribute('style', 'color: ' + CHARS[value]);
    node.setAttribute('data-character', value);
    return node;
  }


  static formats(node) {
    return node.getAttribute('data-character');
  }
}

LinkBlot.blotName = 'character';
LinkBlot.tagName = 'span';

Quill.register(LinkBlot);

var quill = new Quill('#app');

quill.setText("asdfasf sdfsdfas sdfasd fsd");
quill.formatText(0, 4, 'character', '1-1');


setInterval(() => {
  CHARS['1-1'] = '#' + (function co(lor){   return (lor +=
  [0,1,2,3,4,5,6,7,8,9,'a','b','c','d','e','f'][Math.floor(Math.random()*16)])
  && (lor.length == 6) ?  lor : co(lor); })('');
  console.log('change');
  quill.setContents(quill.getContents());
}, 2000);

Изменить пасту