[PATCH] D29363: [XRAY] A Color Choosing helper for XRay Graph

Alexis Shaw via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 20 01:51:30 PST 2017


varno added inline comments.


================
Comment at: tools/llvm-xray/xray-color-helper.cc:22-35
+// Static Polynomials for the ColorHelper.
+//
+// In order to calculate these polynomials,
+//   1. Convert the color scheme samples from sRGB to LAB color space.
+//   2. Interpolate between the descrete colors in LAB space using a cubic
+//      spline interpolation.
+//   3. Sample this interpolation at 100 points and convert to sRGB.
----------------
chandlerc wrote:
> I really think this is more complexity than is reasonable to add to LLVM for this use case.
> 
> 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.
> 
> 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.
Hi Chandler.

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.

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).


https://reviews.llvm.org/D29363





More information about the llvm-commits mailing list