In QGIS I have different lines with same colour that pass through a grid polygon cell (each cell of the grid have a colour).
When a line cross a cell, it must colour with the relative cell colour. Obviously if the same line pass through more than one cell it must colour with multiple colour.
cell1=yellow, cell2=red, cell3=green
when the line pass through cell1, cell2 and cell3 than the respective part of the line it will colour by yellow, red and green.