Cesium Color color writing format

1. English words

// 设置颜色: Cesium.Color.颜色
Cesium.Color.HOTPINK
// 设置颜色和透明度: esium.Color.颜色.透明度
Cesium.Color.PINK.withAlpha(0.5)
// 透明色
Cesium.Color.TRANSPARENT;

2. rgba (0-255 interval) <Note: here alpha is also 0-255 interval>

// Cesium.Color.fromBytes(red ,green ,blue ,alpha ,result)
// result是颜色设定结果,可存储到的对象也可不用。
Cesium.Color.fromBytes(177, 0, 4, 200);

3. rgba (0-1 interval) <calculation method: the value of the 255 interval / 255>

// Cesium.Color(red, green, blue, alpha)
Cesium.Color(177/255, 0/255, 4/255, 1)
Cesium.Color(0.165, 0.165, 0.165, 1)

4. CSS color value conversion

// Cesium.Color.fromCssColorString('CSS色值')
Cesium.Color.fromCssColorString("#ffffff")
Cesium.Color.fromCssColorString("rgba(255, 255, 255, 0.75)")

5. 32-bit GRBA value

// Cesium.Color.fromRgba(rgba, result)
Cesium.Color.fromRgba(0x67ADDFFF)

6. Random color

// Cesium.Color.fromRandom({alpha: 透明度})
Cesium.Color.fromRandom({
    
    alpha: 0.5})

Reference article: https://blog.csdn.net/qq_17627195/article/details/125167917

Guess you like

Origin blog.csdn.net/YG_zhh/article/details/128828994