Skip to content

Commit 1e80789

Browse files
committed
Fix web devtools palette issue with most significant byte
On Wasm-4, palette colours are in the order `0xAARRGGBB`, where `A` represents unused/alpha. On the web/css however, the order is `#RRGGBBAA`. This meant that previously, if the most significant byte wasn't 0, the colours in the devtool's palette viewer were garbled.
1 parent b18afb0 commit 1e80789

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

devtools/web/src/components/palette/palette.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class Wasm4Palette extends LitElement {
3434
${this.heading && html`<h4>${this.heading}</h4>`}
3535
<div class="palette-grid">
3636
${this.palette.slice(0, 4).map((color) => {
37-
const colorHex = formatColor(color);
37+
const colorHex = formatColor(color & 0xffffff);
3838
3939
const shouldInvertColor =
4040
((color & 0xff) + ((color >> 8) & 0xff) + (color >> 16)) / 3 > 128;

0 commit comments

Comments
 (0)