Palette colors

Hi
Where ( other than palettes.h ) and how are the colors of a palette defined ?

How would I get the candle effect working with palettes ?
Best with color 1&2 or color gradient.

Thanks

With upcoming 0.14 you can upload custom palettes.
They follow FastLED CRGB16Palette standard.

I do not understand the question about Candle effect.

Hi blazoncek

Thanks for the quick response !

const byte toxy_reaf_gp PROGMEM = {
0, 1,221, 53,
255, 73, 3,178};

There are four values per line . Is that R, G, B, W ?

Yes I saw your implementation of json files for palettes. was about to try it, but got stuck with the above mentioned question.

For the candle : the effect is very realistic. I would like to use it to illuminate the body of a candle.
There the brightness decreases the further it is away from the flame. ie top = bright, bottom = almost dark.
When the candle effect would work with palettes, that would be very simple. But it doesn’t. I only can set 1 color for all leds. btw there 6 rows ( as segments ) around with 8 leds each.

Would it not work to have them in different segments like say 3 segments with the bottom 1/3, middle 1/3 and top 1/3. Set each on the candle effect and just set the desired brightness of each segment. Turn them all on and save a preset?

The CRGB16Palette array consists of the following: offset, R, G, B.
Offset starts at 0 and ends at 255.

The palette option for candle has been removed intentionally in 0.14.

The smaller segments are a solution, but close to program each led separately, which i wanted to avoid.
But sure quicker than coding a new effect.

I did assume one line represents one color, so what is the fourth value in the line ?
Or am I completely mistaken ?

Why were the palettes removed from candle ?

quick and simple " solution " : rows wired parallel , 8 segments in height.

What exactly is this offset ?

What happens with white ? Is it calculated from RGB ? or are there palettes with explicit white ?

Straight from FastLED/colorutils.h

 // Gradient palettes are loaded into CRGB16Palettes in such a way
 // that, if possible, every color represented in the gradient palette
 // is also represented in the CRGBPalette16.
 // 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:
 //     0,   0,0,0
 //   124,   0,0,0
 //   125, 255,0,0  // one 1/256th-palette-wide red stripe
 //   126,   0,0,0
 //   255,   0,0,0
 // 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.
1 Like

Wow, yeah, will try to understand this.

Thaaanks

It has returned in latest commit.

Was the plan for uploading custom palettes postponed or abandoned?

On my search of how to do custom palettes i walked in here, maybe there is another post that helps me?

No. It is waiting in PR to be merged upstream.
Needs a bit of testing. And anyone can help with that.

1 Like

I finally found the info i needed and tested some things. I am irritated, i built a simple palette, but the “hard steps” (63>64, should be from full on red to black) are not working, they all blend softly, even the beginning and the end are blending softly on every palette…

{"palette":[ 
    0,   0,   0,   0,
   63, 255,   0,   0,
   64,   0,   0,   0,
  127,   0, 255,   0,
  128,   0,   0,   0,
  191,   0,   0, 255,
  192,   0,   0,   0,
  255,   0,   0,   0]}

As english is not my mother language, i might dont understand some of this things…

There is a setting in Config->Led Preferences->Transitions->Enable Palette Transitions.
Turning this off may give you the abrupt colour change you’re looking for.

It may also affect every other palette change…

1 Like

@divsys is close but not correct.

Use Config → LED Settings → Advanced → Palette blending = None.

1 Like

Ah ok, i didnt thought at all what this was for.

But… the palette file does something different again. There are hard steps, but there are also spaces with no light at all between really big parts with color. I have to experiment some…

And the question, why is this setting not recommended?

I also made this palette file, but it does not lite up anything, all black…

{"palette":[ 
    0, 255,   0,   0,
    7,   0, 255,   0, 
   15,   0,   0, 255,
   23, 255, 255,   0,
   31, 255,   0, 255,
   39,   0, 255, 255,
   47, 255,   0,   0,
   55,   0, 255,   0,
   63,   0,   0, 255,
   71, 255, 255,   0,
   79, 255,   0, 255,
   87,   0, 255, 255,
   95, 255,   0,   0,
  103,   0, 255,   0,
  111,   0,   0, 255,
  119, 255, 255,   0,
  127, 255,   0, 255,
  135,   0, 255, 255,
  143, 255,   0,   0,
  151,   0, 255,   0,
  159,   0,   0, 255,
  167, 255, 255,   0,
  175, 255,   0, 255,
  183,   0, 255, 255,
  191, 255,   0,   0,
  199,   0, 255,   0,
  207,   0,   0, 255,
  215, 255, 255,   0,
  223, 255,   0, 255,
  231,   0, 255, 255,
  239, 255,   0,   0,
  247,   0, 255,   0,
  255,   0,   0, 255]}

Read up on CRGBPalett16 in FastLED library.
There are limitations.

You are better off using Custom Palette Editor.