#pragma once #include "fl/leds.h" #include "fl/stdint.h" namespace fl { template class Grid; // Memory safe clear function for CRGB arrays. template inline void clear(CRGB (&arr)[N]) { for (int i = 0; i < N; ++i) { arr[i] = CRGB::Black; } } inline void clear(Leds &leds) { leds.fill(CRGB::Black); } template inline void clear(LedsXY &leds) { leds.fill(CRGB::Black); } template inline void clear(Grid &grid) { grid.clear(); } // Default, when you don't know what do then call clear. template inline void clear(Container &container) { container.clear(); } } // namespace fl