3 ms·
> Converting from linear sRGB to Oklab With public domain C++ code! This is incredibly useful to me as a Unity developer. Can almost be plugged right in to C#
by doomlaser 6y ago
> Converting from linear sRGB to Oklab
With public domain C++ code! This is incredibly useful to me as a Unity developer. Can almost be plugged right in to C# & Unity Colors. Could be used for interesting real-time color effects. One of my favorite simple things to do in HSV is to animate the hue. This could be used to do something similar, but across that more attractive Oklab gradient.
Great post.
- reitzensteinm 6y agoIt looks really cheap, you could easily hue shift every pixel in the game with this. One trick I've used in the past is using the alpha channel to mask multiple hue shifts in a shader to give a lot of variations. Eg 0 = shift A, 0.5 = don't shift, 1 = shift B. That way you can make eg leather armor with metal attachments, and tan or fade the leather and swap metal types independently.
- jacobolus 6y ago> It looks really cheap It is pretty much the same cost as CIELAB. Just uses 2 full 3x3 matrices where CIELAB can be thought of as using matrices with a bunch of zeros in them.
- coldcode 6y agoAs an artist who uses code a lot, this is going right into my toolset. Manipulating colors is a huge pain.
- mark-r 6y agoYou can change hues in RGB without having to use HSV. See https://stackoverflow.com/a/8510751/5987 https://stackoverflow.com/a/8510751/5987