Refined PLTE (Palette) chunk structure.
The PLTE chunk contains the color palette for indexed-color PNG images (color type 3). Each palette entry is an RGB triplet.
Example 1
Example 1
import { assertEquals } from "@std/assert"; import type { PlteChunk } from "@binstruct/png"; const plte: PlteChunk = { length: 9, type: "PLTE", data: { colors: [ [255, 0, 0], // Red [0, 255, 0], // Green [0, 0, 255], // Blue ], }, crc: 0x12345678, }; assertEquals(plte.data.colors.length, 3); assertEquals(plte.data.colors[0], [255, 0, 0]);