How to change SVG color when used as Material?


I'm placing icons onto my globe at specific locations from SVG files with black drawings.

I'd like to change the color of these icons programmatically, as if I could modify the 'fill' CSS value.

Is that possible?

My code (w, s, e, n and url are predefined variables):

var rectangle = scene.primitives.add(new Cesium.Primitive({
        geometryInstances : new Cesium.GeometryInstance({
            geometry : new Cesium.RectangleGeometry({
                rectangle : Cesium.Rectangle.fromDegrees(w-0.45, s-0.45, e-0.45, n-0.45),
                vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
        appearance : new Cesium.EllipsoidSurfaceAppearance({
            aboveGround : false,
            material : new Cesium.Material({
                fabric : {
                    type : 'Image',
                    uniforms : {
                        image : url

Thank you,


I think you would need to update the uniform so it triggers recreating the texture. There was some discussion on workarounds/ways to do this here:

If you have a Sandcastle with an SVG I can run I can also give this a shot.