Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

266
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!