HELP! my code wont work and it keeps saying "fill isn't defined" when it is

let light1

let light2

let light3

function setup() { 
  createCanvas(400, 400);
  angleMode(DEGREES);
  colorMode()

  light1=color(1)

  light2=color(1)

  light3=color(1)

}

function draw() {
  background(220);
stroke(0)

}

fill(255,255,255) //black
rect(25, 50, 370, 50)
 

  fill(196, 30, 58) //red
 fill(light1)
 circle(100,75,50)


 fill(253, 253, 150) //yellow
fill(light2)
  circle(220,75,50)
 

fill(144, 238, 144) //green
fill(light3)
 circle(340,75,50)
 
 fill(1)
 rect(31,101,31,381)


    if (mouseY > 150) {
    
    light1 = color(255,0,0)
    light2= color(1)
    
  }
    else if (mouseY>150 && mouseY<250){
      
      light2= color(253,252,150)
      light1= color(1)
  }
          
   else {
     light1= color(1)
     light2= color(1)
     light3= color(144, 238, 144)
  
   
  fill(0)
  text(mouseX + ", " + mouseY,20,20)
}

Hey @alanv341 welcome to the forums!

Can you provide the full error that your are getting?

1 Like

ReferenceError: fill is not defined https://cb73ba93-d5d4-4c61-bbd6-bfb7795113e0-00-2dbfkh4qclmic.kirk.replit.dev/script.js:26

and its always at the same script line and someone else just gave me a new code that should’ve worked but the same message keeps popping up

Please link your replit.