H=60 \times \frac{B-G}{\max - \min}
となっているのは
H=60 \times \frac{G-B}{\max - \min}
^^^
が正しいようです。
同様に、次の二式も同位置の項が逆になっています。