Highlight rows of connected tasks

How can i highlight rows of connected tasks (red colored for example). I want when the user expand a task the rows of all connected task to be custom colored.

10x in advance.

Hello,
You can check if a task has links ($source parameter for links from the task and $target parameter for links that come to the task) and return certain task class in the task_class template:
https://docs.dhtmlx.com/gantt/api__gantt_task_class_template.html
Here is an example:
http://snippet.dhtmlx.com/05f15ed63