Home >Web Front-end >HTML Tutorial >object-c converts RGB colors into hexadecimal HTML colors_html/css_WEB-ITnose

object-c converts RGB colors into hexadecimal HTML colors_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:48:351404browse

-(void)color:(NSString *) red andGreen:(NSString*) green andBule:(NSString*) bule{    NSInteger Red = [red integerValue];    NSInteger Green = [green integerValue];    NSInteger Bule = [bule integerValue];    NSInteger colorsize = Red<<16 | Green << 8 | Bule;    NSString * Color = [NSString stringWithFormat:@"#%06lx",colorsize];    NSLog(@"%li",(long)colorsize);    NSLog(@"Color = %@",Color);}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn