FastLED 3.10.8
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 122 of file noise.cpp.hpp.

122 {
123 HSV16 hsv16 = noiseSphereHSV16(angle, phi, time, radius);
124
125 // Scale 16-bit components down to 8-bit using bit shift with rounding
126 // This preserves the relative position in the value range
127 u8 h = (hsv16.h + 128) >> 8;
128 u8 s = (hsv16.s + 128) >> 8;
129 u8 v = (hsv16.v + 128) >> 8;
130
131 return CHSV(h, s, v);
132}
fl::hsv8 CHSV
Definition chsv.h:11
HSV16 noiseSphereHSV16(float angle, float phi, u32 time, float radius) FL_NO_EXCEPT
Sphere noise functions - sample three z-slices for independent component evolution.
Definition noise.cpp.hpp:95
unsigned char u8
Definition stdint.h:131
fl::u64 time() FL_NO_EXCEPT
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_NO_EXCEPT, fl::HSV16::h, noiseSphereHSV16(), fl::HSV16::s, time(), and fl::HSV16::v.

+ Here is the call graph for this function: