The function "red(int)" does not exist?

There are other problems in the list (in the image) you provided and you did not share the related code.
Once you correct the existing problems you will see other problems and that is where my post will help.

Guidelines—Asking Questions < Can you post an MCVE?

The code below works with Processing 4.3 on W10 and does not report any problems.

Try this (your code with additions by me) and report the result on your end:

import java.util.*;
// If using int:
List<int[]> cl = new ArrayList<int[]>();

// If using Integer:
//List<Integer[]> cl = new ArrayList<Integer[]>(); // If using Integer

//PImage sf;

void setup()
  {
  size(200, 200);  
  PImage sf = loadImage("http://learningprocessing.com/code/assets/sunflower.jpg");
  averageColor(sf);
  noLoop();
  }

public void averageColor(PImage img) 
  {
  for (int i = 0; i < 3; i++) 
    {
    // If using int:
    int [] Color = new int[3];
    
    // If using Integer:
    //Integer[] Color = new Integer[3];    
    //for(int j=0; j<3; j++)
    //  {
    //  Color[j] = 0;
    //  }
 
    int times = 0;    
    
    for (int r = 0; r < img.width; r += 16) 
      {
      for (int c = 0; c < img.height; c += 16) 
        {
        color currentColor = img.get(r, c);
        Color[0] += (int) red(currentColor);
        Color[1] += (int) green(currentColor);
        Color[2] += (int) blue(currentColor);
        times++;
        }
      }
    Color[0] = Color[0]/times;
    Color[1] = Color[1]/times;
    Color[2] = Color[2]/times;
    cl.add(Color);
    printArray(cl.get(i));
    //println(hex(cl.get(i)[0]), hex(cl.get(i)[1]), hex(cl.get(i)[2]));
    }
  }

What version of Processing are you using?
What operating system?

:)