WIP: OK Color #107933

Draft
Jorijn de Graaf wants to merge 7 commits from bonj/blender:ok-color into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

7 Commits

Author SHA1 Message Date
Jorijn de Graaf 025c076ade Merge branch 'main' into ok-color 2023-05-22 23:57:18 +02:00
Jorijn de Graaf 9af9c73c34 Make ok_color functions similar to math_color
You no longer need to use the structs to use these functions.
The clamping and NaN checks are done in the new functions, to keep the rest of the code closer to the original.
The actual calling of these functions is still done in math_color.c, which is definitely the wrong place; one step at a time.
2023-05-16 01:46:35 +02:00
Jorijn de Graaf 221f28a785 Add options for OK HSL and OK HSV color circle
Not used yet but it's a start.
2023-05-16 01:10:30 +02:00
Jorijn de Graaf 2642b455fd Clamp sRGB to OK HSV/L and do NaN checks
This is roughly the same I did for Godot, but built into the ok_color functions themselves.
Having these functions return only valid numbers makes life a lot easier.
2023-05-16 01:09:55 +02:00
Jorijn de Graaf 51297be341 Remove unnecessary spaces in include
I don't know how this got here but it's bothering me.
It doesn't really matter as this isn't the right place to do this anyway but it doesn't hurt to fix either.
2023-05-16 01:06:04 +02:00
Jorijn de Graaf 3e2bb51767 Merge branch 'main' into ok-color 2023-05-15 01:38:48 +02:00
Jorijn de Graaf 69dd42a693 OK Color initial implementation
The foundation is there, with a proper external module and build option.
Björn Ottosson's original code is a CPP header; I ported it to C with a header that only exposes the desired functions. I might add a diff for this later to keep track of changes.
The actual integration of these functions into Blender's color math is hacky and doesn't work properly, which is what I intend to work on next.
2023-05-15 01:29:36 +02:00