(element, offset)
| 109 | |
| 110 | // Adjust the color styles of a DOM element for a given Wasm offset. |
| 111 | const adjustColorForOffset = (element, offset) => { |
| 112 | let backgroundColor = rgbForOffset(offset); |
| 113 | element.style.backgroundColor = rgbToCss(backgroundColor); |
| 114 | element.classList.add( |
| 115 | rgbToLuma(backgroundColor) > 128 ? "dark-text" : "light-text", |
| 116 | ); |
| 117 | }; |
| 118 | |
| 119 | /*** Event Handlers ************************************************************/ |
| 120 |
no test coverage detected