FastLED 3.9.7
|
RGB color palette with 256 discrete values.
Definition at line 1738 of file colorutils.h.
#include <colorutils.h>
Public Member Functions | |
CRGBPalette256 () | |
Default constructor. | |
CRGBPalette256 (const CRGB &c00, const CRGB &c01, const CRGB &c02, const CRGB &c03, const CRGB &c04, const CRGB &c05, const CRGB &c06, const CRGB &c07, const CRGB &c08, const CRGB &c09, const CRGB &c10, const CRGB &c11, const CRGB &c12, const CRGB &c13, const CRGB &c14, const CRGB &c15) | |
Create palette from 16 CRGB values. | |
CRGBPalette256 (const CRGBPalette256 &rhs) | |
Copy constructor. | |
CRGBPalette256 (const CRGB rhs[256]) | |
Create palette from array of CRGB colors. | |
CRGBPalette256 & | operator= (const CRGBPalette256 &rhs) |
Copy constructor. | |
CRGBPalette256 & | operator= (const CRGB rhs[256]) |
Create palette from array of CRGB colors. | |
CRGBPalette256 (const CHSVPalette256 &rhs) | |
Create palette from CHSV palette. | |
CRGBPalette256 (const CHSV rhs[256]) | |
Create palette from array of CHSV colors. | |
CRGBPalette256 & | operator= (const CHSVPalette256 &rhs) |
Copy constructor. | |
CRGBPalette256 & | operator= (const CHSV rhs[256]) |
Create palette from array of CHSV colors. | |
CRGBPalette256 (const CRGBPalette16 &rhs16) | |
Create upscaled palette from 16-entry palette. | |
CRGBPalette256 & | operator= (const CRGBPalette16 &rhs16) |
Create upscaled palette from 16-entry palette. | |
CRGBPalette256 (const TProgmemRGBPalette16 &rhs) | |
Create palette from palette stored in PROGMEM. | |
CRGBPalette256 & | operator= (const TProgmemRGBPalette16 &rhs) |
Create palette from palette stored in PROGMEM. | |
bool | operator== (const CRGBPalette256 &rhs) const |
Check if two palettes have the same color entries. | |
bool | operator!= (const CRGBPalette256 &rhs) const |
Check if two palettes do not have the same color entries. | |
CRGB & | operator[] (uint8_t x) |
Array access operator to index into the gradient entries. | |
const CRGB & | operator[] (uint8_t x) const |
Array access operator to index into the gradient entries. | |
CRGB & | operator[] (int x) |
Array access operator to index into the gradient entries. | |
const CRGB & | operator[] (int x) const |
Array access operator to index into the gradient entries. | |
operator CRGB * () | |
Get the underlying pointer to the CHSV entries making up the palette. | |
CRGBPalette256 (const CHSV &c1) | |
Create palette filled with one color. | |
CRGBPalette256 (const CHSV &c1, const CHSV &c2) | |
Create palette with a gradient from one color to another. | |
CRGBPalette256 (const CHSV &c1, const CHSV &c2, const CHSV &c3) | |
Create palette with three-color gradient. | |
CRGBPalette256 (const CHSV &c1, const CHSV &c2, const CHSV &c3, const CHSV &c4) | |
Create palette with four-color gradient. | |
CRGBPalette256 (const CRGB &c1) | |
Create palette filled with one color. | |
CRGBPalette256 (const CRGB &c1, const CRGB &c2) | |
Create palette with a gradient from one color to another. | |
CRGBPalette256 (const CRGB &c1, const CRGB &c2, const CRGB &c3) | |
Create palette with three-color gradient. | |
CRGBPalette256 (const CRGB &c1, const CRGB &c2, const CRGB &c3, const CRGB &c4) | |
Create palette with four-color gradient. | |
CRGBPalette256 (TProgmemRGBGradientPalette_bytes progpal) | |
Creates a palette from a gradient palette in PROGMEM. | |
CRGBPalette256 & | operator= (TProgmemRGBGradientPalette_bytes progpal) |
Creates a palette from a gradient palette in PROGMEM. | |
CRGBPalette256 & | loadDynamicGradientPalette (TDynamicRGBGradientPalette_bytes gpal) |
Creates a palette from a gradient palette in dynamic (heap) memory. | |
Public Attributes | |
CRGB | entries [256] |
the color entries that make up the palette | |
|
inline |
Default constructor.
Definition at line 1743 of file colorutils.h.
|
inline |
Create palette from 16 CRGB values.
Definition at line 1750 of file colorutils.h.
|
inline |
Copy constructor.
Definition at line 1761 of file colorutils.h.
|
inline |
Create palette from array of CRGB colors.
Definition at line 1766 of file colorutils.h.
|
inline |
Create palette from CHSV palette.
Definition at line 1784 of file colorutils.h.
|
inline |
Create palette from array of CHSV colors.
Definition at line 1791 of file colorutils.h.
|
inline |
Create upscaled palette from 16-entry palette.
Definition at line 1815 of file colorutils.h.
|
inline |
Create palette from palette stored in PROGMEM.
Definition at line 1827 of file colorutils.h.
|
inline |
Create palette filled with one color.
c1 | the color to fill the palette with |
Definition at line 1888 of file colorutils.h.
Create palette with a gradient from one color to another.
c1 | the starting color for the gradient |
c2 | the end color for the gradient |
Definition at line 1893 of file colorutils.h.
Create palette with three-color gradient.
c1 | the starting color for the gradient |
c2 | the middle color for the gradient |
c3 | the end color for the gradient |
Definition at line 1898 of file colorutils.h.
|
inline |
Create palette with four-color gradient.
c1 | the starting color for the gradient |
c2 | the first middle color for the gradient |
c3 | the second middle color for the gradient |
c4 | the end color for the gradient |
Definition at line 1903 of file colorutils.h.
|
inline |
Create palette filled with one color.
c1 | the color to fill the palette with |
Definition at line 1909 of file colorutils.h.
Create palette with a gradient from one color to another.
c1 | the starting color for the gradient |
c2 | the end color for the gradient |
Definition at line 1914 of file colorutils.h.
Create palette with three-color gradient.
c1 | the starting color for the gradient |
c2 | the middle color for the gradient |
c3 | the end color for the gradient |
Definition at line 1919 of file colorutils.h.
|
inline |
Create palette with four-color gradient.
c1 | the starting color for the gradient |
c2 | the first middle color for the gradient |
c3 | the second middle color for the gradient |
c4 | the end color for the gradient |
Definition at line 1924 of file colorutils.h.
|
inline |
Creates a palette from a gradient palette in PROGMEM.
Gradient palettes are loaded into CRGBPalettes in such a way that, if possible, every color represented in the gradient palette is also represented in the CRGBPalette.
For example, consider a gradient palette that is all black except for a single, one-element-wide (1/256th!) spike of red in the middle:
A naive conversion of this 256-element palette to a 16-element palette might accidentally completely eliminate the red spike, rendering the palette completely black.
However, the conversions provided here would attempt to include a the red stripe in the output, more-or-less as faithfully as possible. So in this case, the resulting CRGBPalette16 palette would have a red stripe in the middle which was 1/16th of a palette wide – the narrowest possible in a CRGBPalette16.
This means that the relative width of stripes in a CRGBPalette16 will be, by definition, different from the widths in the gradient palette. This code attempts to preserve "all the colors", rather than the exact stripe widths at the expense of dropping some colors.
Definition at line 1930 of file colorutils.h.
|
inline |
Creates a palette from a gradient palette in dynamic (heap) memory.
Gradient palettes are loaded into CRGBPalettes in such a way that, if possible, every color represented in the gradient palette is also represented in the CRGBPalette.
For example, consider a gradient palette that is all black except for a single, one-element-wide (1/256th!) spike of red in the middle:
A naive conversion of this 256-element palette to a 16-element palette might accidentally completely eliminate the red spike, rendering the palette completely black.
However, the conversions provided here would attempt to include a the red stripe in the output, more-or-less as faithfully as possible. So in this case, the resulting CRGBPalette16 palette would have a red stripe in the middle which was 1/16th of a palette wide – the narrowest possible in a CRGBPalette16.
This means that the relative width of stripes in a CRGBPalette16 will be, by definition, different from the widths in the gradient palette. This code attempts to preserve "all the colors", rather than the exact stripe widths at the expense of dropping some colors.
Definition at line 1955 of file colorutils.h.
|
inline |
Get the underlying pointer to the CHSV entries making up the palette.
Definition at line 1882 of file colorutils.h.
|
inline |
Check if two palettes do not have the same color entries.
Definition at line 1854 of file colorutils.h.
|
inline |
Create palette from array of CHSV colors.
Definition at line 1806 of file colorutils.h.
|
inline |
Copy constructor.
Definition at line 1798 of file colorutils.h.
|
inline |
Create palette from array of CRGB colors.
Definition at line 1777 of file colorutils.h.
|
inline |
Create upscaled palette from 16-entry palette.
Definition at line 1820 of file colorutils.h.
|
inline |
Copy constructor.
Definition at line 1771 of file colorutils.h.
|
inline |
Create palette from palette stored in PROGMEM.
Definition at line 1833 of file colorutils.h.
|
inline |
Creates a palette from a gradient palette in PROGMEM.
Gradient palettes are loaded into CRGBPalettes in such a way that, if possible, every color represented in the gradient palette is also represented in the CRGBPalette.
For example, consider a gradient palette that is all black except for a single, one-element-wide (1/256th!) spike of red in the middle:
A naive conversion of this 256-element palette to a 16-element palette might accidentally completely eliminate the red spike, rendering the palette completely black.
However, the conversions provided here would attempt to include a the red stripe in the output, more-or-less as faithfully as possible. So in this case, the resulting CRGBPalette16 palette would have a red stripe in the middle which was 1/16th of a palette wide – the narrowest possible in a CRGBPalette16.
This means that the relative width of stripes in a CRGBPalette16 will be, by definition, different from the widths in the gradient palette. This code attempts to preserve "all the colors", rather than the exact stripe widths at the expense of dropping some colors.
Definition at line 1935 of file colorutils.h.
|
inline |
Check if two palettes have the same color entries.
Definition at line 1841 of file colorutils.h.
|
inline |
Array access operator to index into the gradient entries.
x | the index to retrieve |
Definition at line 1871 of file colorutils.h.
|
inline |
Array access operator to index into the gradient entries.
x | the index to retrieve |
Definition at line 1876 of file colorutils.h.
|
inline |
Array access operator to index into the gradient entries.
x | the index to retrieve |
Definition at line 1860 of file colorutils.h.
|
inline |
Array access operator to index into the gradient entries.
x | the index to retrieve |
Definition at line 1865 of file colorutils.h.
CRGB CRGBPalette256::entries[256] |
the color entries that make up the palette
Definition at line 1740 of file colorutils.h.