How to change dynamically path color in Cesium Viewer

I want to dynamically change the color of my gps path that I put in a czml file depending on the speed of my path. 0% speed = blue, 100%= red.My path which is fixed in blue

Here is my code which displays the viewer :

var viewer = new Cesium.Viewer("cesiumContainer", { terrainProvider: Cesium.createWorldTerrain(), baseLayerPicker: false, shouldAnimate: true, });
viewer.dataSources.add(Cesium.CzmlDataSource.load(tabToCzml)).then(function (ds) {
            viewer.trackedEntity = ds.entities.getById("path");
        });

Currently the color of the path is defined in the czml file as :

"path": { "material": { "polylineOutline": { "color": { "rgba": [255, 255, 255, 200] }, "outlineColor": { "rgba": [0, 173, 253, 200] }, "outlineWidth": 5 } }, "width": 6, "leadTime": 0, "trailTime": 100000, "resolution": 5 } }