Global variables col[] and colT[]

Hi @Aircoookie,

I just struggle about the correct “description” for the arrays col and colT .

wled00.ino defines them as:

byte col[] {255, 160, 0, 0};       //default RGB(W) color
byte colT[] {0, 0, 0, 0};          //current color

…but when looking at “the rest of the code”, col[] is used to change the primary color.

Could it be that the descriptions are swapped ?

col[]  = primary color
colT[] = default primary

Sorry, but I’m kind of confused :slightly_smiling_face:

Hi @Def3nder,

indeed the comments for theses arrays are misleading. This was probably an oversight on my side from more than 2 years ago when these arrays served different purposes. Or col is referred to as “default” because you can change the default boot color by changing the RGB values.

They actually work like this:

  • col is the current primary color. It is the one that should be updated if you want to change the color.
  • colT is the primary color that is currently displayed on the LEDs

Normally, these have the same value, with the exception of a running color transition, where col is the target color you want to arrive at and colT being the temporary color the LEDs are set to in that moment.

I will change the comment description of the arrays to clarify this :slight_smile:

thx a lot - that helped to “un-confuse” me again :smiley:

1 Like