From 610a0a92594b0d037edb88decb947d96ec7a3d19 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Tue, 3 Dec 2024 12:29:02 +0000 Subject: [PATCH] docs --- libs/pipboy/jswrap_pipboy.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libs/pipboy/jswrap_pipboy.c b/libs/pipboy/jswrap_pipboy.c index 8f6fcf362..bcfb1ad01 100644 --- a/libs/pipboy/jswrap_pipboy.c +++ b/libs/pipboy/jswrap_pipboy.c @@ -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)) {