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
// This gist contains JavaScript functions and tests for: | |
// - conversion from gamma-corrected (or gamma-compressed) sRGB to linear RGB, to Oklab | |
// - interpolation through Oklab | |
// - conversion back to linear RGB, then sRGB | |
// To use these tests, install nodejs, save this file locally, and run with: | |
// node OklabExperiments.js | |
// No other dependencies are required to use this. | |
// Thanks to some helpful folks in the generative art community for helping me better understand what's happening with this. | |
// My toddler smacked the keyboard with a piece of cardboard and made me accidentally type: |