Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

265
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda