We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7304e4 commit a6953acCopy full SHA for a6953ac
1 file changed
docs/reference/images/setPalette.md
@@ -0,0 +1,22 @@
1
+## Set Palette
2
+Sets the screen's palette.
3
+
4
+``` sig
5
+ image.setPalette(null);
6
+```
7
8
+A color is formed by 3 indices of a buffer.
9
10
+The buffer's size requires to be 48 because
11
+of the engine's 16 colors.
12
13
+## Example
14
+Replace the screen palette's first color.
15
16
+``` ts
17
+ const buf = Buffer.create(48);
18
+ // color 0
19
+ buf[0] = 11; // 0
20
+ buf[1] = 90; // 0
21
+ buf[2] = 100; // 0
22
0 commit comments