encodeRGB8
Encodes RGB values at 8-bit precision into a single float, equivalent to 0xFFFFFF representation in JavaScript. Perceptually near-lossless in the "srgb" color space; "srgb-linear" and wide-gamut color spaces benefit from 10+ bit precision.