Skip to content

Commit a6953ac

Browse files
Create setPalette.md
1 parent a7304e4 commit a6953ac

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)