Skip to content

Instantly share code, notes, and snippets.

@noppefoxwolf
Created February 1, 2014 19:36
Show Gist options
  • Save noppefoxwolf/8757485 to your computer and use it in GitHub Desktop.
Save noppefoxwolf/8757485 to your computer and use it in GitHub Desktop.
2色の相対から自動的にステータスバーの色を選出 ref: http://qiita.com/noppefoxwolf/items/56c9108c2554c594b151
-(UIStatusBarStyle)statusbarstyleWithBaseColor:(UIColor*)baseColor ButtonColor:(UIColor*)buttonColor{
CGFloat b1,b2;
[baseColor getHue:nil saturation:nil brightness:&b1 alpha:nil];
[buttonColor getHue:nil saturation:nil brightness:&b2 alpha:nil];
return b1>b2?UIStatusBarStyleLightContent:UIStatusBarStyleDefault;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment