[config.h] Declaring reused styles as variables

Hi,

I’m trying to declare my styles before Preset preset = [...] to reuse them inside the preset and to avoid copy-pasting the same style in half of the presets. This would also dramatically increase readability of our configs.

What I think I need is to now how to actually do it - that is to know what type to give to the style.

I took StyleAllocator from struct Preset definition but I’m not sure this is the way to go

StyleAllocator bladeStyleRed = StylePtr<Layers<ColorSelect<IntAr... ; //omit fn call "()" and call inside preset
StyleAllocator bladeStyleBlue= StylePtr<Layers<ColorSelect<IntAr... ;
StyleAllocator pixelStyleOrangeBlinkingBatt = StylePtr<Layers<RgbArg...;

Preset presets[] = {
    {"Maul", "tracks/fates.wav",  bladeStyleRed(), pixelStyleOrangeBlinkingBatt(),  "red"},
    {"Ani", "tracks/tusken.wav",  bladeStyleBlue(), pixelStyleOrangeBlinkingBatt(), "blue"},
     //...
}

Any advice how to do it properly is most welcome :slight_smile:

Try setting up as “using”, I’ll be adding this ability, suggested by profezzorn, in the next update to the library.