# Palette colors

**URL:** <https://wled.discourse.group/t/palette-colors/6279>\
**Category:** Questions\
**Created:** [November 6, 2022, 8:33pm UTC](https://wled.discourse.group/t/palette-colors/6279 "2022-11-06T20:33:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![harueg](https://avatars.discourse-cdn.com/v4/letter/h/13edae/32.png) [@harueg](https://wled.discourse.group/u/harueg)\
**Post date:** [November 6, 2022, 8:33pm UTC](https://wled.discourse.group/t/palette-colors/6279/1 "2022-11-06T20:33:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![blazoncek](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/blazoncek/32/1886_2.png) [@blazoncek](https://wled.discourse.group/u/blazoncek)\
**Post date:** [November 6, 2022, 9:34pm UTC](https://wled.discourse.group/t/palette-colors/6279/2 "2022-11-06T21:34:05Z")

</div>

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

I do not understand the question about Candle effect.

---

<div class="post-metadata">

**Author:** ![harueg](https://avatars.discourse-cdn.com/v4/letter/h/13edae/32.png) [@harueg](https://wled.discourse.group/u/harueg)\
**Post date:** [November 6, 2022, 10:31pm UTC](https://wled.discourse.group/t/palette-colors/6279/3 "2022-11-06T22:31:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jinx](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@Jinx](https://wled.discourse.group/u/Jinx)\
**Post date:** [November 7, 2022, 12:58am UTC](https://wled.discourse.group/t/palette-colors/6279/4 "2022-11-07T00:58:23Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![blazoncek](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/blazoncek/32/1886_2.png) [@blazoncek](https://wled.discourse.group/u/blazoncek)\
**Post date:** [November 7, 2022, 6:24am UTC](https://wled.discourse.group/t/palette-colors/6279/5 "2022-11-07T06:24:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![harueg](https://avatars.discourse-cdn.com/v4/letter/h/13edae/32.png) [@harueg](https://wled.discourse.group/u/harueg)\
**Post date:** [November 7, 2022, 9:04am UTC](https://wled.discourse.group/t/palette-colors/6279/6 "2022-11-07T09:04:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![harueg](https://avatars.discourse-cdn.com/v4/letter/h/13edae/32.png) [@harueg](https://wled.discourse.group/u/harueg)\
**Post date:** [November 7, 2022, 9:05am UTC](https://wled.discourse.group/t/palette-colors/6279/7 "2022-11-07T09:05:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![harueg](https://avatars.discourse-cdn.com/v4/letter/h/13edae/32.png) [@harueg](https://wled.discourse.group/u/harueg)\
**Post date:** [November 7, 2022, 9:18am UTC](https://wled.discourse.group/t/palette-colors/6279/8 "2022-11-07T09:18:21Z")

</div>

Why were the palettes removed from candle ?

---

<div class="post-metadata">

**Author:** ![harueg](https://avatars.discourse-cdn.com/v4/letter/h/13edae/32.png) [@harueg](https://wled.discourse.group/u/harueg)\
**Post date:** [November 7, 2022, 11:26am UTC](https://wled.discourse.group/t/palette-colors/6279/9 "2022-11-07T11:26:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![harueg](https://avatars.discourse-cdn.com/v4/letter/h/13edae/32.png) [@harueg](https://wled.discourse.group/u/harueg)\
**Post date:** [November 7, 2022, 12:38pm UTC](https://wled.discourse.group/t/palette-colors/6279/10 "2022-11-07T12:38:55Z")

</div>

> [@blazoncek](#):
>
> he CRGB16Palette array consists of the following: offset, R, G, B.  
> Offset starts at 0 and ends at 255.

What exactly is this offset ?

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

---

<div class="post-metadata">

**Author:** ![blazoncek](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/blazoncek/32/1886_2.png) [@blazoncek](https://wled.discourse.group/u/blazoncek)\
**Post date:** [November 7, 2022, 1:44pm UTC](https://wled.discourse.group/t/palette-colors/6279/11 "2022-11-07T13:44:51Z")

</div>

Straight from FastLED/colorutils.h

```auto
 // 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.

```

---

<div class="post-metadata">

**Author:** ![harueg](https://avatars.discourse-cdn.com/v4/letter/h/13edae/32.png) [@harueg](https://wled.discourse.group/u/harueg)\
**Post date:** [November 7, 2022, 3:56pm UTC](https://wled.discourse.group/t/palette-colors/6279/12 "2022-11-07T15:56:14Z")

</div>

Wow, yeah, will try to understand this.

Thaaanks

---

<div class="post-metadata">

**Author:** ![blazoncek](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/blazoncek/32/1886_2.png) [@blazoncek](https://wled.discourse.group/u/blazoncek)\
**Post date:** [November 10, 2022, 6:22am UTC](https://wled.discourse.group/t/palette-colors/6279/13 "2022-11-10T06:22:04Z")

</div>

It has returned in latest commit.

---

<div class="post-metadata">

**Author:** ![photonz](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/photonz/32/4964_2.png) [@photonz](https://wled.discourse.group/u/photonz)\
**Post date:** [April 28, 2023, 7:54pm UTC](https://wled.discourse.group/t/palette-colors/6279/14 "2023-04-28T19:54:16Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![blazoncek](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/blazoncek/32/1886_2.png) [@blazoncek](https://wled.discourse.group/u/blazoncek)\
**Post date:** [April 29, 2023, 6:19am UTC](https://wled.discourse.group/t/palette-colors/6279/15 "2023-04-29T06:19:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![photonz](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/photonz/32/4964_2.png) [@photonz](https://wled.discourse.group/u/photonz)\
**Post date:** [May 3, 2023, 4:47pm UTC](https://wled.discourse.group/t/palette-colors/6279/16 "2023-05-03T16:47:48Z")

</div>

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…

```auto
{"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…

---

<div class="post-metadata">

**Author:** ![divsys](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@divsys](https://wled.discourse.group/u/divsys)\
**Post date:** [May 3, 2023, 5:20pm UTC](https://wled.discourse.group/t/palette-colors/6279/17 "2023-05-03T17:20:34Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![blazoncek](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/blazoncek/32/1886_2.png) [@blazoncek](https://wled.discourse.group/u/blazoncek)\
**Post date:** [May 3, 2023, 7:14pm UTC](https://wled.discourse.group/t/palette-colors/6279/18 "2023-05-03T19:14:17Z")

</div>

@divsys is close but not correct.

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

---

<div class="post-metadata">

**Author:** ![photonz](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/photonz/32/4964_2.png) [@photonz](https://wled.discourse.group/u/photonz)\
**Post date:** [May 3, 2023, 7:51pm UTC](https://wled.discourse.group/t/palette-colors/6279/19 "2023-05-03T19:51:20Z")

</div>

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…

```auto
{"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]}

```

---

<div class="post-metadata">

**Author:** ![blazoncek](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/blazoncek/32/1886_2.png) [@blazoncek](https://wled.discourse.group/u/blazoncek)\
**Post date:** [May 3, 2023, 8:45pm UTC](https://wled.discourse.group/t/palette-colors/6279/20 "2023-05-03T20:45:56Z")

</div>

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

You are better off using Custom Palette Editor.
