title: CGContextSetRGBFillColor not working
body: <p>I am creating sprites from the CGImage I have drawn using the CGContext functions. I have also a color changing mechanism implemented as a menu. But even though I clear the context and change the color the color which is used for drawing remains the same. Do anybody have anyidea what is wrong?</p>
  
  <pre><code>CGContextSaveGState(UIGraphicsGetCurrentContext());
      UIGraphicsBeginImageContext(CGSizeMake(40, 40));
      if ([color isEqualToString:@"black"]) {
          CGContextSetRGBFillColor(UIGraphicsGetCurrentContext(), 0,0,0, 1);
      }
      else if ([color isEqualToString:@"red"]) {
          CGContextSetRGBFillColor(UIGraphicsGetCurrentContext(), 1.0,0,0, 1);
      }
      else if ([color isEqualToString:@"green"]) {
          CGContextSetRGBFillColor(UIGraphicsGetCurrentContext(), 0,1.0,0, 1);
      }
      else if ([color isEqualToString:@"blue"]) {
          CGContextSetRGBFillColor(UIGraphicsGetCurrentContext(), 0,0,1.0, 1);
      }
      CGRect rect1 = CGRectMake(0,0,40,40);
      CGContextAddEllipseInRect(UIGraphicsGetCurrentContext(),rect1);
      CGContextFillPath(UIGraphicsGetCurrentContext());
      UIImage *myImage = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
      CGContextFlush(UIGraphicsGetCurrentContext()) ;
      CGContextRestoreGState(UIGraphicsGetCurrentContext());
  
      CCSprite *newSprite = [CCSprite spriteWithCGImage:[myImage CGImage] key:@"blackCircle"];
      [itemsArray addObject:newSprite];
      [newSprite setPosition:point];
      [self addChild:newSprite];
  </code></pre>