Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"pako": "1.0.11",
"pdf-lib": "1.17.1",
"spark-md5": "3.0.2",
"supernote-typescript": "0.3.0"
"supernote-typescript": "0.7.3"
},
"devDependencies": {
"@eslint/js": "9.32.0",
Expand All @@ -56,7 +56,7 @@
},
"pnpm": {
"overrides": {
"supernote-typescript@0.3.0>image-js": "-"
"supernote-typescript@0.7.3>image-js": "-"
}
}
}
80 changes: 45 additions & 35 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/note/notebook-rasterizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ interface Rgba {
const transparent: Rgba = { red: 0, green: 0, blue: 0, alpha: 0 };
const unknown: Rgba = { red: 255, green: 255, blue: 255, alpha: 0 };
const black: Rgba = { red: 0, green: 0, blue: 0, alpha: 255 };
const darkGray: Rgba = { red: 169, green: 169, blue: 169, alpha: 255 };
const gray: Rgba = { red: 128, green: 128, blue: 128, alpha: 255 };
// Gray levels follow supernote-typescript 0.7.x, which swapped the 0.3.0
// values so darkGray < gray in lightness (matching the device's rendering).
const darkGray: Rgba = { red: 128, green: 128, blue: 128, alpha: 255 };
const gray: Rgba = { red: 169, green: 169, blue: 169, alpha: 255 };
const white: Rgba = { red: 255, green: 255, blue: 255, alpha: 255 };

const palette = new Map<number, Rgba>([
Expand Down
4 changes: 2 additions & 2 deletions tests/notebook-rasterizer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe("notebook rasterizer", () => {
width: 2,
height: 2,
pixels: Uint8ClampedArray.from([
255, 255, 255, 255, 0, 0, 0, 255, 128, 128, 128, 255, 255, 255, 255,
255, 255, 255, 255, 0, 0, 0, 255, 169, 169, 169, 255, 255, 255, 255,
255,
]),
});
Expand Down Expand Up @@ -86,7 +86,7 @@ describe("notebook rasterizer", () => {
{
width: 129,
encoded: [0x64, 0x80, 0x64, 0],
finalPixel: [128, 128, 128, 255],
finalPixel: [169, 169, 169, 255],
},
{
width: 10,
Expand Down