and for the walls we can use the color fading extension, we can make a function to fade one color at a time
here is a example
function fadeColor (startR: number, startG: number, startB: number, endR: number, endG: number, endB: number, duration: number, Color: number) {
FadeQuality = 25 // the fps
steps = duration / FadeQuality
deltaR = (endR - startR) / steps
deltaG = (endG - startG) / steps
deltaB = (endB - startB) / steps
// from the timer extension
timer.background(function () {
for (let i = 0; i <= steps - 1; i++) {
newR = startR + deltaR * i
newG = startG + deltaG * i
newB = startB + deltaB * i
color.setColor(Color, color.rgb(newR, newG, newB)) // from the color fading extension
pause(FadeQuality)
}
})
}

we need the timer extension not to freeze the game for duration of time.
now, for the rainbow effect, remove the timer.background(function () {}) or “separately do” from the fadeColor function
then make a new function (the function below)
function rainbowEffect (cycle: number, OnColor: number, Speed: number, StartR: number, StartG: number, StartB: number) {
timer.background(function () {
for (let index = 0; index < cycle; index++) {
fadeColor(StartR, StartG, StartB, 255, 0, 0, Speed / 6, OnColor) // color to red
fadeColor(255, 0, 0, 255, 255, 0, Speed / 6, OnColor) // red to yellow
fadeColor(255, 255, 0, 0, 255, 0, Speed / 6, OnColor) // yellow to green
fadeColor(0, 255, 0, 0, 255, 255, Speed / 6, OnColor) // green to lightBlue
fadeColor(0, 255, 255, 0, 0, 255, Speed / 6, OnColor) // lightBlue to blue
fadeColor(0, 0, 255, StartR, StartG, StartB, Speed / 6, OnColor) // blue to color
}
})
}

Speed is the time for one cycle
Ps. you can change the colors and the number of colors if you want just remember to change the 6. if you need an explanation on how it works just tag me