当前位置:网站首页>Cesium Color 颜色(赋值)随机颜色
Cesium Color 颜色(赋值)随机颜色
2022-06-28 00:05:00 【最凶残的小海豹】
赋值方式:
1. 英文颜色单词
// 设置颜色: Cesium.Color.颜色
Cesium.Color.WHITE;
// 设置颜色和透明度: esium.Color.颜色.透明度
Cesium.Color.BLUE.withAlpha(0.4)
// 透明色
Cesium.Color.TRANSPARENT;
2. rgba(0-255区间)注意:这里 alpha 也是0-255区间
// Cesium.Color.fromBytes(red ,green ,blue ,alpha ,result)
// result是颜色设定结果,可存储到的对象也可不用。
Cesium.Color.fromBytes(177, 0, 4, 200);
3. rgba(0-1区间) 计算方式:255区间的值 / 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 色值转换
// Cesium.Color.fromCssColorString('CSS色值')
Cesium.Color.fromCssColorString("#ffffff")
Cesium.Color.fromCssColorString("rgba(255, 255, 255, 0.75)")
6. 32位GRBA值
// Cesium.Color.fromRgba(rgba, result)
Cesium.Color.fromRgba(0x67ADDFFF)
7. 随机颜色
// Cesium.Color.fromRandom({alpha: 透明度})
Cesium.Color.fromRandom({
alpha: 0.5})
小技巧:
只修改透明度不修改原本的颜色,可以使用 getValue 方法
// 设置字体填充透明度
label.fillColor = label.fillColor.getValue().withAlpha(0.8);
// 设置字体外边框透明度
label.outlineColor= label.outlineColor.getValue().withAlpha(0.8);
// 设置球地下颜色的透明度 (这里用 undergroundColor 返回的也是 Cesium.Color 对象)
globe.viewer.scene.globe.undergroundColor.withAlpha(0.8)
边栏推荐
- [elt.zip] openharmony paper Club - memory compression for data intensive applications
- 树莓派实现温控风扇智能降温
- Interview guide for data person | prepare these points to be prepared!
- Some problems in awk
- [Yocto RM]9 - QA Error and Warning Messages
- Google Earth engine (GEE) -- an error caused by the imagecollection (error) traversing the image collection
- centos8-操作记录-命令版-yum-redis-mysql-nacos-jdk
- ShardingSphere-proxy-5.0.0建立mysql读写分离的连接(六)
- 205. isomorphic string
- 自监督学习与药物发现
猜你喜欢

利用redis bitmap实现人员在线情况监控

要搞清楚什么是同步,异步,串行,并行,并发,进程,线程,协程

基于可学习尺寸自适应分子亚结构的药物相互作用预测

嵌入式必学!硬件资源接口详解——基于ARM AM335X开发板 (下)

基于AM335X开发板 ARM Cortex-A8——Acontis EtherCAT主站开发案例

Adobe Premiere Basics - general operations for editing material files (offline files, replacing materials, material labels and grouping, material enabling, convenient adjustment of opacity, project pa

嵌入式必学,硬件资源接口详解——基于ARM AM335X开发板 (上)

什麼是數字化?什麼是數字化轉型?為什麼企業選擇數字化轉型?

将某数据库N多表名作为另外一张表中某一列得值(范围可以是别的数据库中得某张表)

评价——灰色关联分析
随机推荐
零基礎多圖詳解圖神經網絡
药物发现综述-01-药物发现概述
ShardingSphere-proxy-5.0.0建立mysql读写分离的连接(六)
机器学习笔记 - 时间序列作为特征
Adobe Premiere基础-声音调整(音量矫正,降噪,电话音,音高换挡器,参数均衡器)(十八)
Adobe Premiere基础-编辑素材文件常规操作(脱机文件,替换素材,素材标签和编组,素材启用,便捷调节不透明度,项目打包)(十七)
MapReduce elementary programming practice
Ten MySQL locks, one article will give you full analysis
pytorch_ lightning. utilities. exceptions. MisconfigurationException: You requested GPUs: [1] But...
How to study efficiently
将某数据库N多表名作为另外一张表中某一列得值(范围可以是别的数据库中得某张表)
frp实现内网穿透
【ELT.ZIP】OpenHarmony啃论文俱乐部—数据密集型应用内存压缩
Adobe Premiere基础-常用的视频特效(边角定位,马赛克,模糊,锐化,手写工具,效果控件层级顺序)(十六)
利用redis bitmap实现人员在线情况监控
Take n multiple table names of a database as the values of a column in another table (the range can be a table in another database)
学习 pickle
Numpy----np.meshgrid()
什麼是數字化?什麼是數字化轉型?為什麼企業選擇數字化轉型?
Chapitre 4: redis