But it’s not showing the intended color, instead it always shows white in the background. The problem is that the arguments for colorWithRed:green:blue:alpha need to be CGFloats on a scale from 0 to 1, where 0 is 0 and 1 is 255. Therefore, your code should look more like this: