Do you need these? Why not just leave colorArray uninitialized (which means it's all zeros) and check for 0? No need for known colors, no need for anything other than wtu.checkCanvas(gl, [0,0,0,0]); I guess I'm not sure how adding specific colors makes it more likely to pass or fail.