{"action":"created","issue":{"url":"https://api.github.com/repos/mRs-/HexColors/issues/14","labels_url":"https://api.github.com/repos/mRs-/HexColors/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/mRs-/HexColors/issues/14/comments","events_url":"https://api.github.com/repos/mRs-/HexColors/issues/14/events","html_url":"https://github.com/mRs-/HexColors/issues/14","id":46853714,"number":14,"title":"Should we add support for alpha in the hex string?","user":{"login":"alexandern","id":30424,"avatar_url":"https://avatars.githubusercontent.com/u/30424?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandern","html_url":"https://github.com/alexandern","followers_url":"https://api.github.com/users/alexandern/followers","following_url":"https://api.github.com/users/alexandern/following{/other_user}","gists_url":"https://api.github.com/users/alexandern/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandern/subscriptions","organizations_url":"https://api.github.com/users/alexandern/orgs","repos_url":"https://api.github.com/users/alexandern/repos","events_url":"https://api.github.com/users/alexandern/events{/privacy}","received_events_url":"https://api.github.com/users/alexandern/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-10-26T20:30:46Z","updated_at":"2015-03-31T12:52:30Z","closed_at":null,"body":"for example\r\n\r\n+ (HXColor *)colorWithAlphaHexString:(NSString *)hexString\r\n{\r\n  // Check for hash and add the missing hash. E.g. # 80 FF FF FF\r\n    if('#' != [hexString characterAtIndex:0])\r\n    {\r\n        hexString = [NSString stringWithFormat:@\"#%@\", hexString];\r\n    }\r\n    \r\n    // check for string length\r\n    assert(9 == hexString.length );\r\n\r\n    NSString *alpha    = [NSString stringWithFormat:@\"0x%@\", [hexString substringWithRange:NSMakeRange(1, 2)]];\r\n    float alphaFloat = [[self class] hexValueToFloat:alpha];\r\n    \r\n    NSString *redHex    = [NSString stringWithFormat:@\"0x%@\", [hexString substringWithRange:NSMakeRange(3, 2)]];\r\n    unsigned redInt = [[self class] hexValueToUnsigned:redHex];\r\n    \r\n    NSString *greenHex  = [NSString stringWithFormat:@\"0x%@\", [hexString substringWithRange:NSMakeRange(5, 2)]];\r\n    unsigned greenInt = [[self class] hexValueToUnsigned:greenHex];\r\n    \r\n    NSString *blueHex   = [NSString stringWithFormat:@\"0x%@\", [hexString substringWithRange:NSMakeRange(7, 2)]];\r\n    unsigned blueInt = [[self class] hexValueToUnsigned:blueHex];\r\n    \r\n    HXColor *color = [HXColor colorWith8BitRed:redInt green:greenInt blue:blueInt alpha:alphaFloat];\r\n    \r\n    return color;\r\n}\r\n\r\n\r\n+ (CGFloat)hexValueToFloat:(NSString *)hexValue\r\n{\r\n    float value = 0.0;\r\n    NSScanner *hexValueScanner = [NSScanner scannerWithString:hexValue];\r\n    [hexValueScanner scanFloat:&value];\r\n    \r\n    return value;\r\n}"},"comment":{"url":"https://api.github.com/repos/mRs-/HexColors/issues/comments/88072234","html_url":"https://github.com/mRs-/HexColors/issues/14#issuecomment-88072234","issue_url":"https://api.github.com/repos/mRs-/HexColors/issues/14","id":88072234,"user":{"login":"rsanchezsaez","id":444313,"avatar_url":"https://avatars.githubusercontent.com/u/444313?v=3","gravatar_id":"","url":"https://api.github.com/users/rsanchezsaez","html_url":"https://github.com/rsanchezsaez","followers_url":"https://api.github.com/users/rsanchezsaez/followers","following_url":"https://api.github.com/users/rsanchezsaez/following{/other_user}","gists_url":"https://api.github.com/users/rsanchezsaez/gists{/gist_id}","starred_url":"https://api.github.com/users/rsanchezsaez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsanchezsaez/subscriptions","organizations_url":"https://api.github.com/users/rsanchezsaez/orgs","repos_url":"https://api.github.com/users/rsanchezsaez/repos","events_url":"https://api.github.com/users/rsanchezsaez/events{/privacy}","received_events_url":"https://api.github.com/users/rsanchezsaez/received_events","type":"User","site_admin":false},"created_at":"2015-03-31T12:52:30Z","updated_at":"2015-03-31T12:52:30Z","body":"We're using #9 on our production code and it works great. ;-)"}}