Thats because UIBarButtonItem image’s default rendering mode always draw the image as a template image, ignoring its color information (UIImageRenderingModeAlwaysTemplate). Just create your image using UIImage’s method imageWithRenderingMode always original.
UIImage(named: "yourImageName")!.withRenderingMode(.alwaysOriginal)