To any would-be implementors of oklab and oklch, I highly recommend only working from the w3c's CSS4 color specification, and ignore everything else. The spec has a lot of important information that the original oklab blog post glosses over, the spec walks you through actually implementing it, and the standardized version uses a different white point.
Also it's worth noting that MDN's information on oklab is straight up wrong, and firefox doesn't correctly implement the "powerless" cases. ๐
you can also just copy my implementation (with the caveat that I haven't tested it exhaustively), but I still recommend familiarizing yourself with the CSS4 color spec as it explains the theory involved
https://github.com/Aeva/tangerine/blob/excelsior/tangerine/colors.h
https://github.com/Aeva/tangerine/blob/excelsior/tangerine/colors.cpp
@aeva do you think oklab and oklch would be good for building an evenly spaced general purpose palette?
Regarding gradients, I usually just pick at least 3 points and make a curve through sRGB. It's very flexible and I find it's still pretty easy to use.
@aeva I've been mucking about with it, building a palette with some fixed colours and some random, and using terrible search algos to try to maximise the oklab distance between colours by moving the un-fixed ones.
Here I started with all eight corners of the RGB cube plus orange, and it regularly decides to fill in the gaps with a dark red, two blues, two greens, and two purples.
I think it's done a pretty decent job!
@Farbs An comic artist friend of mine posted this tutorial that explains their approach to constructing constrained color pallets:
I was thinking if I expand LCHOOQ, I might try to make a similar thing where you pick a key color (or several) and it fills out some swatches that can then be tweaked further. And maybe also have some simple scenes for testing the pallet with different compositions.
@Farbs also I saw this post the other day which shows an interesting color pallet analysis tool https://mastodon.art/@musthbly/111581919579328448
I'm not sure if that's a custom tool or something built into aseprite, but it looks useful either way. I think it's really interesting because my first thought on that pallet in isolation would have been skepticism (on the bad assumption of using it for dithering), but the art speaks for itself.
Attached: 3 images had this palette for a while, submitted to lospec today https://lospec.com/palette-list/bly32 #MastoArt #PixelArt #palettes #aseprite