Skip to content

Instantly share code, notes, and snippets.

@KTibow
Created August 19, 2023 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KTibow/933856ba2959db624df40c2b20c27c17 to your computer and use it in GitHub Desktop.
Save KTibow/933856ba2959db624df40c2b20c27c17 to your computer and use it in GitHub Desktop.
chroma haze esphome light strip effect
- addressable_lambda:
name: "Chroma Haze"
update_interval: 100ms
lambda: |
static uint8_t hue = 160;
static uint16_t saturation = 255;
hue = hue - 5 + (uint16_t)(random_float() * 10);
float rand_v = random_float();
uint16_t new_saturation = 255 - (uint16_t)(rand_v * rand_v * 200);
saturation = (saturation * 7 + new_saturation) / 8;
if ((hue < 30 || hue > 225) && saturation > 200) {
saturation = (saturation * 2 + 180) / 3;
}
it.shift_right(1);
it[0] = ESPHSVColor(hue, saturation, 255);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment