MCPcopy Create free account
hub / github.com/blinker-iot/blinker-js / randomColor

Function randomColor

example/example.ts:105–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103
104// 随机颜色
105function randomColor() {
106 var r = Math.floor(Math.random() * 256);
107 var g = Math.floor(Math.random() * 256);
108 var b = Math.floor(Math.random() * 256);
109 var color = '#' + r.toString(16) + g.toString(16) + b.toString(16);
110 return color;
111}
112
113// 开关切换
114let switchState = false

Callers 1

example.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected