NSColor | Creating Color from RGB Values
问题 In my application, i will get RGB Values as a unsigned character so it will not be more then 255, I am using NSColor API to create the color and will make use of it to draw the font and background color, this is the function that i have written +(NSColor *)getColorFromRGB:(unsigned char)r blue:(unsigned char)b green:(unsigned char)g { CGFloat rFloat = r/255.0; CGFloat gFloat = g/255.0; CGFloat bFloat = b/255.0; // return [NSColor colorWithCalibratedRed:((float)r/255.0) green:((float)g/255.0)