This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BASE83_ALPHABET = `0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~`; | |
const BASE64_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | |
const BMP_HEADER = `data:image/bmp;base64,Qk3mAQAAAAAAADYAAAAoAAAADAAAAPT///8BABgAAAAAALABAAAAAAAAAAAAAAAAAAAAAAAA`; | |
const sRGBToLinear = (value: number) => { | |
const v = value / 255; | |
if (v <= 0.04045) { | |
return v / 12.92; | |
} else { | |
return Math.pow((v + 0.055) / 1.055, 2.4); |