未验证 提交 b08d67c4 编写于 作者: L Liangda-w 提交者: GitHub

Merge pull request #19419 from Liangda-w:patch-1

* Fix error in documentation for RGB->HSV convertion

* Update colors.markdown
上级 5ab4623c
......@@ -56,7 +56,10 @@ scaled to fit the 0 to 1 range.
\f[V \leftarrow max(R,G,B)\f]
\f[S \leftarrow \fork{\frac{V-min(R,G,B)}{V}}{if \(V \neq 0\)}{0}{otherwise}\f]
\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]
\f[H \leftarrow \forkfour{{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\)}
{0}{if \(R=G=B\)}\f]
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$,
\f$0 \leq H \leq 360\f$ .
......@@ -78,9 +81,10 @@ scaled to fit the 0 to 1 range.
\f[L \leftarrow \frac{V_{max} + V_{min}}{2}\f]
\f[S \leftarrow \fork { \frac{V_{max} - V_{min}}{V_{max} + V_{min}} }{if \(L < 0.5\) }
{ \frac{V_{max} - V_{min}}{2 - (V_{max} + V_{min})} }{if \(L \ge 0.5\) }\f]
\f[H \leftarrow \forkthree {{60(G - B)}/{(V_{max}-V_{min})}}{if \(V_{max}=R\) }
\f[H \leftarrow \forkfour {{60(G - B)}/{(V_{max}-V_{min})}}{if \(V_{max}=R\) }
{{120+60(B - R)}/{(V_{max}-V_{min})}}{if \(V_{max}=G\) }
{{240+60(R - G)}/{(V_{max}-V_{min})}}{if \(V_{max}=B\) }\f]
{{240+60(R - G)}/{(V_{max}-V_{min})}}{if \(V_{max}=B\) }
{0}{if \(R=G=B\) }\f]
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
1\f$, \f$0 \leq H \leq 360\f$ .
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册