| 119 | } |
| 120 | |
| 121 | CHSV noiseSphereHSV8(float angle, float phi, u32 time, float radius) { |
| 122 | HSV16 hsv16 = noiseSphereHSV16(angle, phi, time, radius); |
| 123 | |
| 124 | // Scale 16-bit components down to 8-bit using bit shift with rounding |
| 125 | // This preserves the relative position in the value range |
| 126 | u8 h = (hsv16.h + 128) >> 8; |
| 127 | u8 s = (hsv16.s + 128) >> 8; |
| 128 | u8 v = (hsv16.v + 128) >> 8; |
| 129 | |
| 130 | return CHSV(h, s, v); |
| 131 | } |
| 132 | |
| 133 | CRGB noiseSphereCRGB(float angle, float phi, u32 time, float radius) { |
| 134 | // Convert spherical coordinates to cartesian |
no test coverage detected