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/gfx/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;
42using fl::fill_palette;
46using fl::fill_solid;
47using fl::fill_palette_circular;
48using fl::map_data_into_colors_through_palette;
51using fl::blurColumns;
52using fl::blurRows;
53using fl::blur1d;
54using fl::blur2d;
55using fl::nblend;
57
59using fl::fill_gradient_HSV;
60
61// TGradientDirectionCode values.
66
67// TBlendType values.
68using fl::NOBLEND;
69using fl::BLEND;
70using fl::LINEARBLEND;
71using fl::LINEARBLEND_NOWRAP;
72
73
120FL_DISABLE_WARNING(pedantic)
121
122#define DEFINE_GRADIENT_PALETTE(X) \
123 FL_ALIGN_PROGMEM(4) \
124 extern const TProgmemRGBGradientPalette_byte X[] FL_PROGMEM =
125
127#define DECLARE_GRADIENT_PALETTE(X) \
128 FL_ALIGN_PROGMEM(4) \
129 extern const TProgmemRGBGradientPalette_byte X[] FL_PROGMEM
130
Utility functions for color fill, palettes, blending, and more.
void fill_rainbow_circular(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.hpp:53
void fill_rainbow(CRGB *targetArray, int numToFill, u8 initialhue, u8 deltahue)
Fill a range of LEDs with a rainbow of colors.
Definition fill.cpp.hpp:29
void fill_gradient(T *targetArray, u16 startpos, CHSV startcolor, u16 endpos, CHSV endcolor, TGradientDirectionCode directionCode=SHORTEST_HUES) FL_NOEXCEPT
Fill a range of LEDs with a smooth HSV gradient between two HSV colors.
Definition fill.h:105
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.hpp:107
void fill_solid(CRGB *targetArray, int numToFill, const CRGB &color)
Fill a range of LEDs with a solid color.
Definition fill.cpp.hpp: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 blurColumns(fl::span< CRGB > leds, u8 width, u8 height, fract8 blur_amount, const XYMap &xymap) FL_NOEXCEPT
Definition blur.h:161
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)
CRGB16 ColorFromPaletteHD(const CRGBPalette32 &pal, fl::u16 index, fl::u8x8 brightness, TBlendType blendType)
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 blurRows(fl::span< CRGB > leds, u8 width, u8 height, fract8 blur_amount, const XYMap &xymap) FL_NOEXCEPT
Definition blur.h:157
void fadeLightBy(CRGB *leds, fl::u16 num_leds, fl::u8 fadeBy)
CRGB & napplyGamma_video(CRGB &rgb, float gamma)
void blur2d(fl::span< CRGB > leds, u8 width, u8 height, fract8 blur_amount, const XYMap &xymap) FL_NOEXCEPT
Definition blur.h:153
void nblendPaletteTowardPalette(CRGBPalette16 &current, CRGBPalette16 &target, fl::u8 maxChanges)
void blur1d(fl::span< CRGB > leds, fract8 blur_amount) FL_NOEXCEPT
Definition blur.h:150
void nscale8_video(CRGB *leds, fl::u16 num_leds, fl::u8 scale)
#define FL_DISABLE_WARNING(warning)
#define FL_DISABLE_WARNING_PUSH
#define FL_DISABLE_WARNING_POP