Adjusting LED Cycle Colors

I have a code that simply cycles an RGB LED through all the colors, it works and looks great. I have another code that also cycles through the colors but is written differently to include the addition of a button function to pause the RGB color cycle. The second code doesn’t seem to cycle the colors as well as the first one and I don’t know how to adjust that, can anyone help me with this? I have included both codes and also a 30-second video to show the difference between the two. Thank you in advance!

First Code Mentioned:

const int redPin = 11;
const int greenPin = 10;
const int bluePin = 9;

void setup() {
  // Start off with the LED off.
  setColourRgb(0,0,0);
}

void loop() {
  unsigned int rgbColour[3];

  // Start off with red.
  rgbColour[0] = 255;
  rgbColour[1] = 0;
  rgbColour[2] = 0;  

  // Choose the colours to increment and decrement.
  for (int decColour = 0; decColour < 3; decColour += 1) {
    int incColour = decColour == 2 ? 0 : decColour + 1;

    // cross-fade the two colours.
    for(int i = 0; i < 255; i += 1) {
      rgbColour[decColour] -= 1;
      rgbColour[incColour] += 1;
      
      setColourRgb(rgbColour[0], rgbColour[1], rgbColour[2]);
      delay(5);
    }
  }
}

void setColourRgb(unsigned int red, unsigned int green, unsigned int blue) {
  analogWrite(redPin, red);
  analogWrite(greenPin, green);
  analogWrite(bluePin, blue);
 }

Second Code Mentioned:

int redPin = 11;
int greenPin = 10;
int bluePin = 9;
int buttonPin = 2;

int r = 0;
int g = 0;
int b = 0;
int temp = 1;

void setup() {
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
  pinMode(buttonPin, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(buttonPin), Pause, FALLING);

}

void loop() {

  if (temp == 1) {
    setColor(255, 0, 0);    // red
    setColor(0, 255, 0);    // green
    setColor(0, 0, 255);    // blue
    setColor(255, 255, 0);  // yellow
    setColor(80, 0, 80);    // purple
    setColor(0, 255, 255);  // aqua
  }
  else {
    // do nothing
  }

}

void setColor(int red, int green, int blue) {
  while ( r != red || g != green || b != blue ) {
    if ( r < red ) r += 1;
    if ( r > red ) r -= 1;

    if ( g < green ) g += 1;
    if ( g > green ) g -= 1;

    if ( b < blue ) b += 1;
    if ( b > blue ) b -= 1;

    _setColor();
    delay(5);
    if(temp == 0){
      return;
    }
  }
}

void _setColor() {
  analogWrite(redPin, r);
  analogWrite(greenPin, g);
  analogWrite(bluePin, b);
}

void Pause()
{
  if (temp == 1) {
    temp = 0;
  }
  else {
    temp = 1;
  }
  delay(200);
}

Demonstration Video: YouTube Video

I should probably add that the difference in light that I'm talking about is that in the first example of the video, the colors transition smoothly, but in the second example of the video, after every 2 colors it seems to change to white and then back to another color, I think this is because all 3 colors are lighting up at once instead of mixing just 2.

setColor(255, 255, 0);  // yellowwhen you use a color that has 2 of the shades fully bright (or even more than half bright) the consequence is that all 3 shades are present in your color with a brightness of at least 10% which you will see as 'kind of of white'
If you want to stick to this algorithm for fading colors you will have to use some intermediate color to prevent it from getting "White"

setColor(0, 0, 255);    // blue
    setColor(0, 80, 80); // dark blue/green
    setColor(255, 255, 0);  // yellow

Should reduce the effect.

Thank you, that makes a lot of sense. I'm going to adjust the values for the colors.

To get the second sketch to produce the same fade sequence as the first sketch:

    setColor(255, 0, 0);    // To: red
    setColor(0, 255, 0);    // Through yellow to: green
    setColor(0, 0, 255);    // Through cyan to: blue (then through purple to red)