31 template <
typename T>
void accept(
const T &obj) {
46 "Gradient::fill: indices and output must be the same size");
50 for (
size_t i = 0; i <
n; ++i) {
56 for (
size_t i = 0; i <
n; ++i) {
62 for (
size_t i = 0; i <
n; ++i) {
68 for (
size_t i = 0; i <
n; ++i) {
73 template <
typename T>
void accept(
const T &obj) {
87 Visitor visitor(index);
89 return visitor.return_val;
108 if (
this != &other) {
115 VisitorFill visitor(input, output);
120 Visitor visitor(index);
122 return visitor.return_val;
126 VisitorFill visitor(input, output);
133 Copy(
Gradient &owner) : mOwner(owner) {}
134 void accept(
const CRGBPalette16 &
palette) { mOwner.set(&
palette); }
135 void accept(
const CRGBPalette32 &
palette) { mOwner.set(&
palette); }
136 void accept(
const CRGBPalette256 &
palette) { mOwner.set(&
palette); }
140 Copy copy_to_self(*
this);
UINumberField palette("Palette", 0, 0, 2)
void set(const CRGBPalette16 *palette)
CRGB colorAt(uint8_t index) const
fl::function< CRGB(uint8_t index)> GradientFunction
void fill(Slice< const uint8_t > input, Slice< CRGB > output) const
Gradient & operator=(const Gradient &other)
CRGB colorAt(uint8_t index) const
void fill(Slice< const uint8_t > input, Slice< CRGB > output) const
GradientVariant & variant()
void visit(Visitor &visitor)
CRGB ColorFromPaletteExtended(const CRGBPalette32 &pal, uint16_t index, uint8_t brightness, TBlendType blendType)
CRGB ColorFromPalette(const CRGBPalette16 &pal, uint8_t index, uint8_t brightness, TBlendType blendType)
Utility functions for color fill, palettes, blending, and more.
constexpr remove_reference< T >::type && move(T &&t) noexcept
Implements a simple red square effect for 2D LED grids.
Representation of an RGB pixel (Red, Green, Blue)
void accept(const CRGBPalette16 *palette)
void accept(const Gradient::GradientFunction &func)
void accept(const CRGBPalette256 *palette)
void accept(const CRGBPalette32 *palette)
void accept(const T &obj)
Slice< const uint8_t > indices
void accept(const CRGBPalette256 *palette)
VisitorFill(Slice< const uint8_t > indices, Slice< CRGB > output)
void accept(const Gradient::GradientFunction &func)
void accept(const CRGBPalette16 *palette)
void accept(const T &obj)
void accept(const CRGBPalette32 *palette)