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)

相关推荐
To_OC5 小时前
LC 131 分割回文串:刚学回溯时,我连怎么切字符串都想不明白
javascript·算法·leetcode
旖-旎6 小时前
LeetCode 518:零钱兑换||(完全背包)—— 题解
c++·算法·leetcode·动态规划·背包问题
To_OC6 小时前
LC 42 接雨水:暴力超时卡半天?前后缀数组一用就通了
javascript·算法·leetcode
广州灵眸科技有限公司6 小时前
xfce桌面触摸校准:基于灵眸科技EASY-EAl-Orin-Nano
数据库·windows·科技
delishcomcn7 小时前
AI视觉识别+分切算法:电化铝缺陷检测与裁切一体化解锁
人工智能·算法
触底反弹7 小时前
深入理解大模型采样:Temperature、Top-K、Top-P 的原理与实战
人工智能·算法·面试
雪碧聊技术8 小时前
力扣 LCR 091. 粉刷房子 —— 动态规划入门详解
算法·动态规划
憧憬成为web高手9 小时前
皮卡丘靶场速通--sql 2
数据库·sql·mybatis
河南花仙子科技9 小时前
花仙子科技详解:小游戏合规开发完整要点
科技·游戏