| 84 | // instructions isn't colored. |
| 85 | let offsetToRgb = new Map(); |
| 86 | const 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. |
| 96 | const rgbToCss = rgb => `rgba(${rgbToTriple(rgb).join(",")})`; |
no test coverage detected