MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / rgbForOffset

Function rgbForOffset

crates/explorer/src/index.js:86–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84// instructions isn't colored.
85let offsetToRgb = new Map();
86const rgbForOffset = offset => {
87 let rgb = offsetToRgb.get(offset);
88 if (rgb === undefined) {
89 rgb = calculateRgbForOffset(offset);
90 offsetToRgb.set(offset, rgb);
91 }
92 return rgb;
93};
94
95// Convert a color in a 24-bit number to a string suitable for CSS styling.
96const rgbToCss = rgb => `rgba(${rgbToTriple(rgb).join(",")})`;

Callers 2

adjustColorForOffsetFunction · 0.85
linkElementsFunction · 0.85

Calls 3

calculateRgbForOffsetFunction · 0.85
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected