From 4ecdd3a4190ecb7f2ed564a750e466e49c2b3a8e Mon Sep 17 00:00:00 2001 From: Hugo H Date: Wed, 31 Dec 2025 10:37:41 +0000 Subject: [PATCH] added s.pal, s.palc and s.paint --- screen.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/screen.js b/screen.js index a2b1759..107ce97 100644 --- a/screen.js +++ b/screen.js @@ -250,6 +250,18 @@ var $builtinmodule = function (name) { mod.sqrt = new Sk.builtin.func((n) => toPy(Math.sqrt(toJS(n)))); mod.pause = new Sk.builtin.func(() => { pause(); return Sk.builtin.none.none$; }); mod.resume = new Sk.builtin.func(() => { resume(); return Sk.builtin.none.none$; }); + mod.pal = new Sk.builtin.func((colors, textColor) => { + pal(colors !== undefined ? toJS(colors) : undefined, textColor !== undefined ? toJS(textColor) : 3); + return Sk.builtin.none.none$; + }); + mod.palc = new Sk.builtin.func((a, b) => { + palc(a !== undefined ? toJS(a) : undefined, b !== undefined ? toJS(b) : undefined); + return Sk.builtin.none.none$; + }); + mod.paint = new Sk.builtin.func((width, height, data, options) => { + var result = paint(toJS(width), toJS(height), toJS(data), options !== undefined ? toJS(options) : undefined); + return result ? toPy(result) : Sk.builtin.none.none$; + }); return mod; };