The UI gives the development a lot of time to mark the hexadecimal color, and the application is often uicolor can be converted in the following ways:
(Uicolor *) Rgbcolorfromhexstring: (NSString *) color alpha: (float) Alpha {//color value similar to #fffeee,alpha value similar to 1.0 for transparency int nums[6] = {0};for (int i = 1; i < [color length]; i++) {int temp = [Color characteratindex:i];if (temp >= ' 0 ' && temp <= ' 9 ') {nums[i-1] = [Color Characteratindex: I]-' 0 ';} else if (temp >= ' a ' && temp <= ' F ') {nums[i-1] = [color characteratindex:i]-' A ' + 10;} else if (temp >= ' a ' && temp <= ' f ') {nums[i-1] = [color characteratindex:i]-' a ' + 10;} else {return [Uicolor Whitecolor];} } float RValue = (nums[0] * + nums[1])/255.0f;float Gvalue = (nums[2] *16 + nums[3])/255.0f;float BValue = (nums[4] * + nums[5])/255.0f; Uicolor *rgbcolor = [Uicolor colorwithred:rvalue green:gvalue blue:bvalue alpha:alpha];return RgbColor;}