Skip to content

Instantly share code, notes, and snippets.

@denispeyrusaubes
Last active January 17, 2016 07:25
Show Gist options
  • Save denispeyrusaubes/f4a2aa7eca6de8963119 to your computer and use it in GitHub Desktop.
Save denispeyrusaubes/f4a2aa7eca6de8963119 to your computer and use it in GitHub Desktop.
SquareGUI background color
UIColor* darkSquare = [[UIColor alloc] initWithRed:202.0/255.0 green:134.0/255.0 blue:68.0/255.0 alpha:1.0];
UIColor* lightSquare = [[UIColor alloc] initWithRed:255.0/255.0 green:206.0/255.0 blue:158.0/255.0 alpha:1.0];
int y =(int) (self.offset/8) +1;
if ( (self.offset + y ) % 2 == 0) {
self.backgroundColor = lightSquare;
} else {
self.backgroundColor = darkSquare;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment