int cellSize = 20; int cols = videoWidth / cellSize; int rows = videoHeight / cellSize; int cellN = (cols)*(rows); byte[] colorValues = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void ephPercentage() { if (video.available()) { video.read(); video.loadPixels(); for(int i = 0; i 20 && briVal < 80) { colorValues[int(hueVal/8.3)]++; } else if(briVal <= 20) { colorValues[12]++; } else if(briVal >= 20) { colorValues[13]++; } pushMatrix(); translate(x+cellSize/2, y+cellSize/2); rectMode(CENTER); fill(c); noStroke(); rect(0, 0, cellSize+6, cellSize+6); popMatrix(); } } // Print colors percentage values for(int i = 0; i