python3 -m http.server 8000
open http://localhost:8000The achievable colors form an octahedron in RGB space (vertices at R, G, B, C, M, Y, centered at gray). To find the rotation for a target color:
-
Gamut projection β a ray from the octahedron center (0.5, 0.5, 0.5) through the target color is intersected with the gamut surface. The hit point's barycentric coordinates encode which faces should be visible and in what proportion.
-
View direction β the barycentric weights, signed by the octant of the hit face, give the local-frame view direction that produces the desired color mix.
-
Rotation β Rodrigues' formula builds the minimum-arc rotation aligning the view direction with the camera, giving the final model matrix.
