in sim/visuals/ltc.ts [467:495]
private updateRgbLed() {
let state = this.board;
if (!state) return;
const rgb = state.neopixelState.getColors(0, NeoPixelMode.RGB)[0];
if (this.rgbLed) {
if (!rgb || (rgb.length >= 3 && rgb[0] === 0 && rgb[1] === 0 && rgb[2] === 0)) {
// Clear the pixel
svg.fill(this.rgbLed, `#e6e6e6`);
svg.filter(this.rgbLed, null);
this.rgbLed.style.strokeWidth = "0.28349999";
this.rgbLed.style.stroke = "#58595b";
} else {
let hsl = visuals.rgbToHsl(rgb);
let [h, s, l] = hsl;
let lx = Math.max(l * 1.3, 85);
// at least 10% luminosity
l = l * 90 / 100 + 10;
this.rgbLed.style.stroke = `hsl(${h}, ${s}%, ${Math.min(l * 3, 75)}%)`
this.rgbLed.style.strokeWidth = "1.5";
svg.fill(this.rgbLed, `hsl(${h}, ${s}%, ${lx}%)`)
svg.filter(this.rgbLed, `url(#neopixelglow)`);
let transform = l / 100 * 0.5;
this.rgbLed.style.transform = `scale(${0.9 + transform})`;
this.rgbLed.style.transformOrigin = "211.30725px 43.049255px";
}
}
}