MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / hue2rgb

Function hue2rgb

sourcecommon/gr.cpp:8–15  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

6
7//---------------------------------------------------------------------------
8static double hue2rgb(double p, double q, double t){
9 if(t < 0) t += 1;
10 if(t > 1) t -= 1;
11 if(t < 1.0/6) return p + (q - p) * 6 * t;
12 if(t < 1.0/2) return q;
13 if(t < 2.0/3) return p + (q - p) * (2.0/3 - t) * 6;
14 return p;
15}
16//---------------------------------------------------------------------------
17TColor fromHSL(double h,double s,double l){
18 double r, g, b;

Callers 1

fromHSLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected