6#define FASTLED_INTERNAL
23 "Palette size mismatch");
110 static uint8_t ihue = 0;
112 for (uint16_t i = 0; i <
width; i++) {
113 for (uint16_t j = 0; j <
height; j++) {
147 uint8_t dataSmoothing = 0;
149 dataSmoothing = 200 - (
speed * 4);
152 for (uint16_t i = 0; i <
width; i++) {
153 int ioffset =
scale * i;
154 for (uint16_t j = 0; j <
height; j++) {
155 int joffset =
scale * j;
163 data =
qsub8(data, 16);
168 uint8_t newdata =
scale8(olddata, dataSmoothing) +
169 scale8(data, 256 - dataSmoothing);
186 uint8_t new_idx =
random8() % 12;
central include file for FastLED, defines the CFastLED class/object
RGB color palette with 16 discrete values.
uint16_t xyMap(uint16_t x, uint16_t y) const
CRGBPalette16 currentPalette
void SetupBlackAndWhiteStripedPalette()
uint8_t changeToRandomPalette()
void mapNoiseToLEDsUsingPalette(CRGB *leds)
uint16_t XY(uint8_t x, uint8_t y) const
fl::scoped_array< uint8_t > noise
void SetupPurpleAndGreenPalette()
void SetupRandomPalette()
NoisePalette(XYMap xyMap, float fps=60.f)
void setPalettePreset(int paletteIndex)
LIB8STATIC uint8_t dim8_raw(uint8_t x)
Adjust a scaling value for dimming.
LIB8STATIC_ALWAYS_INLINE uint8_t qadd8(uint8_t i, uint8_t j)
Add one byte to another, saturating at 0xFF.
LIB8STATIC_ALWAYS_INLINE uint8_t qsub8(uint8_t i, uint8_t j)
Subtract one byte from another, saturating at 0x00.
uint8_t inoise8(uint16_t x, uint16_t y, uint16_t z)
8-Bit, fixed point implementation of Perlin's noise.
CRGB ColorFromPalette(const CRGBPalette16 &pal, uint8_t index, uint8_t brightness, TBlendType blendType)
Get a color from a palette.
const TProgmemRGBPalette16 RainbowStripeColors_p
HSV Rainbow colors with alternatating stripes of black.
const TProgmemRGBPalette16 OceanColors_p
Ocean colors, blues and whites.
const TProgmemRGBPalette16 CloudColors_p
Cloudy color palette.
const TProgmemRGBPalette16 ForestColors_p
Forest colors, greens.
const TProgmemRGBPalette16 LavaColors_p
Lava color palette.
const TProgmemRGBPalette16 PartyColors_p
HSV color ramp: blue, purple, pink, red, orange, yellow (and back).
const TProgmemRGBPalette16 RainbowColors_p
HSV Rainbow.
LIB8STATIC uint16_t random16()
Generate a 16-bit random number.
LIB8STATIC uint8_t random8()
Generate an 8-bit random number.
LIB8STATIC_ALWAYS_INLINE uint8_t scale8(uint8_t i, fract8 scale)
Scale one byte by a second one, which is treated as the numerator of a fraction whose denominator is ...
Implements a simple red square effect for 2D LED grids.
Functions to generate and fill arrays with noise.
Demonstrates how to mix noise generation with color palettes on a 2D LED matrix.
Fast, efficient random number generators specifically designed for high-performance LED programming.
Representation of an RGB pixel (Red, Green, Blue)