QGIS Title Label – Using Multiple Colors in Decorations for Time-Series Animation

animationqgistemporal-controllertime seriestitle

I have been trying to dynamically display labels based in the Decoration Title Label in QGIS, as can be seen on this answer by the user Kasper.

What I am trying to achieve now is to change the colour of those labels, somehow overriding the default colour option the Title Label provides here under the Font option:
enter image description here

Ideally, on a string as the following one, which always displays first the name of the line and then dynamically the stops as the animation moves forward: Jubilee line: aggregate(layer:='your_layer_name',aggregate:='concatenate_unique', expression:="stop_name", filter:=@map_start_time <= "time" and "time" <= @map_end_time, concatenator:=',') the Jubilee Line bit should have a different colour than the rest of the text.

I believe wrapping the title (this Jubilee Line bit in the example) in a CASE WHEN ... THEN ... and calling a color_rgb function might work, but I couldn't achieve anything successful yet.

Best Answer

You can use HTML rendering in the Title Decoration:

First enable it in the Font properties by ticking the appropriate box:enter image description here

Format the Title as needed: enter image description here

It works: enter image description here