Created
August 19, 2023 17:39
-
-
Save KTibow/933856ba2959db624df40c2b20c27c17 to your computer and use it in GitHub Desktop.
chroma haze esphome light strip effect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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