Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Dec 3, 2024
1 parent a7466ef commit 610a0a9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions libs/pipboy/jswrap_pipboy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,25 @@ JsVar *jswrap_pb_streamPlaying() {
]
}
Set the colour palette used for rendering everything on PipBoy
eg:
```
var pal = [
new Uint16Array(16),
new Uint16Array(16),
new Uint16Array(16),
new Uint16Array(16)
];
// Orangey
for (var i=0;i<16;i++) {
pal[0][i] = g.toColor(i/15,i/30,0); // 0: even (bright line)
pal[1][i] = g.toColor(i/30,i/60,0); // 1: odd (dark line)
pal[2][i] = g.toColor(i/10,i/20,0); // 0: even scan effect
pal[3][i] = g.toColor(i/20,i/40,0); // 1: odd scan effect
}
Pip.setPalette(pal);
```
*/
void jswrap_pb_setPalette(JsVar *pal) {
if (!jsvIsArray(pal)) {
Expand Down

0 comments on commit 610a0a9

Please sign in to comment.