Android and java mode colour difference

edited May 2016 in Android Mode

Dear processing community, when i run the following code in java mode i get accurate colors on the image but when i switch to android mode i get an unexpected result. Does anyone know why is it happening and how to overcome this ?

PImage img;
void setup()
{
  size (displayWidth,displayHeight);
  img = loadImage("foot2.png");
}
void draw()
{
  background(0);

image(img,50,70);

beginShape();// 
fill(255,0,0);
 curveVertex(170,76);
 curveVertex(169,138);
 curveVertex(168,148);
 curveVertex(169,148);
 curveVertex(213,157);
 curveVertex(211,107);
 curveVertex(193,79);
 curveVertex(170,76);
 curveVertex(159,108);
 curveVertex(168,148);
endShape();
fill(0,2,5);
  ellipse(185,108 ,40,50); 
beginShape(); // 
fill(190,29,83);
curveVertex(183,212);
 curveVertex(216,213);
curveVertex(216,204);
 curveVertex(212,184);
 curveVertex(182,186);
curveVertex(183,212);
 curveVertex(216,213);
curveVertex(216,204);
endShape();

beginShape(); // 
fill(255,244,13);
 curveVertex(184,212);
 curveVertex(153,213);
 curveVertex(157,188);
 curveVertex(181,188);
  curveVertex(184,212);
 curveVertex(153,213);
 curveVertex(157,188);
endShape();

beginShape(); // 
fill(255,0,0);
curveVertex(152,213);
curveVertex(136,211);
 curveVertex(114,218);
 curveVertex(115,199);
curveVertex(154,189);
curveVertex(152,213);
curveVertex(138,214);
curveVertex(124,215);
 curveVertex(114,218);
endShape();

beginShape(); // 

fill(255);
 curveVertex(115,218);
 curveVertex(91,219);
 curveVertex(77,218);
 curveVertex(91,198);
 curveVertex(110,203);
 curveVertex(115,218);
 curveVertex(91,219);
  curveVertex(77,218);
endShape();

beginShape(); //
fill(0,0,255);
 curveVertex(77,217);
 curveVertex(90,238);
 curveVertex(84,256);
 curveVertex(66,256);
 curveVertex(62,221);
 curveVertex(72,215);
 curveVertex(77,217);
 curveVertex(90,238);
 curveVertex(84,256);
endShape();
}

Untitled54

Tagged:

Answers

  • edited October 2014

    Shoot in the dark: try to put the fill() calls before the beginShape() ones.

  • i tried that too still no success. Its the last fill(0,0,255) whose color is being filled up in all the shapes.

  • try endShape(CLOSE); everywhere

    i get the feeling it's treating all those as one shape.

  • yes exactly its treating them all as one shape and endShape(CLOSE) also couldn't solve the problem :-S

  • i wonder why its behaving like this in the android mode when i am getting perfect results in java -.-

  • I do not know why but it works with P3D size (displayWidth,displayHeight,P3D);

  • Well i did it with vertex(x,y) instead of curveVertex. Zoomed in by scaling up and selecting coordinates at much closer distance to get somewhat curved shapes and then colored them with the one and only fill command then the output was same in the android mode finally.

Sign In or Register to comment.