color
Gets or sets the StyleExpression object used to evaluate the style's color
property. Alternatively a string or object defining a color style can be used. The getter will return the internal Expression or ConditionsExpression, which may differ from the value provided to the setter.
The expression must return a Color
.
This expression is applicable to all tile formats.
const style = new Cesium3DTileStyle({
color : '(${Temperature} 90) ? color("red") : color("white")'
});
style.color.evaluateColor(feature, result); // returns a Color object
Content copied to clipboard
const style = new Cesium3DTileStyle();
// Override color expression with a custom function
style.color = {
evaluateColor : function(feature, result) {
return Color.clone(Color.WHITE, result);
}
};
Content copied to clipboard
const style = new Cesium3DTileStyle();
// Override color expression with a string
style.color = 'color("blue")';
Content copied to clipboard
const style = new Cesium3DTileStyle();
// Override color expression with a condition
style.color = {
conditions : [
['${height} 2', 'color("cyan")'],
['true', 'color("blue")']
]
};
Content copied to clipboard