@@ -56,7 +56,10 @@ scaled to fit the 0 to 1 range.
56
56
57
57
\f[ V \leftarrow max(R,G,B)\f]
58
58
\f[ S \leftarrow \fork{\frac{V-min(R,G,B)}{V}}{if \( V \neq 0\) }{0}{otherwise}\f]
59
- \f[ H \leftarrow \forkthree{{60(G - B)}/{(V-min(R,G,B))}}{if \( V=R\) }{{120+60(B - R)}/{(V-min(R,G,B))}}{if \( V=G\) }{{240+60(R - G)}/{(V-min(R,G,B))}}{if \( V=B\) }\f]
59
+ \f[ H \leftarrow \forkfour{{60(G - B)}/{(V-min(R,G,B))}}{if \( V=R\) }
60
+ {{120+60(B - R)}/{(V-min(R,G,B))}}{if \( V=G\) }
61
+ {{240+60(R - G)}/{(V-min(R,G,B))}}{if \( V=B\) }
62
+ {0}{if \( R=G=B\) }\f]
60
63
If \f$H<0\f$ then \f$H \leftarrow H+360\f$ . On output \f$0 \leq V \leq 1\f$, \f$0 \leq S \leq 1\f$,
61
64
\f$0 \leq H \leq 360\f$ .
62
65
@@ -78,9 +81,10 @@ scaled to fit the 0 to 1 range.
78
81
\f[ L \leftarrow \frac{V_ {max} + V_ {min}}{2}\f]
79
82
\f[ S \leftarrow \fork { \frac{V_ {max} - V_ {min}}{V_ {max} + V_ {min}} }{if \( L < 0.5\) }
80
83
{ \frac{V_ {max} - V_ {min}}{2 - (V_ {max} + V_ {min})} }{if \( L \ge 0.5\) }\f]
81
- \f[ H \leftarrow \forkthree {{60(G - B)}/{(V_ {max}-V_ {min})}}{if \( V_ {max}=R\) }
84
+ \f[ H \leftarrow \forkfour {{60(G - B)}/{(V_ {max}-V_ {min})}}{if \( V_ {max}=R\) }
82
85
{{120+60(B - R)}/{(V_ {max}-V_ {min})}}{if \( V_ {max}=G\) }
83
- {{240+60(R - G)}/{(V_ {max}-V_ {min})}}{if \( V_ {max}=B\) }\f]
86
+ {{240+60(R - G)}/{(V_ {max}-V_ {min})}}{if \( V_ {max}=B\) }
87
+ {0}{if \( R=G=B\) }\f]
84
88
If \f$H<0\f$ then \f$H \leftarrow H+360\f$ . On output \f$0 \leq L \leq 1\f$, \f$0 \leq S \leq
85
89
1\f$, \f$0 \leq H \leq 360\f$ .
86
90
0 commit comments