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

◆ noiseRingHSV8()

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

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

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

Parameters
anglePosition around the ring (radians, 0 to 2π)
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
Examples
FxNoiseRing.ino.

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

51 {
52 fl::HSV16 hsv16 = noiseRingHSV16(angle, time, radius);
53
54 // Scale 16-bit components down to 8-bit using bit shift with rounding
55 // This preserves the relative position in the value range
56 u8 h = (hsv16.h + 128) >> 8;
57 u8 s = (hsv16.s + 128) >> 8;
58 u8 v = (hsv16.v + 128) >> 8;
59
60 return CHSV(h, s, v);
61}
fl::hsv8 CHSV
Definition chsv.h:11
HSV16 noiseRingHSV16(float angle, u32 time, float radius)
Ring noise functions - sample three z-slices for independent component evolution.
Definition noise.cpp.hpp:27
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, noiseRingHSV16(), fl::HSV16::s, time(), and fl::HSV16::v.

Referenced by draw().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: