MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / cssHueToRgb

Function cssHueToRgb

libs/echarts/echarts-en.simple.js:3805–3823  ·  view source on GitHub ↗
(m1, m2, h)

Source from the content-addressed store, hash-verified

3803}
3804
3805function cssHueToRgb(m1, m2, h) {
3806 if (h < 0) {
3807 h += 1;
3808 }
3809 else if (h > 1) {
3810 h -= 1;
3811 }
3812
3813 if (h * 6 < 1) {
3814 return m1 + (m2 - m1) * h * 6;
3815 }
3816 if (h * 2 < 1) {
3817 return m2;
3818 }
3819 if (h * 3 < 2) {
3820 return m1 + (m2 - m1) * (2 / 3 - h) * 6;
3821 }
3822 return m1;
3823}
3824
3825function setRgba(out, r, g, b, a) {
3826 out[0] = r;

Callers 1

hsla2rgbaFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected