Skip to content

Instantly share code, notes, and snippets.

@rozek
Last active December 6, 2019 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rozek/f1b083474cd21fec461c02c597cd6112 to your computer and use it in GitHub Desktop.
Save rozek/f1b083474cd21fec461c02c597cd6112 to your computer and use it in GitHub Desktop.
Bangle.js: displays the color palette used by 8-bit display modes
Bangle.setLCDMode('120x120');
g.clear();
const Width = g.getWidth();
const Height = g.getHeight();
for (let Row = 0; Row < 16; Row++) {
let yMin = 4+Row*7, yMax = 4+(Row+1)*7-1;
for (let Column = 0; Column < 16; Column++) {
let xMin = 4+Column*7, xMax = 4+(Column+1)*7-1;
let PaletteIndex = Row*16 + Column;
for (let y = yMin; y <= yMax; y++) {
for (let x = xMin; x <= xMax; x++) {
g.setPixel(x,y,PaletteIndex);
}
}
}
}
g.flip();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment