21template<
bool isStep = false, u
int32_t rampUpdateLenght_ms = 55,
bool shouldSaturateRamp = false>
struct PaletteMode :
24 static constexpr uint8_t dissolveBufferId = 0;
28 static void on_enter_mode(
auto& ctx)
31 ctx.template set_config_bool<ConfigKeys::rampSaturates>(shouldSaturateRamp);
33 ctx.template set_config_bool<ConfigKeys::customRampAnimEffect>(
false);
35 ctx.template set_config_u32<ConfigKeys::customRampStepSpeedMs>(rampUpdateLenght_ms);
37 sunsetAnimation.reset(ctx);
40 ctx.overlay_animate_ramp(255, ctx.state.palette, 1000);
43 static void loop(
auto& ctx)
48 const uint8_t customRamp = ctx.get_active_custom_ramp();
49 uint32_t color = modes::colors::from_palette<not shouldSaturateRamp>(
51 static_cast<uint8_t
>(isStep ? (customRamp >> 4) << 4 : customRamp),
56 ctx.lamp.fill(color, ctx.lamp.template getTempBuffer<dissolveBufferId>());
59 sunsetAnimation.loop(ctx, color);
Define some animations to fade out modes.
static constexpr PaletteTy PaletteBlackBodyColors
Black body radiation, with the high end changed to be nicer.
Definition: palettes.hpp:396
static constexpr PaletteTy PalettePartyColors
basically, HSV with no green. looks better when lighing people
Definition: palettes.hpp:378
static constexpr PaletteTy PaletteOceanColors
Ocean colors, blues and whites.
Definition: palettes.hpp:306
std::array< uint32_t, 16 > PaletteTy
Palette types.
Definition: palettes.hpp:18
static constexpr PaletteTy PaletteForestColors
Forest colors, greens.
Definition: palettes.hpp:342
static constexpr PaletteTy PaletteRainbowColors
HSV Rainbow.
Definition: palettes.hpp:360
static constexpr PaletteTy PalettePapiColors
Palette of nice handpicked colors.
Definition: palettes.hpp:450
modes::GroupFor< fixed::PalettePartyMode, fixed::PaletteForestMode, fixed::PaletteOceanMode > MiscFixedModes
Fixed palette colors modes.
Definition: fixed_modes.hpp:148
modes::GroupFor< fixed::PaletteBlackBodyMode, fixed::PaletteRainbowMode, fixed::PalettePapiMode > FixedModes
Fixed modes groups.
Definition: fixed_modes.hpp:146
GroupTy< std::tuple< Modes... > > GroupFor
Group together many different modes::BasicMode.
Definition: group_type.hpp:335
Program scope.
Definition: control_fixed_modes.hpp:12
Define some useful color palettes, and tools to use them.
Parent object for all custom user modes.
Definition: mode_type.hpp:53
Make an animation disapear with gravity.
Definition: fadeout.hpp:20
void update_depop_rate(auto &ctx, const float progress)
Update the drop rate.
Definition: fadeout.hpp:72
Definition: fixed_modes.hpp:89
static constexpr modes::colors::PaletteTy palette
Color palette to use.
Definition: fixed_modes.hpp:91
BlackBody temperature fixed colors ramp mode.
Definition: fixed_modes.hpp:87
Definition: fixed_modes.hpp:113
static constexpr modes::colors::PaletteTy palette
Color palette to use.
Definition: fixed_modes.hpp:115
Forest fixed colors ramp mode.
Definition: fixed_modes.hpp:111
Single-color mode for indexable strips with palette ramp.
Definition: fixed_modes.hpp:23
static void sunset_update(auto &ctx, float progress)
Sunset timer will drop pixels downward, and never display them again.
Definition: fixed_modes.hpp:63
static constexpr bool hasSunsetAnimation
sunset animation on the fixed modes
Definition: fixed_modes.hpp:68
static constexpr bool hasCustomRamp
hint manager to save our custom ramp
Definition: fixed_modes.hpp:66
Definition: fixed_modes.hpp:125
static constexpr modes::colors::PaletteTy palette
Color palette to use.
Definition: fixed_modes.hpp:127
Ocean fixed colors ramp mode.
Definition: fixed_modes.hpp:123
Definition: fixed_modes.hpp:137
static constexpr modes::colors::PaletteTy palette
Color palette to use.
Definition: fixed_modes.hpp:139
Special colored palette step mode. Ideal to set a target prefered color.
Definition: fixed_modes.hpp:135
Definition: fixed_modes.hpp:101
static constexpr modes::colors::PaletteTy palette
Color palette to use.
Definition: fixed_modes.hpp:103
Party fixed colors ramp mode.
Definition: fixed_modes.hpp:99
Definition: fixed_modes.hpp:77
static constexpr modes::colors::PaletteTy palette
Color palette to use.
Definition: fixed_modes.hpp:79
Rainbow fixed colors ramp mode.
Definition: fixed_modes.hpp:75