Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

273
Visualizações
How to change the color of a line of text in quill.js?

I have an editor like this

var container = document.getElementById('editor');
var quill = new Quill(container);
quill.setText('Hello\nWorld!\n');

Im trying to change the color of the first line to blue. When I use the formatLine method like this

quill.formatLine(0, 1, {
    color: 'rgb(0, 255, 0)'
});  

Nothing happens

When I change it to formatText I see a color change (only a single character though)

quill.formatText(0, 1, {
    color: 'rgb(0, 255, 0)'
});  

Im guessing that color changes fall under inline formatting and are ignored

Formats all lines in given range, returning a Delta representing the change. See formats for a list of available formats. Has no effect when called with inline formats.

Does anyone know how I would change the color of a specific line? Is it possible to get the start and end character indices of a specific line?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda