Skip to content

Commit 1490bb2

Browse files
committed
fix(led): better fallback lightColor
1 parent 80802ea commit 1490bb2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/led-element.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const lightColors: { [key: string]: string } = {
99
yellow: '#ffff80',
1010
orange: '#ffcf80',
1111
white: '#ffffff',
12+
purple: '#ff80ff',
1213
};
1314

1415
@customElement('wokwi-led')
@@ -55,7 +56,7 @@ export class LEDElement extends LitElement {
5556

5657
render() {
5758
const { color, lightColor, flip } = this;
58-
const lightColorActual = lightColor || lightColors[color?.toLowerCase()] || '#ff8080';
59+
const lightColorActual = lightColor || lightColors[color?.toLowerCase()] || color;
5960
const opacity = this.brightness ? 0.3 + this.brightness * 0.7 : 0;
6061
const lightOn = this.value && this.brightness > Number.EPSILON;
6162
const xScale = flip ? -1 : 1;

0 commit comments

Comments
 (0)