<div dir="ltr"><div id="gmail-:rm.ma" class="gmail-Mu gmail-SP" style="font-family:roboto,arial,sans-serif;font-size:13px;line-height:16px;margin-bottom:6px;margin-left:9px;margin-right:9px;opacity:1;word-wrap:break-word;word-break:break-word;outline:none;color:rgb(38,50,56)"><span id="gmail-:rm.co" class="gmail-tL8wMe gmail-EMoHub" dir="ltr" style="outline:none">Hi Chandler</span></div><div id="gmail-:s5.ma" class="gmail-Mu gmail-SP" style="font-family:roboto,arial,sans-serif;font-size:13px;line-height:16px;margin-bottom:6px;margin-left:9px;margin-right:9px;opacity:1;word-wrap:break-word;word-break:break-word;outline:none;color:rgb(38,50,56)"><div id="gmail-:s5.at" class="gmail-xH" style="text-align:center;outline:none"></div><span id="gmail-:s5.co" class="gmail-tL8wMe gmail-EMoHub" dir="ltr" style="outline:none">I was wondering Which color schemes I should keep, I am using OrRd for the hard-coded scheme tight now, and PiYg for the Hard coded scheme for graph differences in D29320</span></div><div id="gmail-:s6.ma" class="gmail-Mu gmail-SP" title="23 February 2017 at 12:04:59 UTC+11" style="font-family:roboto,arial,sans-serif;font-size:13px;line-height:16px;margin-bottom:6px;margin-left:9px;margin-right:9px;opacity:1;word-wrap:break-word;word-break:break-word;outline:none;color:rgb(38,50,56)"><div id="gmail-:s6.at" class="gmail-xH" style="text-align:center;outline:none"></div><span id="gmail-:s6.co" class="gmail-tL8wMe gmail-EMoHub" dir="ltr" style="outline:none">I was, on acceptance of those patches going to allow the choice of color scheme by the user in a new patch.</span></div><div id="gmail-:s7.ma" class="gmail-Mu gmail-SP" style="font-family:roboto,arial,sans-serif;font-size:13px;line-height:16px;margin-bottom:6px;margin-left:9px;margin-right:9px;opacity:1;word-wrap:break-word;word-break:break-word;outline:none;color:rgb(38,50,56)"><div id="gmail-:s7.at" class="gmail-xH" style="text-align:center;outline:none"></div><span id="gmail-:s7.co" class="gmail-tL8wMe gmail-EMoHub" dir="ltr" style="outline:none">But if you want a subset of the color-schemes in that patch, which ones would you like?</span></div><div id="gmail-:s7.ma" class="gmail-Mu gmail-SP" style="font-family:roboto,arial,sans-serif;font-size:13px;line-height:16px;margin-bottom:6px;margin-left:9px;margin-right:9px;opacity:1;word-wrap:break-word;word-break:break-word;outline:none;color:rgb(38,50,56)"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 23 February 2017 at 11:58, Chandler Carruth via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">chandlerc added inline comments.<br>
<span class=""><br>
<br>
================<br>
Comment at: tools/llvm-xray/xray-color-<wbr>helper.cc:22-35<br>
+// Static Polynomials for the ColorHelper.<br>
+//<br>
+// In order to calculate these polynomials,<br>
+//   1. Convert the color scheme samples from sRGB to LAB color space.<br>
+//   2. Interpolate between the descrete colors in LAB space using a cubic<br>
+//      spline interpolation.<br>
+//   3. Sample this interpolation at 100 points and convert to sRGB.<br>
----------------<br>
</span><span class="">varno wrote:<br>
> chandlerc wrote:<br>
> > varno wrote:<br>
> > > chandlerc wrote:<br>
> > > > I really think this is more complexity than is reasonable to add to LLVM for this use case.<br>
> > > ><br>
> > > > IMO, we don't need perfectly accurate color interpolation here. We need roughly accurate, *simple* interpolation so that it is useful even where it isn't perfect.<br>
> > > ><br>
> > > > I would strongly suggest switching to what I understand is the very common scheme of RGB -> HSV, linear interpolate, HSV -> RGB process for interpolating colors. That seems likely to be good enough for all realistic usages LLVM will have, and much easier to understand and maintain going forward.<br>
> > > Hi Chandler.<br>
> > ><br>
> > > Colors are hard. Really hard. Especially when you want perceptual uniformity, as we do here. We want our perception of color to present a sense of distance quality. This is an attempt to have good perceptual uniformity in the least complicated way possible.<br>
> > ><br>
> > > I have not heard of anyone interpolating in HSV, can you show an example. Everyone who does this sort of thing interpolates either in RGB very, very carefully (with many had chosen intermediate pointe) or in LAB like I am doing (or using bisection in delta-E).<br>
> > I understand that colors are hard. I just don't believe that it is actually important to have (perfect) perceptual uniformity for these particular use cases.<br>
> ><br>
> > I think that for tools like this, being close or having a rough correspondence is more than enough. If someone wants to get precise, they should use the actual data and not colors. The colors are to help *at a glance*.<br>
> ><br>
> > Interpolating using HSV is the first answer to the first SO question I find when I search on Google for "interpolating between two colors":<br>
> > <a href="http://stackoverflow.com/questions/13488957/interpolate-from-one-color-to-another" rel="noreferrer" target="_blank">http://stackoverflow.com/<wbr>questions/13488957/<wbr>interpolate-from-one-color-to-<wbr>another</a><br>
> ><br>
> > So, I guess not everyone?<br>
> ><br>
> > Still, my comment remains in essence: this is too complicated for the value it brings. We should use a simpler solution with lower quality because the qualitative difference won't matter here. SO suggests one approach that seems reasonably simple. I'm happy for you to suggest other approaches, but they need to be similarly simple.<br>
> Hi Chandler<br>
><br>
> This patch implements the interpolation in HSV as requested.<br>
</span>Thanks, this is already tremendously simpler.<br>
<br>
I'd also suggest starting with a fairly small set of colors / schemes. I think 2 or 3 are fine. IT is easy to add more if and when we have a compelling use case for more color schemes. Until then, YAGNI -- we shouldn't add the code.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D29363" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D29363</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>