lua获取随机颜色rgb转换hex

local color=string.format("0x%x",math.random(0,255))..string.format("%x",math.random(0,255))..string.format("%x",math.random(0,255))

随机数0-255获得rgb

local r, g, b=math.random(0,255), math.random(0,255), math.random(0,255)

local hex=string.format("0x%x",r)..string.format(g)..string.format("%x",b)

相关推荐
风哥2号1 小时前
华为高斯数据库恢复工具FGOGDU(FGEDU openGauss DUL)
数据库·opengauss·华为高斯
小蒜学长2 小时前
springboot党建云课堂学习与管理系统(代码+数据库+LW)
java·数据库·spring boot·后端·学习
2601_962180332 小时前
FlinkCDC 实现 MySQL 数据变更实时同步
数据库·mysql
2601_962189602 小时前
深入浅出MySQL:概述与体系结构解析
数据库·mysql
Gain_chance2 小时前
大数据毕业设计实战|Data Insight Platform:用 FastAPI + ClickHouse 打造低门槛全链路数据洞察平台
大数据·数据库·clickhouse·毕业设计·fastapi
harmony&3 小时前
ETCD 存储系统实战:从单节点部署到 Kubernetes 高可用集群
数据库·kubernetes·etcd
2601_962066493 小时前
【玩转全栈】----Django模板的继承
数据库·django·sqlite
一只小bit4 小时前
Redis哨兵机制、主从复制与集群搭建与维护
数据库·redis·bootstrap
Chester_199910 小时前
CSP202203C.计算资源调度器
开发语言·数据结构·c++·蓝桥杯
zlwool10 小时前
图纸管理选型避坑指南
数据库·erp·设备erp·非标机械