MCPcopy Create free account
hub / github.com/SpaiR/imgui-java / hue2rgb

Method hue2rgb

imgui-binding/src/main/java/imgui/ImColor.java:184–208  ·  view source on GitHub ↗
(final float p, final float q, final float hue)

Source from the content-addressed store, hash-verified

182 }
183
184 private static float hue2rgb(final float p, final float q, final float hue) {
185 float h = hue;
186
187 if (h < 0) {
188 h += 1;
189 }
190
191 if (h > 1) {
192 h -= 1;
193 }
194
195 if (6 * h < 1) {
196 return p + ((q - p) * 6 * h);
197 }
198
199 if (2 * h < 1) {
200 return q;
201 }
202
203 if (3 * h < 2) {
204 return p + ((q - p) * 6 * ((2.0f / 3.0f) - h));
205 }
206
207 return p;
208 }
209}

Callers 1

hslToColorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected