MCPcopy Create free account
hub / github.com/FastLED/FastLED / noiseSphereHSV8

Function noiseSphereHSV8

src/fl/gfx/noise/noise.cpp.hpp:121–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121CHSV 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
133CRGB noiseSphereCRGB(float angle, float phi, u32 time, float radius) {
134 // Convert spherical coordinates to cartesian

Callers 1

FL_TEST_FILEFunction · 0.85

Calls 1

noiseSphereHSV16Function · 0.85

Tested by

no test coverage detected