MCPcopy Create free account
hub / github.com/Simple-Robotics/Simple / rgbToHex

Function rgbToHex

sandbox/viz_utils.py:33–41  ·  view source on GitHub ↗
(color)

Source from the content-addressed store, hash-verified

31
32
33def rgbToHex(color):
34 if len(color) == 4:
35 c = color[:3]
36 opacity = color[3]
37 else:
38 c = color
39 opacity = 1.0
40 hex_color = "0x%02x%02x%02x" % (int(c[0] * 255), int(c[1] * 255), int(c[2] * 255))
41 return hex_color, opacity
42
43
44def register_object(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected