Weird glitchy stuff

The LED on the Uno (digital 2 on the ATtiny45; digital 13 on the Uno) is interfering. Move the button to digital 3.

Do NOT try to access invalid pins. The Tiny Core (like the Arduino Core) DOES NOT VALIDATE PIN NUMBERS...

static const int nullLED = 16;
...
pinMode (nullLED, OUTPUT);  // <--- Bad news.  Don't do this.

The following code works. I used the internal pullup on the button pin; the button will have to be wired to ground the pin when pressed. The debounce technique works but is crude.

//Setup the Button

// This is a constant and should be marked as such...
static const int buttonInt = 3; // 2;

//Setup the LEDs

// These are all constants and should be marked as such...
static const int blueLED = 4;
static const int redLED = 0;
static const int greenLED = 1;
static const int nullLED = 16;

/* These are not used and not necessary.  Remove them.
int blueValue = 0;
int greenValue = 0;
int redValue = 0;
int nullValue = 0;
*/

/* "volatile" is not necessary.  Remove it. */
int selectedLED = greenLED;

void setup()
{
  pinMode (redLED, OUTPUT);
  pinMode (greenLED, OUTPUT);
  pinMode (blueLED, OUTPUT);
//pinMode (nullLED, OUTPUT);
  
  pinMode (buttonInt, INPUT);
  digitalWrite (buttonInt, HIGH);
}


void swap()
{
  if (selectedLED == greenLED)
    selectedLED = redLED;
  else if (selectedLED == redLED)
    selectedLED = blueLED;
  else if (selectedLED == blueLED)
    selectedLED = nullLED;
  else
    selectedLED = greenLED;   

  delay(300);   
}


void fade()
{
  if ( selectedLED == nullLED )
  {
    while ( digitalRead(buttonInt) );
  }
  else
  {
    while ( true ) {
      for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) { 
        analogWrite(selectedLED, fadeValue);    
        delay(30);
        if ( ! digitalRead(buttonInt) ) return;
      } 
  
      for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) { 
        analogWrite(selectedLED, fadeValue);  
        delay(30);
        if ( ! digitalRead(buttonInt) ) return;
      }
    }
  }
}

void loop()
{  
  fade();
  delay(30);
  while ( ! digitalRead(buttonInt) );
  swap();
}