UIView background color set is not what appears - ios

I created a UIView with a set background color. Lets say RGB value 185, 45, 42. For some reason, when I take a screenshot of this view, it is not that color. It is a little bit darker. Is there a reason why UIView would do this?
The UIView background color is set in interface builder like this:
When I run it on the simulator and take a screenshot and use the eye drop tool to determine the color, the numbers that show up are a little bit darker than what I entered. Same with a button.
I have other screens with the same red color and the screenshot I take of those, the red actually comes out correctly. I've been trying to determine what the difference is between those screens, but so far have not seen any. So I was just wondering if anyone would have any knowledge of anything that "could" case such a color change.

A common mistake when setting a color numerically in Interface Builder is to neglect the color space:
Different color spaces will give different colors (visually) for the same RGB values.

When you set RGB color, you should notice that all the three color values range from 0 to 1, so give them a value greater than 1 would never work. Try this:
RGB(185 / 255.0, 45 / 255.0, 42 / 255.0)

Related

What is the color code for iOS system labels in both light and dark mode?

Human Interface Guidelines, "Color" section talks about the using system color is preferred. There are color codes for all system colors however for the foreground content text color there only APIs provided.
So what exactly is the color code for labels in both light and dark mode? Our designers need these colors for their mockup.
https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/color/
The color code fetched from the Playground does not seem right. The hex codes are all the same.
The RGB values of secondary, tertiary, and quaternary label colour are in fact the same. They only differ in the alpha value, which you might have forgotten about :)
From what I observed:
Label colour has 100% alpha
Secondary label colour has 60% alpha
Tertiary label colour has 30% alpha
Quaternary label colour has 18% alpha
Here's another way to find the hex value of a system colour. Go to the asset catalog of an Xcode project. Add a colour set:
Then, select "Any Appearance" or "Dark Appearance" depending on which one you want ("Any Apperance" means "not dark"). You can even check the "High Contrast" box to have more options for how your dynamic colour will look depending on the situation.
Then select your desired colour from the "Content" dropdown (see freehand circle).
Finally, you can click on "Show Color Panel" to see the hex:

Creating a transparent color within a string palette

I am working within Google Earth Engine and am trying to create a no-color/completely transparent color (no boarder and no fill). Below is a line of code where the first color should be the transparent "color". Basically I want my min value to not show up in the map at all.
Map.addLayer(image, {min: 0, max: 3, palette: [transparent, '#0571b0', '#FFDF00', '#ca0020']},'image');
I have tried creating a variable to set a color as completely transparent (change the opacity to 0), but the palette command cannot take variables. Only strings. I've also read SVG fill color transparency, but do not understand how to change the opacity of that specific color without creating a variable (which again, palette doesn't allow). Lastly, I tried adding 00 to the end of another color, but that did not work either.
Any suggestions?
Update:
I was never able to find a solution to this and ended up just going with a white back ground. It was purely for a nicer aesthetic look to allow a basemap to be seen. If I ever come across a solution, I'll be sure to post it.
I had the same question. I found the solution in the developer group.
See the answers: https://groups.google.com/g/google-earth-engine-developers/c/WcxtEIzudxw/m/GscOlsQhDgAJ
The Solution:
// create your previous mask
image = image.eq(1)
// mask and set the opacity
image = image.mask(image.mask().where(image.eq(0),0.0))

Skip a particular color in smart invert mode of accessibility

Is there any way to skip a particular color in whole app when device is in smart invert mode of accessibility?
I don't want the blue color in my app to be inverted. I have am image which have black and blue color text in it. I want the black color text to be inverted but want to skip blue color.
Any help would be appreciated.
P.S -I am familiar with accessibilityIgnoresInvertColors. But this property can be applied on uiview or object but i need to skip a color.
do it inside the appcolor constant file :- you can check UIAccessibilityIsInvertColorsEnabled() if its true then return clear color else reurn the blue color.

Zeroing channels of cut out area

I imagine there is probably going to be an easy solution for this in GIMP, but I for the life of me can't figure it out.
I'm using the color picker tool with the use info window selected to verify pixel values.
Basically, I have some pixels in an image that I need to zero out. By that I mean I want the RGBA values to all be set to 0.
I attempted to:
use the rectangular select tool to select the group of pixels
use bucket fill to set the pixels to black with opacity set to 0.0
Then, to verify it was done correctly, I use the color picker to test the value of the rectangle I just filled.
Unfortunately, it seems to just contain the previous value. What am I missing here?
The "opacity" of the bucket-fill is the opacity of the paint, not the opacity of the resulting pixels. In other words the less opaque it is, the less visible the result. What you want to do is bucket-fill selection with black, then [delete].

iOS: What does tint color actually do?

Suppose a segmented control's tint color is set to RGB(69, 175, 225) but the actually color from color picker range from (top most) RGB(146, 181, 211) to (bottom most) RGB(82, 118, 147).
So how can I expect the actually displayed color of the segmented control. For example, if I want the color of the bottom most point is RGB(69, 175, 225), what is the RGB value should I set?
The tint is a color on which some fancy visual effects (glossy reflections and so on) is applied. iOS applies them to app icons, tab bars, navigation bars and many other things. I think it would be wrong for you to make any assumptions as to what the local color for a given pixel is for a given tint, given these visual effects vary from UIElement to UIElement and probably from one OS version to another.

Resources