FastLED 3.9.15
Loading...
Searching...
No Matches

◆ noiseSphereHSV8()

CHSV fl::noiseSphereHSV8 ( float angle,
float phi,
u32 time,
float radius = 1.0f )

Generate HSV8 (8-bit) noise for a sphere pattern.

Calls noiseSphereHSV16() and scales each component down to 8-bit.

Parameters
angleAzimuth angle around the sphere (radians, 0 to 2π)
phiPolar angle from the north pole (radians, 0 to π)
timeAnimation time parameter
radiusNoise zoom level (level of detail). Larger values = coarser pattern, smaller = more detail (default 1.0)
Returns
HSV8 (CHSV) color with 8-bit components

Definition at line 121 of file noise.cpp.hpp.

121 {
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}
fl::hsv8 CHSV
Definition chsv.h:11
HSV16 noiseSphereHSV16(float angle, float phi, u32 time, float radius)
Sphere noise functions - sample three z-slices for independent component evolution.
Definition noise.cpp.hpp:94
unsigned char u8
Definition stdint.h:131
fl::u64 time() FL_NOEXCEPT
Alias for millis64() - returns 64-bit millisecond time.
Definition chrono.h:346
u16 v
Definition hsv16.h:12
u16 h
Definition hsv16.h:10
u16 s
Definition hsv16.h:11

References fl::HSV16::h, noiseSphereHSV16(), fl::HSV16::s, time(), and fl::HSV16::v.

+ Here is the call graph for this function: