# I can't apply color on Material

**URL:** <https://community.cesium.com/t/i-cant-apply-color-on-material/8525>\
**Category:** CesiumJS\
**Created:** [August 7, 2019, 7:17am UTC](https://community.cesium.com/t/i-cant-apply-color-on-material/8525 "2019-08-07T07:17:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![palluel.luis](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@palluel.luis](https://community.cesium.com/u/palluel.luis)\
**Post date:** [August 7, 2019, 7:17am UTC](https://community.cesium.com/t/i-cant-apply-color-on-material/8525/1 "2019-08-07T07:17:02Z")

</div>

**1. A concise explanation of the problem you’re experiencing.**

I try to change the default color of my material and I have an error :

 ![Auto Generated Inline Image 1.png](https://global.discourse-cdn.com/cesium/original/1X/db02c9649f00f5a6f751ed3fa49a01e797925d13.png)

It’s the first time I use Cesium, so I think the problem is in my code.

**2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.**

You can find my code and the error here :

[https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=fZLRa9swEMb/FeGXOmDktOleOjcspGUrpHRQaBnTHq72JRGVJXM6O2Qj/3vlJF6cZMz2g+6+7zt0P9wAiUbjCkncCosrMUWv61K+bHvxRb4tp84yaIt0MfisbBMy2noGm+Nx6iu6EpnWD3s1/qOs4vZd7BVx0/e/gjFdpvWKk6dyXrN21ofYPjIF4nACO5JzcuUdLgjRT4hg/Q31Ysk+/nk+6PoqEeG7HA6HyT/U0X/V60SMduqvQbfPZrBpUQQYW1DS52hRVqTLcOEGvYSiiHubfu+UcyQdrHbJDmvSmaCqEGhL+ojcIzCSBjP5qx8GKy736o3oNRXXVs8dlf6krTh3xtEBcVvJH/ez2dOrXGleTky1hHgoPw36sc2h2Ig+lx2YKIkyz2uD4x3SL7qsHLGoycRSpoxlZcI1ffpW5+/IMve+DWZpF8oK3Qhd3Kro5CdUkcgNeB+UeW3Ms/6NKhpnafAfxYyDQtvFU4NkYN1alpfj2a4ppczSUJ6n2DnzBtSb+AE](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=fZLRa9swEMb/FeGXOmDktOleOjcspGUrpHRQaBnTHq72JRGVJXM6O2Qj/3vlJF6cZMz2g+6+7zt0P9wAiUbjCkncCosrMUWv61K+bHvxRb4tp84yaIt0MfisbBMy2noGm+Nx6iu6EpnWD3s1/qOs4vZd7BVx0/e/gjFdpvWKk6dyXrN21ofYPjIF4nACO5JzcuUdLgjRT4hg/Q31Ysk+/nk+6PoqEeG7HA6HyT/U0X/V60SMduqvQbfPZrBpUQQYW1DS52hRVqTLcOEGvYSiiHubfu+UcyQdrHbJDmvSmaCqEGhL+ojcIzCSBjP5qx8GKy736o3oNRXXVs8dlf6krTh3xtEBcVvJH/ez2dOrXGleTky1hHgoPw36sc2h2Ig+lx2YKIkyz2uD4x3SL7qsHLGoycRSpoxlZcI1ffpW5+/IMve+DWZpF8oK3Qhd3Kro5CdUkcgNeB+UeW3Ms/6NKhpnafAfxYyDQtvFU4NkYN1alpfj2a4ppczSUJ6n2DnzBtSb+AE)

**3. Context. Why do you need to do this? We might know a better way to accomplish your goal.**

I simply want to change color.

**4. The Cesium version you’re using, your operating system and browser.**

I use cesium in Angular so :

“angular-core”: “6.1.6”

“angular-cesium”: “0.0.53”

Have you an idea ?

Thanks !

---

<div class="post-metadata">

**Author:** ![palluel.luis](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@palluel.luis](https://community.cesium.com/u/palluel.luis)\
**Post date:** [August 7, 2019, 7:30am UTC](https://community.cesium.com/t/i-cant-apply-color-on-material/8525/2 "2019-08-07T07:30:42Z")

</div>

Please rather take this version of the code :

[https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=lVNdS8MwFP0roS9rYaSbCuqswzFBBUVB0QfrQ2zvtmCalJu0UqX/3aRb574UvYGQ5Jxz057TlgxJyeEdkJwSCe9kDJoXGX1szvxO0mzHShrGJWAnOIllaTVcasNkAuuqC1AZGKyuFqj/GcvYuDFdIGSwyn9iQrQaxyUblSvNDVdSW9lCMmZo7IrJfTpBlZ3DFAH0CJFVl8CnM6P95+1G/WPa65KDQzf3e7bs4kfW0e+svd4/WH+7cZX1ErSe1UHt7LaGN2FQnYAEmiPPrCklaMrS1F9x865Ftm1vA3FGttF1WxLLc2DYpLmWzg0zgJyJ0RLflVG2YA3I8lY3TJXDYLNTE9mDRfzOWAllP6cdnrgqJJ8ozHTTlPxQiWux9sRNU79xvu+mdhXsblJvH9ff5i/BOpjH4HW9SJtKwHAOnfEsV2hIgcKnNDSQ5cK+qA5fi+QNDE20dsIobEVRykvC09PY2/itYo8kgmltkUkhxD3/gNgbRqHlr8mEYimX09sSULDKUWb94fX8kFIahXa7rTJKiVeGKx2/AA](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=lVNdS8MwFP0roS9rYaSbCuqswzFBBUVB0QfrQ2zvtmCalJu0UqX/3aRb574UvYGQ5Jxz057TlgxJyeEdkJwSCe9kDJoXGX1szvxO0mzHShrGJWAnOIllaTVcasNkAuuqC1AZGKyuFqj/GcvYuDFdIGSwyn9iQrQaxyUblSvNDVdSW9lCMmZo7IrJfTpBlZ3DFAH0CJFVl8CnM6P95+1G/WPa65KDQzf3e7bs4kfW0e+svd4/WH+7cZX1ErSe1UHt7LaGN2FQnYAEmiPPrCklaMrS1F9x865Ftm1vA3FGttF1WxLLc2DYpLmWzg0zgJyJ0RLflVG2YA3I8lY3TJXDYLNTE9mDRfzOWAllP6cdnrgqJJ8ozHTTlPxQiWux9sRNU79xvu+mdhXsblJvH9ff5i/BOpjH4HW9SJtKwHAOnfEsV2hIgcKnNDSQ5cK+qA5fi+QNDE20dsIobEVRykvC09PY2/itYo8kgmltkUkhxD3/gNgbRqHlr8mEYimX09sSULDKUWb94fX8kFIahXa7rTJKiVeGKx2/AA)

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [August 14, 2019, 3:13pm UTC](https://community.cesium.com/t/i-cant-apply-color-on-material/8525/3 "2019-08-14T15:13:53Z")

</div>

I think you have the wrong syntax for your material creation. It should be:

viewer.scene.primitives.add(new Cesium.Primitive({

geometryInstances : instance,

appearance : new Cesium.MaterialAppearance({

material: new Cesium.Material({

fabric : {

type : ‘Color’,

uniforms : {

color : new Cesium.Color(1.0, 1.0, 0.0, 1.0)

}

}

})

})

}));

``

Which I figured out from looking at this page in the docs:

[https://cesiumjs.org/Cesium/Build/Documentation/Material.html](https://cesiumjs.org/Cesium/Build/Documentation/Material.html)

You might also find this guide helpful: [https://cesium.com/docs/tutorials/geometry-and-appearances/](https://cesium.com/docs/tutorials/geometry-and-appearances/)
