I am a colorist in post production and I am working on tools that generally speaking transform colors. For this purpose I am looking to design a function that accommodates the following points.
$$(-\pi, 0);\; (-\frac{2\pi}{3}, -1);\; (-\frac{\pi}{3}, -0.5);\; (0, 0);\; (\frac{\pi}{3}; 0.5);\; (\frac{2\pi}{3}, 1); (\pi, 0)$$
The function should be continuous, easy to compute and as precise as possible. From the given points one can see that I am looking for something halfway between a sinus and a sawtooth curve.
This is what I found so far:
It is relatively close but not quite as precise as I would want it to be and I don't like the little bumps in the straight part of the curve between $-\frac{2\pi}{3}$ and $\frac{2\pi}{3}$.
Any help is greatly appreciated.


This is related to the Fourier series of a function. Every "nice" function of period $2\pi$ can be written as a (possibly infinite) linear combination of the functions $\sin(kx)$ and $\cos(kx).$
Since your function is odd ($f(-x)=-f(x)$) you should be able to skip the cosines and write your function as:
$$f(x)=\sum_{k=1}^{\infty}a_k\sin(kx).$$
Here, we really only need two terms to match your datapoints:
$$f(x)=a\sin(x)+b\sin(2x)$$
We automatically get $f(0)=f(\pi)=f(-\pi)=0.$ So we need to match $f(\pi/3)$ and $f(2\pi/3).$ Here we need $\sin(\pi/3)=\sin(2\pi/3)=\frac{\sqrt3}2$ and $\sin(4\pi/3)=-\frac{\sqrt3}2.$
So you need $$0.5=\frac{\sqrt3}2(a+b)\\1=\frac{\sqrt3}2(a-b)$$
Or $a+b=1/\sqrt{3}, a-b=2/\sqrt3.$ This gives $$a=\frac{ \sqrt3}2,b=-\frac{\sqrt3}{6}.$$
So you get a function $$f(x)=\frac{\sqrt3}6(3\sin(x)-\sin(2x)).$$
This gives a graph that looks like:
If you want to match more datapoints, you will need more terms, and if the addition datapoints do not ensure the function is odd, then you'll need to add terms of the form $\cos(kx),$ too.
Another condition you might want is for $f(2\pi/3)$ to be the maximum. As it stands, $f(2)>1.$ You will need an addition term to get this condition.
If you want $1$ to be the absolute maximum, you get:
$$f(x)=\frac{\sqrt 3}{6}\left(3\sin x-\sin 2x +\frac16\sin 3x\right)$$
This also gives a slightly more linear look the graph on $[-2pi/3,2\pi/3]$: