Usage:
{{RouteNodes|2||A|orange|C|red|F|red|I|red|J|blue|K|magenta|L|orange|M|orange|Q|red}}
Result: Template:RouteNodes