FastLED 3.9.15
Loading...
Searching...
No Matches
colorutils.h
Go to the documentation of this file.
1#pragma once
2
3/*
4Legacy header. Prefer to use fl/colorutils.h instead since
5*/
6#include "fl/colorutils.h"
7
12using fl::fade_raw;
13using fl::nscale8;
15using fl::blend;
16using fl::CRGBPalette16;
17using fl::CRGBPalette32;
18using fl::CRGBPalette256;
19using fl::CHSVPalette16;
20using fl::CHSVPalette32;
21using fl::CHSVPalette256;
22// using fl::TProgmemRGBPalette16;
23// using fl::TProgmemHSVPalette16;
24using fl::HeatColor;
25using fl::TRGBGradientPaletteEntryUnion;
26using fl::TDynamicRGBGradientPalette_byte;
27using fl::TDynamicRGBGradientPalette_bytes;
28// using fl::TProgmemRGBGradientPalette_bytes;
29// using fl::TProgmemRGBGradientPalette_byte;
30// using fl::TProgmemRGBPalette16;
31// using fl::TProgmemRGBGradientPaletteRef;
32
34
35
36using fl::TDynamicRGBGradientPaletteRef;
38using fl::TBlendType;
41using fl::fill_palette;
45using fl::fill_solid;
46using fl::fill_palette_circular;
47using fl::map_data_into_colors_through_palette;
50using fl::blurColumns;
51using fl::blurRows;
52using fl::blur1d;
53using fl::blur2d;
54using fl::nblend;
56
58using fl::fill_gradient_HSV;
59
60// TGradientDirectionCode values.
65
66// TBlendType values.
67using fl::NOBLEND;
68using fl::BLEND;
69using fl::LINEARBLEND;
70using fl::LINEARBLEND_NOWRAP;
71
72
118#pragma GCC diagnostic push
119#pragma GCC diagnostic ignored "-Wpedantic"
120
121#define DEFINE_GRADIENT_PALETTE(X) \
122 FL_ALIGN_PROGMEM \
123 extern const TProgmemRGBGradientPalette_byte X[] FL_PROGMEM =
124
126#define DECLARE_GRADIENT_PALETTE(X) \
127 FL_ALIGN_PROGMEM \
128 extern const TProgmemRGBGradientPalette_byte X[] FL_PROGMEM
129
130#pragma GCC diagnostic pop
Utility functions for color fill, palettes, blending, and more.
void blurColumns(CRGB *leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const XYMap &xyMap)
Perform a blur1d() on every column of a rectangular matrix.
Definition blur.cpp:112
void blurRows(CRGB *leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const XYMap &xyMap)
Perform a blur1d() on every row of a rectangular matrix.
Definition blur.cpp:84
void blur2d(CRGB *leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const XYMap &xymap)
Two-dimensional blur filter.
Definition blur.cpp:72
void fill_gradient_RGB(CRGB *leds, u16 startpos, CRGB startcolor, u16 endpos, CRGB endcolor)
Fill a range of LEDs with a smooth RGB gradient between two RGB colors.
Definition fill.cpp:107
void fill_gradient(T *targetArray, u16 startpos, CHSV startcolor, u16 endpos, CHSV endcolor, TGradientDirectionCode directionCode=SHORTEST_HUES)
Fill a range of LEDs with a smooth HSV gradient between two HSV colors.
Definition fill.h:87
void fill_rainbow_circular(struct CRGB *targetArray, int numToFill, u8 initialhue, bool reversed)
Fill a range of LEDs with a rainbow of colors, so that the hues are continuous between the end of the...
Definition fill.cpp:53
void fill_rainbow(struct CRGB *targetArray, int numToFill, u8 initialhue, u8 deltahue)
Fill a range of LEDs with a rainbow of colors.
Definition fill.cpp:29
void fill_solid(struct CRGB *targetArray, int numToFill, const struct CRGB &color)
Fill a range of LEDs with a solid color.
Definition fill.cpp:9
TGradientDirectionCode
Hue direction for calculating fill gradients.
@ SHORTEST_HUES
Hue goes whichever way is shortest.
@ LONGEST_HUES
Hue goes whichever way is longest.
@ FORWARD_HUES
Hue always goes clockwise around the color wheel.
@ BACKWARD_HUES
Hue always goes counter-clockwise around the color wheel.
void fadeUsingColor(CRGB *leds, fl::u16 numLeds, const CRGB &colormask)
void UpscalePalette(const class CRGBPalette16 &srcpal16, class CRGBPalette256 &destpal256)
void fadeToBlackBy(CRGB *leds, fl::u16 num_leds, fl::u8 fadeBy)
CRGB ColorFromPalette(const CRGBPalette16 &pal, fl::u8 index, fl::u8 brightness, TBlendType blendType)
void nscale8(CRGB *leds, fl::u16 num_leds, fl::u8 scale)
void fade_raw(CRGB *leds, fl::u16 num_leds, fl::u8 fadeBy)
void fade_video(CRGB *leds, fl::u16 num_leds, fl::u8 fadeBy)
CRGB ColorFromPaletteExtended(const CRGBPalette32 &pal, fl::u16 index, fl::u8 brightness, TBlendType blendType)
void blur1d(CRGB *leds, fl::u16 numLeds, fract8 blur_amount)
Definition blur.cpp:55
fl::u8 applyGamma_video(fl::u8 brightness, float gamma)
CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
CRGB & nblend(CRGB &existing, const CRGB &overlay, fract8 amountOfOverlay)
CRGB HeatColor(fl::u8 temperature)
void fadeLightBy(CRGB *leds, fl::u16 num_leds, fl::u8 fadeBy)
CRGB & napplyGamma_video(CRGB &rgb, float gamma)
void nblendPaletteTowardPalette(CRGBPalette16 &current, CRGBPalette16 &target, fl::u8 maxChanges)
void nscale8_video(CRGB *leds, fl::u16 num_leds, fl::u8 scale)