<table><tr><td style="">ndavis added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D27017">View Revision</a></tr></table><br /><div><div><p>I emailed Matthew Woehlke:</p>
<p>Me:</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>I noticed that the minimum value for hue was -0.166667 (#ff00ff) and<br />
the maximum was almost 0.833333 (slightly less red than #ff00ff). Is<br />
this intentional or a bug? It's a bit hard to tell how the math is<br />
meant to work.</p></blockquote>
<p>Matthew Woehlke:</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>I assume you're talking about the hue that is calculated when converting<br />
*from* RGB?</p>
<p>Yes, that looks intentional. There are three branches for computing the<br />
hue, based on which component is "dominant" (i.e. has the largest<br />
value), which produce values of 0/3, 1/3 and 2/3, ±1/6.</p>
<p>Keep in mind that "hue" is a cyclic value, i.e. h=1.5 is perfectly valid<br />
and should produce the same result as h=0.5, h=-0.5, etc. (Note that<br />
conversion *to* RGB starts by normalizing hue.)</p>
<p>Basically, since it is desirable to accept denormalized hue anyway, it<br />
is slightly easier (read: less code, fewer machine instructions) to not<br />
bother normalizing it in conversion from RGB. If you are extracting HCY<br />
values for display purposes, you should apply the <tt style="background: #ebebeb; font-size: 13px;">wrap</tt> helper function<br />
to the value first.</p></blockquote>
</div></div><br /><div><strong>REPOSITORY</strong><div><div>R273 KGuiAddons</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D27017">https://phabricator.kde.org/D27017</a></div></div><br /><div><strong>To: </strong>ndavis, Frameworks, dfaure<br /><strong>Cc: </strong>broulik, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns<br /></div>