klazuka/Kal — pull request #72 by groue (2012-11-23 08:27:44+00:00)
Title: Appearance customization

Hi. Thanks for your Kal library.

I had to customize the grid appearence.

This has involved changing images in Kal.bundle (uncovered by these commits), introducing a `backgroundView` property of KalGridView, and having KalTileView conform to the UIAppearanceContainer protocol.

My goal was to be able to write code like:

```objc
@implementation MyViewController

+ (void)initialize
{
id kalTileViewAppearance = [KalTileView appearanceWhenContainedIn:self, nil];

UIColor *todayTextColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Kal.bundle/kal_tile_text_fill.png"]];
[kalTileViewAppearance setTextColor:[UIColor colorWithWhite:0.7 alpha:1] forState:KalTileStateAdjacent];
[kalTileViewAppearance setTextColor:[UIColor whiteColor] forState:KalTileStateAdjacent | KalTileStateSelected];
[kalTileViewAppearance setTextColor:todayTextColor forState:KalTileStateToday];
[kalTileViewAppearance setTextColor:[UIColor whiteColor] forState:KalTileStateToday | KalTileStateSelected];

[kalTileViewAppearance setShadowColor:[UIColor whiteColor] forState:KalTileStateToday];
[kalTileViewAppearance setShadowColor:[UIColor colorWithWhite:0 alpha:0.2] forState:KalTileStateSelected];
[kalTileViewAppearance setShadowColor:[UIColor colorWithWhite:0 alpha:0.2] forState:KalTileStateToday | KalTileStateSelected];

[kalTileViewAppearance setReversesShadow:YES forState:KalTileStateSelected];
}

@end
```

Let me know if you're interested.