Solved: getBrightness isn't working

Hi.
I’m trying to convert some processing code, but whenever I try to use getBrightness I get an error saying the identifier is undefined.
Am I looking at outdated documentation?
What can I do to get the brightness from a color?

Thanks in advance.

Here’s the code part I want to convert:

color t = img.get(x,y);
      float b = brightness(t);
      float s = map(b,0,255,15,2);

I think you would do it like this as getBrightness is a function of ofColor.

ofColor color = img.getColor(x, y); 
float brightness = color.getBrightness(); 

Thanks a lot!!
It worked.

Forgot to add color. befor getBrightness();