title: Objective c - Animate background colour of SKScene
body: <p>How would you go about animating the background colour of an SKScene? I've tried a UIView animate, but not surprisingly it didn't work. Is there an equivalent to do this in Sprite-Kit?</p>
  
  <p>I'm looking for something like this, but for Sprite-Kit:</p>
  
  <pre><code>[UIView animateWithDuration:0.25 animations:^{
     self.backgroundColor = [UIColor redColor];
  }];
  </code></pre>
  
  <p>At the moment, as a work around I have overlayed a UIView over the SKView, but I would like something more flexible.</p>
  
  <p>I am relatively new to Sprite-Kit, so appologies if this is extremely simple to do!</p>
  
  <p>At the moment I have:</p>
  
  <pre><code>-(id) initWithSize:(CGSize)size {
      if (self = [super initWithSize:size]) {
          _bg = [SKSpriteNode spriteNodeWithColor:[SKColor colorWithRed:0.13 green:0.13 blue:0.13 alpha:1] size:self.size];
          _bg.position = CGPointMake(self.size.width/2, self.size.height/2);
          [self addChild:_bg];
      }
      return self;
  }
  
  -(void) colorise :(UIColor*)color {
      [_bg runAction:[SKAction colorizeWithColor:color colorBlendFactor:_bg.colorBlendFactor duration:1]];
  }
  </code></pre>
  
  <p>Also after initialising the SKView, I'm setting the color of the bg sprite depending on an NSUserDefault Value.</p>
  
  <pre><code> if ([[NSUserDefaults standardUserDefaults] integerForKey:@"currGameMode"] == 0) {
  ((bubbleAnimation2*)_bubbleEffectView.scene).bg.color = [UIColor colorWithRed:0.13 green:0.13 blue:0.13 alpha:1];}
  else {((bubbleAnimation2*)_bubbleEffectView.scene).bg.color = [UIColor colorWithRed:0.25 green:0.13 blue:0.13 alpha:1];}
  </code></pre>
  
  <p>Thanks!</p>