Xcode 6, main storyboard, colors off - ios

The colors on the main storyboard doesn't correspond to what the simulator is rendering. How come?

Just in case, check that you didn't change neither the alpha of any view nor superview, or the colors in code.

Here you can find a interesting explanation, but here are the basics:
You need to use the Digital Color Meter, with the option "Display in sRGB".
Pick the desired color from your design.
Apply the RGB values given by Digital Color Meter in the Interface Builder by previously choosing Generic RGB profile on the gear icon.

Related

Different colors even though RGB values are equal

I'm facing a quite weird color issue with the Interface Builder in Xcode.
I've set the background of my view in my view controller to #1F242C:
So far so good.
Then I create a UITableViewCell in a nib file where I set the background to the exact same color #1F242C:
Now when I start the app, the background of the UITableViewCell is suddenly different from the viewcontroller view's background, even though the RGB values match and the opacity too.
When I analyze a screenshot with Photoshop
The view's background is: #29303A
and the cell's background is: #1F242C
Whey are they different colors despite the RGB values being the same? I don't change the colors programmatically in my source code.
Here's how the different colors look:
This is an issue due to iOS 10 and the new extended color gamut of the new devices screens.
Click on the wheel at the right of "RGB slider" in your color picker, and chose sRGB IEC61966 2-1.
You will see that the RGB values will change at this point. Put them back to the RGB values you previously entered. That should be it!

Color gamut in Xcode 8

Today I have installed Xcode 8(beta) and exploring Storyboards. Here we can now set background and tintColor for different traits. That's good news.
But here with trait collection(for example any height X any width) there is another selection of gamuts
Here is the screenshot
As I have searched for gamut, I found that it is related with color.
I have tried with different combination of gamuts but I am unable to see any difference.
The documentation is also not helpful.
The question is how the developers get the benefit of this feature?
Developers can get benefit from it because it gives a much greater control over your app's color profile. You can explicitly assign a color to display depending on the device's gamut.
A solid understanding of gamut is key here. Devices will distort "untagged" colors, that is, colors outside of their gamut. The P3 gamut has a more extensive range of display colors than the sRGB gamut. This graph should give you a good idea of exactly how much more extensive it is:
So if you create your designs on a monitor with a P3 gamut, say a Cinema Display, your colors may display differently on a device with sRGB gamut. However, it's entirely possible there is no change in the color if you pick a color that is within both gamut.

iOS/iPhone app seems to add a color mask/color shade to my text

I have some colored images and same colored text on an iPhone App screen. The images show as expected, but when I use the same RGB color code on the text, it appears different on the finished app (mostly, a little darker). Why is xcode changing the color I tell it to use? How to get the text color to exactly match the color codes in the images.
Update: Here's a screenshot. I use the color picker from inside XCode, to pick the color from the image, so it shouldn't matter which color space I'm using (I'm using the same for both text and image), it still looks different.
It's very popular problem about different colors...
1) Try to use Digital color (native mac application)
2) Try to off text shadow, if you use it from your label.
3) And, all of its, is not a wright way to resolve this problem, if you want to color like on image you should correct them manually in you code or in interface builder.

Is that possible to change the color of icons used in app according to selected theme in app in objective c.(programmatically)

I need to change the color of sliced icons used in app in different color. I dont want to take more and more images i.e. of different color. I want to change the color of image only, not other properties of image e.g. shape, size, layer, opacity etc. Is that possible?
If you construct your icons correctly, you can use the Hue Adjust CIFilter. You'd just need to change the inputAngle to get the color you want. For example, if your icon is mostly blue, you can make a mostly yellow one by changing inputAngle to 180° (or π radians - not sure of the units).

Wrong color in Interface Builder

The problem: I set a color in Interface Builder, setting the channels RGB, then I do a screenshot of the working window, open it in Photoshop and check color by color picker, which I have set in Interface Builder. The result - the RGB values ​​are different from the ones I set.
Video:
http://www.youtube.com/watch?v=ASLfnYHPbqM
Most abnormal begins with the 45th second, when I tried to use the color picker of the Interface Builder. It shows the RGB values ​​are different from those that I have in him the same and installed), but the values ​​of сolor picker IB coincide with the values ​​of color picker Photoshop.
Apple thinks it is much more important that colors look the same everywhere than that colors have the same RGB values everywhere. See, the same RGB values will not look the same on different screens, because every screen has different display characteristics.
So when you take a screenshot, Apple does not just store a RGB value for every pixel in the image, they also store the display characteristics of your monitor inside the image file. What is that good for? If someone else opens your screenshot, the system can look at the monitor characteristics of the person who created it, compare those to the monitor characteristics of the monitor of the person that wants to watch it, and can then calculate how it must adopt the RGB values in the image so that the image looks the same on the current monitor. If it was just displaying the RGB values without doing any of this, the image colors may look wrong (in some cases only slightly, in some cases some more, and if the user has a very bad monitor, in some cases even radically wrong).
So the system send different RGB values to the graphics adapter, because RGB colors by themselves do not really describe a color. RGB values together with a monitor profile do describe a color and not the RGB values are important, the color is important. If I make something red, I want it to be the same shade of red on every monitor. I don't want it to be a darker red on one monitor, a lighter red on another monitor, and a red that is almost pink on a third monitor.
The problem with Photoshop is that it has its own build-in color correction mechanism. Photoshop usually works in sRGB (standard RGB color space) or Adobe RGB (an extended color space Adobe invented). When you load an image that is not within the desired color space, Photoshop will transform the color space of the image and every color space transform causes the RGB values to change. Please note that the images displayed within Photoshop are still color corrected according to your current monitor color characteristics, it's just the RGB values you manipulate within Photoshop that are in another color space and when stored back to file, Photoshop will either transform the values back or it will keep them and embed a new color profile into the image file.
The times where RGB alone has been used to describe colors are over for many years already. Today RGB is rather meaningless on its own, only when combined with a color profile it becomes really meaningful in describing an actual color.
If you want a screenshot without a real color profile embedded, do the following:
Open "System Preferences"
Go to "Displays"
Go to "Color"
Select "Generic RGB Profile"
Make your screenshot
Change your profile back
It may be necessary to quit Xcode first before you change the profile (and restart it after you changed it back), since I'm not sure if changing the profile has immediate effect. It certainly has immediate effect how things are displayed on your monitor, but if you want to choose a color in Xcode by selecting specific RGB values, I'm not sure if a profile change will have immediate effect here as well (you can give it a try without restarting, if that does not work, you must repeat it with restarting).
This may still cause incorrect colors in Photoshop though, since Photoshop may still convert the colors to sRGB or Adobe RGB. So instead of selecting "Generic RGB Profile", you may want to select the "sRGB" profile (depending on your OS X version, may also be named "sRGB IEC61966-2.1"). This way the image is already in sRGB color space. You only have to convince Photoshop to keep it that way (and not converting it to Adobe RGB) and then you will really see the same RGB values in Xcode and Photoshop.
Note how changing the color profile makes your display look quite differently? You think the color change is dramatically? Trust me, that is nothing compared to how different monitors may sometimes change the colors. Maybe you can now understand why color correction is so important. So the question is, why are the RGB values so important to you in the first place? Does it really matters, that RGB values are the same, as long as the displayed color is the same?
This is the guide that works, just follow these steps and you can set UIColor programatically and have them match colors from a screenshot.

Resources