MCPcopy Create free account
hub / github.com/VCVRack/Rack / toHexString

Function toHexString

src/color.cpp:84–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84std::string toHexString(NVGcolor c) {
85 uint8_t r = std::round(c.r * 255);
86 uint8_t g = std::round(c.g * 255);
87 uint8_t b = std::round(c.b * 255);
88 uint8_t a = std::round(c.a * 255);
89 if (a == 255)
90 return string::f("#%02x%02x%02x", r, g, b);
91 else
92 return string::f("#%02x%02x%02x%02x", r, g, b, a);
93}
94
95
96} // namespace network

Callers 3

toJsonFunction · 0.85
mergeJsonMethod · 0.85

Calls 2

roundFunction · 0.85
fFunction · 0.70

Tested by

no test coverage detected