MCPcopy Create free account
hub / github.com/alicevision/AliceVision / hue2rgb

Function hue2rgb

src/software/export/main_exportMatches.cpp:48–61  ·  view source on GitHub ↗

Convert HUE color to RGB

Source from the content-addressed store, hash-verified

46
47// Convert HUE color to RGB
48inline float hue2rgb(float p, float q, float t)
49{
50 if (t < 0)
51 t += 1;
52 if (t > 1)
53 t -= 1;
54 if (t < 1.f / 6.f)
55 return p + (q - p) * 6.f * t;
56 if (t < 1.f / 2.f)
57 return q;
58 if (t < 2.f / 3.f)
59 return p + (q - p) * (2.f / 3.f - t) * 6.f;
60 return p;
61}
62
63// Converts an HSL color value to RGB. Conversion formula
64// adapted from http://en.wikipedia.org/wiki/HSL_color_space.

Callers 1

hslToRgbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected