(colors: TerminalColors, size: number = Math.max(colors.palette.length, 16))
| 209 | } |
| 210 | |
| 211 | function indexedPalette(colors: TerminalColors, size: number = Math.max(colors.palette.length, 16)): RGBA[] { |
| 212 | return Array.from({ length: size }, (_, index) => { |
| 213 | const value = colors.palette[index] |
| 214 | return RGBA.fromIndex(index, value ? RGBA.fromHex(value) : ansiToRgba(index)) |
| 215 | }) |
| 216 | } |
| 217 | |
| 218 | function srgbToLinear(value: number): number { |
| 219 | if (value <= 0.04045) { |
no test coverage detected