I'm writing a document which uses titlesec, and I'd like to set the title rule to a different color.
How can I do that?
This is what I currently have, which produces section titles with black rules:
\titleformat{\section}
{\Large\sffamily}
{\thesection.}{.5em}{}[\titlerule]
Note: I want to change the color of the rule that appears below a section title.
Best Answer
In a very simple manner:
I add the resulting image of my code:
As @lockstep noticed, to avoid that
\color
inserts break points (reference answer) should be better to use: